03 · MetaPlay
Social play, then a prediction, then a receipt.
MetaPlay is the ecosystem desk for web3 social gaming and prediction. This page is how you enter it from Portal and how a builder wires a round to 0G.
What you are opening
MetaPlay is a social room that can host a game and a prediction on the same evening. People gather, pick a side, and leave with a result that can be checked. Portal is the entrance: the sample lobby below teaches the rhythm, and the integration steps are the ones you repeat in a real client.
This lobby is a lesson, not a book
How a round uses the stack
01
Sit down
A player connects a wallet on Galileo while testing, or mainnet when the table is live. The portal’s faucet desk adds the network in one confirmation.
02
Lock a side
Social play is the room: chat, a duel, a pick. Prediction is the question. The question text is fixed before the judge runs, so nobody edits the rules after the bets of attention are in.
03
Seal the record
Store the prompt, the rules, or a replay hash on 0G Storage and keep the root hash. That hash is the receipt you can show later.
04
Ask the judge
Call 0G Compute with an OpenAI-compatible SDK. Use trust mode verified when you need a signed routing proof, and private when the prompt should stay on a TEE path.
05
Settle
The outcome lands as a transaction on 0G Chain. Sub-second finality is the chain’s job. Your contract should be compiled for Cancun with Solidity 0.8.19.
Walk a sample round
Pick a table, choose a side, seal it, then ask the sample judge. The copy changes as the phase changes.
Sample lobby
Practice the round. Nothing here is a live market or a wager.
Open question
Will the sample match end with the home side ahead?
- 01 The table is open. A side is a local choice, not a transaction.
- 02 Sealing freezes the question. In production the prompt hash goes to 0G Storage.
- 03 The judge would call 0G Compute. Verified mode when you need provenance, private mode when the prompt must stay inside a TEE path.
Wire it from a project
- Add Galileo in the wallet. Chain id 16602, RPC https://evmrpc-testnet.0g.ai, symbol 0G, 18 decimals.
- Claim testnet gas at https://faucet.0g.ai. If that faucet already served the address today, use the Google Cloud Galileo faucet linked from the faucet desk.
- Give the session an agent identity when the player is an agent. Agentic ID follows ERC-7857. The guide is on this portal under Guides.
- Store the sealed prompt or replay hash with the storage SDK. Keep the root hash in the contract event so a maintainer can find it on Storage Scan.
- Call compute with the base URL from Private Computer and send header X-0G-Provider-Trust-Mode when the round needs verified or private routing.
- Settle on chain. Deploy with Hardhat or Foundry, evmVersion cancun, Solidity 0.8.19. The chain guide has both.
Official stack references live on the Builder Hub: https://build.0g.ai/compute, https://build.0g.ai/storage, https://build.0g.ai/chain, and https://build.0g.ai/agentic-id.
Test the path on every OS
The commands are the same idea everywhere. The shells are not. macOS and Linux export variables. Windows PowerShell uses $env:ADDRESS. The test bench lists the expected chain id, a non-zero balance, and a sample compute call.