Architecture

How Pledged 777
Actually Works

A full technical breakdown of the zero-fee pledge system — from wallet signature to permanent on-chain storage on Ritual Testnet. No gas, no IPFS, no middlemen.

01
What is Pledged 777?

Pledged 777 is a permanent genesis registry deployed on Ritual Testnet (Chain ID 1979). It lets any wallet claim one of exactly 777 slots by submitting a wallet address, a compressed image, and a 77-character message — all stored directly in contract storage.

The core innovation: you pay zero gas. Instead of requiring users to hold RITUAL tokens and pay transaction fees, a server-side relayer submits the on-chain transaction on your behalf. You only provide a cryptographic signature to prove ownership of your wallet.

Ritual is an EVM-compatible Layer 1 focused on on-chain AI and coprocessing. Pledged 777 is a genesis community registry built for early supporters of the network — 777 slots, one per wallet, forever.
02
Zero-Fee Architecture

Traditional dApps require users to pay gas for every on-chain action. Pledged 777 uses a meta-transaction relay pattern: you sign a message locally (free), and our server-side relayer submits the actual transaction to the blockchain, covering all gas costs.

User Relayer (Server) Ritual Testnet │ │ │ │── eth_requestAccounts ──▶ │ │ │ │ │ │── personal_sign ────────▶ │ │ │ (free, local op) │ │ │ │── verify signature │ │ │── check hasPledged() │ │ │── contract.pledge() ────▶ │ │ │ (relayer pays gas) │── store on-chain │ │ │── mint ERC-721 │ │◀── txHash ─────────────── │ │◀── txHash ─────────────── │ │

The relayer holds a funded wallet with RITUAL test tokens. When a pledge request arrives, it verifies the signature, confirms the wallet hasn't pledged before, then submits the transaction and absorbs the gas cost entirely.

03
Step-by-Step Process
01
Connect Wallet

MetaMask (or any EIP-1193 provider) is prompted via eth_requestAccounts. No network switch required — you can be on any chain. Only your public address is read.

02
Upload & Compress Image

Your image is resized client-side to 64×64 px and compressed to JPEG at adaptive quality until it fits under 4,600 characters as a Base64 data URI — compact enough to store in contract storage without IPFS.

03
Sign the Message (No Gas)

Your wallet signs a deterministic message via personal_sign (EIP-191). The message encodes your wallet address, binding the signature cryptographically to you. This is a local operation — it never hits the network and costs nothing.

04
Relayer Verifies & Submits

Your address, signature, image, and message are posted to /api/pledge. The server recovers the signer via ecrecover, verifies it matches your address, confirms no prior pledge exists, then calls pledge() on the contract — paying all gas from the relayer wallet.

05
On-Chain Confirmation

The contract assigns your wallet the next available rank (1–777), stores all data permanently in contract storage, and mints an ERC-721 token directly to your address. The transaction hash is returned and your entry appears in the Genesis List immediately.

04
Signature & Security

The signature mechanism prevents anyone from pledging on behalf of another wallet. Here is the exact message that gets signed, deterministically constructed from your address:

I am pledging my place in the Pledged777 genesis registry. Wallet: 0xYOUR_ADDRESS By signing, I confirm I am the owner of this wallet. This action is gasless and irreversible.

The relayer recovers the signer with ecrecover and rejects any request where the recovered address doesn't match the submitted wallet. The check runs server-side before the transaction is ever sent.

🔐One wallet, one slot — enforced on-chain. The contract maintains a hasPledged mapping. Even if the relayer were somehow bypassed, a second pledge from the same wallet would revert at the EVM level with no way around it.
05
On-Chain Storage

Unlike most NFT projects that store metadata on IPFS or centralized servers, Pledged 777 stores everything directly in contract storage. No external dependencies. No pins that expire. No servers that go offline.

struct PledgeData { address wallet; // your wallet address string imageUri; // base64-encoded 64×64 JPEG string message; // up to 77 characters uint64 pledgedAt; // unix timestamp of pledge uint16 rank; // your slot number (1–777) }

The contract is also ERC-721 compliant. When you pledge, an NFT is minted to your wallet with a fully on-chain tokenURI that returns your image and metadata as a Base64-encoded JSON data URI — readable by any NFT marketplace or wallet without external requests.

♾️As long as Ritual's chain history exists, your pledge exists. The data is part of the chain state — immutable, censorship-resistant, and readable by any Ethereum-compatible client with no additional infrastructure.
06
Smart Contract & Source

The contract is fully open-source. You can read every pledge, verify the 777 hard-cap, and audit the code without trusting us. The relayer API is also published — every piece of the system is transparent.

📄Contract: 0x0967fa38C8Cdcb7f245889F53956Cf0a58D9f261
Network: Ritual Testnet · Chain ID 1979