Blitz of the Hidden Soldiers
Blitz of The Hidden Soldiers (BoTHS), a game of incomplete information, blends the strategic depth of traditional chess with the intrigue of hidden moves and pieces. This project will implement a blind chess game on the Topos testnet, leveraging ZKPs to obscure board positions. The primary collectible, donums (Latin for gifts), bestow unique abilities upon players. In this immersive gaming experience, each player is distinctly identified by their public blockchain address, ensuring transparency and security throughout the gameplay.
Install hardhat and development dependencies with npm
npm i
or with yarn
yarn install
Follow the online guide to install circom
Try running some of the following tasks:
- To compile all
circom
circuits and generate correspondingzkeys
:
./scripts/check_circom.sh
- General HardHat/Smart Contract Commands Run Tests
npx hardhat test
Run a local node
npx hardhat node --deploy --export-all deployments.json
Deploy (using the [hardhat-deploy] (https://github.com/wighawag/hardhat-deploy) plugin)
npx hardhat deploy --export-all --network [network-name]
Upload smart contract addresses and their corresponding ABI to Firebase
npx hardhat run scripts/writeDeploymentsToFirebase.ts
src/contracts
: Solidity Smart contractsChessPieceCollection
: ERC1155 Game Collectible contractGameManager.sol
: Create games, validate piece formations, and token stakes.ChessGame.sol
: All the chess-specific logic you'd expect. Was that a checkmate?src/circom_verifiers
: Solidity verifier contracts for circom circuits.src/contracts/mocks
: Mock smart contracts for testing.
src/circuits
: Circom circuitssrc/tests
: Tests!
- ChessPieceCollection.sol: 0xD42a0ecFbDA16f22aA05c83b68EA4a673C53FA23
- GameManager.sol: 0x746dF08DCC2B6Ef57cC996f128933aB831251474
- PieceMotionPlonkVerifier.sol: 0x462F40693289309b0292fdbFC9dbF484EEc6e64E
- PlayerVisionPlonkVerifier.sol: 0xE2B8d66C60f0f3B725078D00E3FEf5BbDD77817a
- RevealBoardPositionsPlonkVerifier.sol: 0x491CebC71299D816870b76451df55419226a4485
Read the DevLog