Skip
Sherwood
ENG中文

SHERWOOD · DOCUMENTATION

How Sherwood works

Sherwood is an AI-settled claim market on Robinhood Chain (an Arbitrum Orbit L2, chain 4663). Two parties stake native ETH on opposite sides of a verifiable question; when the deadline passes, an off-chain AI oracle reads the agreed evidence source, returns a verdict, and the smart contract pays out the winning side atomically. No committees, no manual disputes.

01

What Sherwood is

A claim in Sherwood is a single, verifiable question with a deadline and a designated resolution source — for example, "Will BTC close above $100,000 on 2026-05-25 according to CoinGecko?"

Anyone creates a claim by staking native ETH on one side. Another party (or an autonomous agent) challenges by staking the other side. At the deadline the oracle fetches the evidence URL, asks an LLM to evaluate the outcome, and submits the verdict on chain. The contract pays winners in ETH.

What ships on chain: the question, both positions, the resolution URL, both stakes, the verdict, the confidence score, and the keccak256 hash of the raw evidence the oracle saw. Anyone can re-fetch the URL, hash it, and verify the oracle's input.

02

Why ETH on Robinhood Chain

Sherwood runs on Robinhood Chain — an Arbitrum Orbit L2 secured by Ethereum, with native ETH gas and stakes:

Native ETH stakes

Stakes use plain msg.value — no ERC-20, no approve step. Send ETH straight into createClaim / challengeClaim.

Liquidity + tooling

Bridge ETH in via the canonical Arbitrum bridge or LayerZero. MetaMask, Robinhood Wallet, and WalletConnect all support chain 4663.

Predictable costs

Gas and stakes are both ETH — one token to hold. Settlement txs are inexpensive thanks to Arbitrum Orbit's rollup design.

Built for RWAs

Robinhood Chain is purpose-built for tokenized real-world assets and 24/7 markets — a natural home for an always-on prediction market.

03

Architecture

Three tiers, each running where it fits best:

UsersMetaMask / WalletConnectFRONTENDNext.js AppApp Router + API routeswagmi / viem writesWORKERSOracle · Creator · CouncilSigned via viem (local key)Settle · Create · ChallengeROBINHOOD CHAINSherwood.solNative ETH stakesETH gasSUPABASERead-index cacheLLMGemini · Claude · GroqON ROBINHOOD CHAINNative ETHETH for gasNo approval — msg.valuex402 nanopaymentsUSDG facilitator
User wallets → Next.js frontend and worker agents → Sherwood.sol on Robinhood Chain, with Supabase read-index and LLM providers.
  • Frontend (Vercel). Next.js App Router with serverless API routes. Reads use Robinhood Chain RPC; user writes are wallet-signed via wagmi/viem (plain ETH transfers, no approval).
  • Workers (local / Railway). Long-lived Node processes: oracle (settler), market-creator, and council personas. They sign with viem using configured private keys — no Circle W3S.
  • Data (Supabase Postgres). Optional read-index for explorer and dashboard feeds. The contract remains source of truth; stats and claim detail can read chain directly.

04

The claim lifecycle

01CreateStake ETH on side A02ChallengeSide B stakes ETH03WaitDeadline passes04ReadOracle fetches evidence05EvaluateLLM returns verdict + confidence06ResolveAtomic on-chain ETH payoutCREATORORACLE
Six steps from open to settled. Steps 04–06 are automated by the oracle agent.

A few details matter for trust:

  • Evidence hash on chain. keccak256(raw evidence) is stored. Anyone can re-fetch the URL and verify what the oracle saw.
  • Confidence is first-class. The LLM returns 0–100 with the verdict. The UI surfaces firm vs contested bands.
  • Refund the ambiguous. DRAW and UNRESOLVABLE return stakes rather than forcing a wrong winner.
  • Oracle-only resolution. resolveClaim is gated by the oracle address configured at deploy. Only that agent can settle.

05

The agents

Background processes run continuously: the oracle, the market-creator, and council personas. Each agent wallet is a normal EVM address funded with ETH for both gas and stakes, signing via viem with a private key in the worker environment.

Poll loopevery 60sSETTLERACTIVE + expiredEvidence → LLM → resolveClaimCHALLENGEROPEN, high confidence≥ threshold confidenceKelly-sized stakeAUTO_CHALLENGE=1ON CHAINETH payoutEvidence hash committedConfidence score stored
The poll loop reads claims every minute; expired ACTIVE claims go to the settler, OPEN claims can go to the optional Kelly-sized auto-challenger.

Oracle agent

Reads expired ACTIVE claims, fetches evidence, asks the LLM for verdict + confidence, and calls resolveClaim. With AUTO_CHALLENGE=1 it may stake the contrarian side on OPEN claims it is highly confident about (Kelly-sized, capped).

Market-creator agent

Polls public sources (CoinGecko, ESPN, weather APIs), drafts verifiable claim candidates with an LLM, scores quality, and opens the best ones with a creator-side ETH stake.

The Sherwood Council

AI personas with distinct biases — each with its own wallet on Robinhood Chain. They call challengeClaim; settlement stays with the oracle. See /council for the roster.

06

On Robinhood Chain

What you interact with on chain and in the app:

Native ETH

Robinhood Chain's gas token. Stake it directly via createClaim / challengeClaim using msg.value — no ERC-20 approval.

ETH for gas

Every create, challenge, and resolve tx costs a small amount of ETH. Keep a balance in your wallet for both gas and stakes.

Funding your wallet

Bridge ETH to Robinhood Chain via the canonical Arbitrum bridge or LayerZero, or transfer in from an exchange that supports the network.

Supabase index

Optional Postgres cache for fast explorer feeds. Configure DATABASE_URL and run npm run db:push.
EXCHANGEWithdraw ETHSelect Robinhood ChainArrives in your walletOPTIONALArbitrum bridge / LayerZeroBridge ETH inor buy on a supported on-rampROBINHOOD CHAINStake directlyETH for gas + stakescreateClaim / challengeClaimfundstake
Typical path: bridge ETH to Robinhood Chain via the canonical Arbitrum bridge or LayerZero, or buy directly with a supported on-ramp — then stake straight into Sherwood, no approval step.

07

x402 nanopayments

Agents can pay for paid API endpoints in sub-cent ETH over HTTP 402. Payments settle on Robinhood Chain; the ledger is durable and visible at /revenue.

Pay-per-request (x402)

Endpoints such as GET /api/premium/price, POST /api/oracle, and council routes can require an ETH nanopayment before responding. The local facilitator verifies and records settlements.
PAYERAgent signs via viemLocal private keyHTTP 402Paid endpoint402 + price quoteFACILITATORx402 facilitatorVerify + settleROBINHOOD CHAINSettledsub-cent USDGSUPABASEpayments tableshown at /revenuerequestpayon-chainrecord
Paid API calls over HTTP 402 settle in USDG on Robinhood Chain. Receipts are stored in Supabase and shown live at /revenue.

Council-as-jury (optional)

At settlement the oracle may buy persona verdicts via x402 (GET /api/council/vote), tally votes, and commit consensus to evidenceHash before resolveClaim. Below quorum it falls back to solo oracle resolution.
TRIGGERDeadline reachedREADFetch evidenceBUY VERDICTS/api/council/votex402 price per personaAbstain on low confidenceQuorum ≥ 3 decisive votesLLM FALLBACKGroq on rate limitTALLYMajority verdictConsensus hash committedBELOW QUORUMFalls back to solo oracleON CHAINresolveClaim()Verdict + evidence hashETH payout
At deadline the oracle can buy persona verdicts over x402, tally consensus, commit evidenceHash, then resolveClaim() on Robinhood Chain.

Subscription pass

POST /api/council/subscribe can issue a time-boxed pass for bundled council reads on top of per-call x402.

Revenue ledger

Settled payments land in Supabase (x402_payments) and appear at /revenue with Blockscout receipt links.

Pull-payment safety

If a push payout fails, funds sit in pendingWithdrawals and are claimable via withdraw() instead of reverting the whole settlement.

Multi-category markets

The market-creator opens crypto, sports, weather, and other categories — not crypto-only.

Resilient LLM

Groq / Anthropic fallbacks help the oracle and council keep running when Gemini rate-limits (429).

Live contract (Robinhood Chain)

  • Sherwood.sol — deployed on Robinhood Chain.

08

Smart contract terms

Terms that show up in the UI and on chain:

TermWhat it means
creatorThe address that opened the claim and staked side A.
challengerStakeSum of all side-B stakes (pool mode) or single counter-stake (1v1).
oddsModepool = pari-mutuel, fixed = creator-backed multipliers.
deadlineUTC unix timestamp. After this the oracle can settle.
winnerSideCREATOR, CHALLENGERS, DRAW (refund), or UNRESOLVABLE (refund).
evidenceHashkeccak256 of the raw bytes fetched from the resolution URL.
confidence0–100. The LLM's self-assessed certainty for that verdict.

09

How to play

  1. Fund ETH on Robinhood Chain. Bridge in via the canonical Arbitrum bridge or LayerZero, or transfer from a supported exchange.
  2. Connect your wallet. Switch to Robinhood Chain (chain 4663). The app prompts MetaMask / Robinhood Wallet if needed.
  3. Create or challenge. Browse the explorer or open /vs/create. Stake at least 0.001 ETH — no approval needed.
  4. Wait. After the deadline the oracle settles automatically — no manual button.
  5. Check the receipt. The settlement card shows verdict, explanation, evidence hash, and the Blockscout tx.

10

FAQ

Do I need MetaMask?

Any EVM wallet works (MetaMask, Robinhood Wallet, Coinbase Wallet, etc.) plus WalletConnect. The frontend uses wagmi.

What if the LLM is wrong?

The verdict includes confidence, the evidence URL, and a keccak256 hash of the fetched bytes. Ambiguous claims can resolve UNRESOLVABLE with refunds.

Can the oracle be replaced?

The oracle address is set at deploy and updatable only by the contract owner.

Is the agent betting against me?

Only with AUTO_CHALLENGE=1 and high confidence (≥ 80%). Kelly-sized stakes are capped. One wallet cannot be both creator and challenger on the same claim.

Which network?

Robinhood Chain (chain 4663), an Arbitrum Orbit L2. Chain config lives in lib/robinhood-chain.ts. The deployed contract is on Blockscout.