On-chain unified chess rating + staking contests + NFT match records with ENS identities
Chess.fun
A decentralized protocol that unifies chess ratings (FIDE, Lichess, Chess.com) on-chain, powers stake-based contests, enables spectator betting, and mints verified match NFTs mapped to ENS identities.
Problem
Ratings are fragmented and not portable across platforms. Match records are stored off-chain and can be tampered with. Tournaments lack standardized prize distribution and governance. Spectator betting and fan engagement in chess are underdeveloped.
Solution
Unified On-Chain Rating Fetch public ratings from FIDE, Lichess, and Chess.com. Aggregate via oracle (Chainlink Functions) with weighted formula (FIDE > Lichess > Chess.com). Store in a RatingRegistry smart contract for trustless portability. ENS Identity Layer Assign subdomains (username.chess.eth) linked to player profile, rating, and metadata. Tamper-Proof Match Records Games played off-chain; players sign EIP-712 consent messages committing to PGN hash. Hash + signatures stored on-chain. Full PGN archived on Walrus/IPFS/Filecoin for verifiable integrity. Contests + DAO Governance Players stake tokens to enter tournaments. Prize pool auto-distributed via smart contracts. Disputes or exceptions resolved by DAO vote (≥60% approval). Spectator Markets & Fan Backing Lightweight prediction markets allow spectators to bet on outcomes. Fans can “back” players by purchasing upside-linked tokens. NFTs & Royalties Best matches minted as ERC-721 NFTs with EIP-2981 royalties. Community upvotes decide which matches get NFTized, rewarding players long-term.
Architecture & Flow
Onboarding → Players link external accounts; system fetches ratings via APIs. Oracle Layer → Chainlink Functions fetch & aggregate → update RatingRegistry. Identity → ENS subdomains map to on-chain rating + metadata. Matches → Players sign commitments (EIP-712), stored on-chain; PGNs stored on Walrus/IPFS. Tournaments → Smart contracts manage stakes, prize pool, DAO voting. Betting & NFTs → Prediction markets + NFTization extend fan engagement.
How it’s made
Core Chain & Smart Contracts Deployed on Rootstock (RSK) for EVM-compatibility and low fees. Written in Solidity using Remix.
Contracts:
RatingRegistry – stores aggregated ratings. MatchRegistry – stores signed commitments (hashes of PGNs). TournamentDAO – manages stakes, prize pools, and voting. ChessNFT – ERC-721 match NFTs with EIP-2981 royalties.
Oracles & Rating Aggregation
Chainlink Functions fetch data from FIDE lists, Lichess API, and Chess.com API. Aggregation logic applies weighted formula (FIDE > Lichess > Chess.com). Updates pushed back to RatingRegistry contract.
Identity Layer
Integrated with ENS for subdomains like surya.chess.eth. Subdomain resolver points to player profile + rating + metadata.
Storage & Match Records
Walrus used for decentralized storage of PGN files and match replays. Only content hash anchored on Rootstock chain for integrity. Players sign EIP-712 messages (move consent + result), creating tamper-proof records.
Governance & Contests
Tournament contracts lock player stakes (e.g., USDC). Prize pools automatically split on results. DAO logic for dispute resolution (≥60% approval needed).
Spectator Engagement
Simple prediction market contracts let fans bet on outcomes. Tokenized “back a player” model for long-term fan investment.
NFTization of Matches
Community-voted best matches minted as NFTs. Metadata + PGN stored on Walrus, token URIs resolve to stored data. Royalties flow back to players via EIP-2981.
Indexing & Frontend
The Graph indexes ratings, matches, NFTs, and contests for fast queries. Frontend built in Next.js + Wagmi + Ethers.js.
Hacky / Novel Bits
Used dual-signature PGN commit (both players sign the same hash) to prevent unilateral tampering. Weighted rating algorithm combines multiple off-chain ratings into one portable on-chain identity. DAO-controlled prize distribution adds transparency and fairness.

