Skip to content

anishmehta24/Near-dev-hackathon

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI vs AI Chess Battle Game on Blockchain

πŸŽ₯ Watch Demo Video

πŸ“Œ Project Overview

This is a decentralized AI vs AI chess battle platform where users can bet on their preferred chess engine. The game operates on the NEAR blockchain, ensuring secure transactions, fair matchmaking, and automated payouts. Users sign in with their NEAR wallet, and when the game ends, the losing amount is automatically transferred to the winner via smart contract logic.

πŸš€ Features

  • AI vs AI Chess Battle – Watch two chess engines compete in real-time.
  • Blockchain-based Betting – Users bet on the outcome using NEAR tokens.
  • Automated Payouts – Smart contracts handle winnings and deductions securely.
  • User Authentication – NEAR Wallet integration ensures secure sign-in.
  • Dynamic Match Variations
    • Users can bet at any stage of an ongoing game.
    • ELO-based matchmaking: Stronger players get a weaker AI, and vice versa.
    • 1v1 Chess – Two users can play against each other, and bets are placed based on ELO.
  • Tamper-Proof & Transparent – Blockchain records all transactions and game data immutably.

πŸ”§ Tech Stack

  • Frontend: React.js / Next.js
  • Backend: Node.js / Express.js
  • Blockchain: NEAR Protocol, Smart Contracts
  • Chess Engine: Stockfish / AlphaZero

πŸ› οΈ How It Works

  1. User Signs In – Connects their NEAR Wallet.
  2. Place a Bet – Select a chess engine and bet NEAR tokens.
  3. Watch the Game – AI engines play, and game updates happen in real-time.
  4. Game Ends – The smart contract calculates the winner.
  5. Automated Payout – The losing amount is deducted and sent to the winner.

πŸ”’ Security & Fairness

  • Smart Contracts ensure fair betting and payout distribution.
  • Blockchain Transactions prevent tampering and fraud.
  • Game Results & Moves are publicly recorded on the blockchain.
  • No Third-Party Control – Funds are handled automatically and securely.

πŸ“œ Installation & Setup

  1. Clone the repository:
    git clone https://github.com/yourusername/ai-chess-battle.git
    cd ai-chess-battle
  2. Install dependencies:
    npm install
  3. Set up NEAR Wallet authentication.
  4. Deploy the smart contract to the NEAR Testnet.
  5. Start the frontend:
    npm run dev
  6. Start the backend:
    npm run dev

πŸ“„ Future Enhancements

  • Live Chat & Spectator Mode
  • NFT-Based Betting Rewards
  • More AI Variants & Customizable Matches
  • Integration with Other Blockchains (Ethereum, Solana, etc.)

🀝 Contributing

Feel free to fork the project, raise issues, and submit pull requests!


Made with ❀️ for Chess & Blockchain!

Releases

No releases published

Packages

No packages published

Languages

  • C 83.5%
  • JavaScript 14.7%
  • TypeScript 1.3%
  • Other 0.5%