Stake&Steal

Would you SPLIT the bounty 🤝 or STEAL it ALL 💰? Win stakes + rare Indian Mandala Art NFT 🎨🔥

Stake&Steal

Created At

ETHGlobal New Delhi

Project Description

Stake&Steal is a trustless, human-only duel that fuses classic game theory with cutting-edge Web3 primitives. Players face off in a best-of-five Split-or-Steal match, staking tokens each round. The twist: every victory isn’t just about taking home your opponent’s bounty — it also mints a one-of-a-kind Mandala NFT, a cultural artifact generated deterministically from an on-chain random seed.

We solve two common problems in blockchain gaming:

Identity & fairness — Only real, verified humans can play. With the Self Protocol SDK, players prove they’re unique via ZK verification, producing a nullifier (an anonymous, one-per-person proof). No bots, no duplicate accounts, no PII leaks.

Randomness & verifiability — Rewards are seeded by Pyth Entropy V2, ensuring every NFT has a tamper-proof, on-chain provenance. The same seed will always generate the same Mandala, so the artwork is reproducible forever.

From wallet connection to duel resolution, the experience runs fully in the browser with MetaMask and a sleek React/Tailwind frontend. The result: a cultural, provably fair, human-only game layer where every win is both economic and artistic.

How it's Made

Identity (Self SDK): Players verify once via Self.xyz (Aadhaar/Passport). The dApp receives only a scoped nullifier, binding wallet ↔ human. This enforces one-human-one-account without ever touching PII.

Smart Contracts (Solidity + Hardhat):

ACGC.sol - 'Self' configuration, ZK based verification, user identification with banned and active users.

SplitOrSteal.sol — Escrows stakes, runs commit–reveal logic for each round, resolves payouts after 5 rounds.

BadgeSeed.sol — Wraps Pyth Entropy V2. Players pay the entropy fee, request randomness, and receive a verifiable bytes32 seed.

SeedArtNFT.sol — Minimal ERC-721 contract (OpenZeppelin) that mints NFTs linked to generated Mandalas.

Verification (Self): All player actions—sign-ups, verifications, bans, unbans, and dispute flags—are anchored on-chain through a single Self-verified nullifier. Every win, loss, or cheat flag emits an event that can be audited later, while the contract stores only lightweight state to keep gas low. Future rule-based allow/deny lists build on the same flow without changing the core contract.

Randomness (Pyth Entropy): Seeds are fetched directly from Pyth contracts (no intermediaries). The request emits events, and once fulfilled, the same value can always be recomputed on-chain. This seed is piped directly into the Mandala renderer.

Frontend (React + Vite + Tailwind + shadcn + p5.js):

Wallet management + network guard (Base Sepolia for gameplay).

Commit–reveal UI flow with real-time feedback.

p5.js Mandala generator that deterministically renders art from entropy seeds.

IPFS (via Pinata) integration to store images/metadata before minting.

Networks:

Celo Sepolia — used for Self Protocol identity verification.

Base Sepolia — used for gameplay, entropy calls, and NFT minting.

Hacky Bits:

Forced MetaMask re-selection on logout for multi-wallet fairness.

Deterministic SVG + p5.js pipeline, ensuring reproducibility and gas-friendly rendering.

On-chain banlist tied to nullifiers — cheaters can be permanently excluded.

Stake&Steal blends Self SDK (identity) + Pyth Entropy (fair randomness) + commit–reveal staking (gameplay) to deliver a Web3 game that’s human-only, tamper-proof, and artistically meaningful.

background image mobile

Join the mailing list

Get the latest news and updates