- A wallet for the user
- The user appearing on-chain
- Each social action minting verifiable YCR
- The user able to swap YCR ↔ YCE via AMM
- The user’s phone signing blocks (counted on the dashboard)
Network basics
To add the network programmatically (MetaMask Mobile, WalletConnect, etc.):
Step 1 — wallet
Two options: A. Bring your own (MetaMask, WalletConnect, etc.) — standard Ethereum wallets work. Sign withsecp256k1, EIP-155 transactions are required (ethers v6 default).
B. Build the wallet into your app — BIP-39 phrase, BIP-44 path m/44'/60'/0'/0/0, phrase in
the platform secure store, key re-derived per signature.
Step 2 — faucet
Fund the wallet before any other call. Faucet drops 0.1 native YCE + 11K YCE token + 1K YCR in a single request.202 Accepted in under a second — the transfers are submitted, not
yet settled. Balances appear ~15 s later (three blocks). Poll the pollUrl in the
response, or eth_getBalance, every 5 s; do not treat the first empty balance as a failure.
See Events & confirmations.
Full faucet docs →
Step 3 — identity (optional but recommended)
If your app shows a user profile, register the device so the indexer tracks it:Step 4 — engagement actions
Every social action in the app — Post, Like, Share, Comment, Watch, NftCreate, Tip — should call the engagement endpoint to mint YCR for the user. No private key required — the indexer signs via the oracle wallet and attributes the action to the user inside the calldata.EngagementOracle.recordAction(user, actionType, weight, targetId) on-chain and accumulates pending YCR for the user. The mint rate per action is governed by setYCRMintRate(ActionType, rate), set by the foundation.
Step 5 — display rewards
Show the user how much YCR they’ve earned:Step 6 — claim YCR
When the user wants to convert pending YCR into actual ERC-20 balance:Step 7 — AMM swap
YCR → YCE conversion through the on-chain pool. Swap rate floats with reserves; 2% of input is burned.Step 8 — register in the ValidatorRegistry (optional)
Bonding 10K YCE registers the address inValidatorRegistry. register takes four arguments
and is not payable — the stake is pulled with transferFrom, so approve first. Registering
also requires a 48-byte BLS public key and a 32-byte ed25519 public key, which is why this
step only makes sense for someone who is actually running a candidate node.
Step 9 — block endorsements (off-chain participation signal)
The app can sign each new block hash and submit it. Be precise about what this is: the signature is verified by the indexer and stored in an off-chain table, over a block that was already finalised. It is not recorded on-chain, it is not checked against the bond, and it carries no consensus weight.Voting in the DAO
The DAO is the new contract at0xa5851461a5cff6f8277917f2a691d3c6ef5bef9e with a 5-minute voting period (testnet only — mainnet is 7 days).
Address book
Signing model — important for the wallet team
YouthChain has two transaction-signing surfaces. Pick the right one per use case.1. eth_sendRawTransaction — for user-signed txs (production path)
Standard Ethereum: the user’s secp256k1 key signs a serialized RLP tx (EIP-155 / EIP-1559 / legacy), the node ecrecovers the sender. Works with MetaMask, WalletConnect, ethers, viem, hardware wallets — anything that speaks the Ethereum spec.
Use this for: swap, stake, vote, claim-by-self, transfer, register validator, mint NFT, register .yc handle. Anything the user initiates.
2. /api/mobile/engagement-onbehalf + /api/mobile/claim — for relayed txs (no user gas)
The indexer signs on behalf of the user using the authorized oracle wallet. The user’s address is carried inside the calldata, attribution stays correct, but the user does not pay gas and does not need to sign. This is testnet UX scaffolding.
Use this for: engagement actions (HOT path — would be terrible UX to ask MetaMask on every like), gasless claim fallback.
Common gotchas
- Always pass
type: 0to ethers transaction options for now. The chain accepts EIP-1559 (type: 2) but legacy is most reliable across mobile wallets. - Use
batchMaxCount: 1onJsonRpcProvider. Older builds did not support JSON-RPC batching; explicit override avoids surprises. - Don’t skip the faucet for new wallets — without 0.1 native YCE, the wallet can’t pay gas for any user-signed tx.
- EngagementOracle is
onlyOracle— clients cannot callrecordActiondirectly. Always go through/api/mobile/engagement-onbehalf. YCRRewards.claim(uint8)costs gas — show a “claim now” button, don’t auto-claim. Fall back to/api/mobile/claimif the user has no gas.- MetaMask AccountTracker quirk: after adding YouthChain Testnet, open the MetaMask popup once on the new network so its balance cache populates. Without this,
eth_getBalancereturns0x0and writes show “insufficient funds” even when the chain has the balance.
Help
- Issues with the testnet, RPC, or this guide → contact the YouthChain dev team
- Test wallet pre-funded with everything: see Test Accounts
- Live troubleshooting steps: Troubleshooting