Inspiration

While staking games already exist in the Web3 space, most are either lottery-style or player-versus-pool models with no real-time competition. There was a clear gap in direct, one-on-one staking games — where two players compete head-to-head and only one walks away with the prize. This inspired the creation of Duel-it, a simple, fair, and high-stakes two-player game that combines the thrill of competition with the trustlessness of blockchain.

What it does

Duel-it is a two-player staking game built on Solidity.

  • Two players enter the game by staking an equal amount of cryptocurrency.
  • Once both players have joined and staked the same amount, the game begins. -Right now there is Memory card game, in future many such games can be added.
  • The winner is determined through the integrated game logic.
  • The winner receives 95% of the total stake (from both players), and 5% is taken as a platform fee by the game owner.
  • All interactions and fund transfers are handled securely and transparently by the smart contract.

How we built it

Smart Contract: Written in Solidity, the contract handles everything from equal staking validation to payout distribution and fee handling.

Frontend: Built using React.js with Tailwind CSS for a clean and responsive UI.

Blockchain Deployment:

  • Deployed on the Sepolia Testnet.
  • Smart contract is verified for transparency and auditability.

State Handling: Logic ensures only valid duels happen — with equal stakes and valid winner determination.

Wallet Integration: Players connect via MetaMask to stake and play seamlessly.

Challenges we ran into

Ensuring fairness by validating equal staking from both players. Preventing manipulation of winner selection and ensuring the payout flow was tamper-proof. Designing a fluid game flow that handles edge cases like one player failing to confirm or dropping off. Integrating smart contract functions cleanly with the frontend for a smooth user experience.

Accomplishments that we're proud of

Successfully deployed and verified a fully trustless two-player staking game. Built a clean and responsive frontend with real-time contract interaction. Ensured secure fund management with automatic winner payout and platform fee handling. Deployed the solution on-chain with a focus on fair play and decentralization.

What we learned

  • Solidity best practices for building secure, fair, and gas-efficient contracts.
  • Real-world smart contract testing and verification workflows.
  • React-based dApp development and wallet integration.
  • Tailwind CSS for rapidly styling decentralized app frontends.

What's next for Duel-it

  • Multiple Games: Expand Duel-it into a full-fledged platform featuring a variety of 1v1 games.
  • Scalability: Enable multiple simultaneous duels and rooms for different players to compete at once.
  • Provably Fair Randomness: Integrate Chainlink VRF or similar tools for games involving chance.
  • Token Support: Allow staking with various ERC-20 tokens and possibly introduce a native platform token.
  • Leaderboards & Rewards: Add performance tracking, player rankings, and seasonal tournaments.
  • Mainnet Launch: Finalize audits and launch on mainnet with a community-driven roadmap and prize incentives.

Built With

Share this project:

Updates