├── .gitignore ├── .prettierignore ├── Anchor.toml ├── Cargo.lock ├── Cargo.toml ├── README.md ├── circuits ├── artifacts │ ├── board_verification_key.json │ ├── ptau │ │ ├── pot15_0000.ptau │ │ ├── pot15_0001.ptau │ │ ├── pot15_0002.ptau │ │ ├── pot15_0003.ptau │ │ ├── pot15_beacon.ptau │ │ └── pot15_final.ptau │ ├── setup │ │ ├── board.r1cs │ │ ├── board_js │ │ │ ├── board.wasm │ │ │ ├── generate_witness.js │ │ │ └── witness_calculator.js │ │ ├── shot.r1cs │ │ ├── shot_js │ │ │ ├── generate_witness.js │ │ │ ├── shot.wasm │ │ │ └── witness_calculator.js │ │ └── zkey │ │ │ ├── board_0000.zkey │ │ │ ├── board_0001.zkey │ │ │ ├── board_0002.zkey │ │ │ ├── board_0003.zkey │ │ │ ├── board_final.zkey │ │ │ ├── shot_0000.zkey │ │ │ ├── shot_0001.zkey │ │ │ ├── shot_0002.zkey │ │ │ ├── shot_0003.zkey │ │ │ └── shot_final.zkey │ └── shot_verification_key.json ├── board.circom ├── shot.circom └── templates │ ├── hitShip.circom │ ├── placeShip.circom │ ├── poseidonDecrypt.circom │ └── shipRange.circom ├── game-cli.png ├── game-cli ├── cli.ts └── cli │ ├── game.ts │ ├── instructions.ts │ ├── keys.ts │ ├── playground.ts │ └── validateCoords.ts ├── migrations └── deploy.ts ├── package.json ├── programs └── zk-battleship │ ├── Cargo.toml │ ├── Xargo.toml │ └── src │ ├── board_verifying_key.rs │ ├── errors.rs │ ├── instructions │ ├── finalize_game.rs │ ├── join_game.rs │ ├── mod.rs │ ├── new_game.rs │ ├── opening_shot.rs │ └── play.rs │ ├── lib.rs │ ├── shot_verifying_key.rs │ └── state │ ├── game.rs │ └── mod.rs ├── scripts ├── circuits.sh ├── parse_verifyingkey.js └── ptau.sh ├── src ├── battleshipClient.ts ├── poseidonEnc.ts └── utils.ts ├── tests └── zk-battleship.ts ├── tsconfig.json ├── yarn-error.log └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/.gitignore -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/.prettierignore -------------------------------------------------------------------------------- /Anchor.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/Anchor.toml -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/Cargo.lock -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/Cargo.toml -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/README.md -------------------------------------------------------------------------------- /circuits/artifacts/board_verification_key.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/board_verification_key.json -------------------------------------------------------------------------------- /circuits/artifacts/ptau/pot15_0000.ptau: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/ptau/pot15_0000.ptau -------------------------------------------------------------------------------- /circuits/artifacts/ptau/pot15_0001.ptau: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/ptau/pot15_0001.ptau -------------------------------------------------------------------------------- /circuits/artifacts/ptau/pot15_0002.ptau: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/ptau/pot15_0002.ptau -------------------------------------------------------------------------------- /circuits/artifacts/ptau/pot15_0003.ptau: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/ptau/pot15_0003.ptau -------------------------------------------------------------------------------- /circuits/artifacts/ptau/pot15_beacon.ptau: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/ptau/pot15_beacon.ptau -------------------------------------------------------------------------------- /circuits/artifacts/ptau/pot15_final.ptau: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/ptau/pot15_final.ptau -------------------------------------------------------------------------------- /circuits/artifacts/setup/board.r1cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/board.r1cs -------------------------------------------------------------------------------- /circuits/artifacts/setup/board_js/board.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/board_js/board.wasm -------------------------------------------------------------------------------- /circuits/artifacts/setup/board_js/generate_witness.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/board_js/generate_witness.js -------------------------------------------------------------------------------- /circuits/artifacts/setup/board_js/witness_calculator.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/board_js/witness_calculator.js -------------------------------------------------------------------------------- /circuits/artifacts/setup/shot.r1cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/shot.r1cs -------------------------------------------------------------------------------- /circuits/artifacts/setup/shot_js/generate_witness.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/shot_js/generate_witness.js -------------------------------------------------------------------------------- /circuits/artifacts/setup/shot_js/shot.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/shot_js/shot.wasm -------------------------------------------------------------------------------- /circuits/artifacts/setup/shot_js/witness_calculator.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/shot_js/witness_calculator.js -------------------------------------------------------------------------------- /circuits/artifacts/setup/zkey/board_0000.zkey: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/zkey/board_0000.zkey -------------------------------------------------------------------------------- /circuits/artifacts/setup/zkey/board_0001.zkey: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/zkey/board_0001.zkey -------------------------------------------------------------------------------- /circuits/artifacts/setup/zkey/board_0002.zkey: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/zkey/board_0002.zkey -------------------------------------------------------------------------------- /circuits/artifacts/setup/zkey/board_0003.zkey: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/zkey/board_0003.zkey -------------------------------------------------------------------------------- /circuits/artifacts/setup/zkey/board_final.zkey: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/zkey/board_final.zkey -------------------------------------------------------------------------------- /circuits/artifacts/setup/zkey/shot_0000.zkey: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/zkey/shot_0000.zkey -------------------------------------------------------------------------------- /circuits/artifacts/setup/zkey/shot_0001.zkey: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/zkey/shot_0001.zkey -------------------------------------------------------------------------------- /circuits/artifacts/setup/zkey/shot_0002.zkey: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/zkey/shot_0002.zkey -------------------------------------------------------------------------------- /circuits/artifacts/setup/zkey/shot_0003.zkey: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/zkey/shot_0003.zkey -------------------------------------------------------------------------------- /circuits/artifacts/setup/zkey/shot_final.zkey: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/setup/zkey/shot_final.zkey -------------------------------------------------------------------------------- /circuits/artifacts/shot_verification_key.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/artifacts/shot_verification_key.json -------------------------------------------------------------------------------- /circuits/board.circom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/board.circom -------------------------------------------------------------------------------- /circuits/shot.circom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/shot.circom -------------------------------------------------------------------------------- /circuits/templates/hitShip.circom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/templates/hitShip.circom -------------------------------------------------------------------------------- /circuits/templates/placeShip.circom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/templates/placeShip.circom -------------------------------------------------------------------------------- /circuits/templates/poseidonDecrypt.circom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/templates/poseidonDecrypt.circom -------------------------------------------------------------------------------- /circuits/templates/shipRange.circom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/circuits/templates/shipRange.circom -------------------------------------------------------------------------------- /game-cli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/game-cli.png -------------------------------------------------------------------------------- /game-cli/cli.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/game-cli/cli.ts -------------------------------------------------------------------------------- /game-cli/cli/game.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/game-cli/cli/game.ts -------------------------------------------------------------------------------- /game-cli/cli/instructions.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/game-cli/cli/instructions.ts -------------------------------------------------------------------------------- /game-cli/cli/keys.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/game-cli/cli/keys.ts -------------------------------------------------------------------------------- /game-cli/cli/playground.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/game-cli/cli/playground.ts -------------------------------------------------------------------------------- /game-cli/cli/validateCoords.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/game-cli/cli/validateCoords.ts -------------------------------------------------------------------------------- /migrations/deploy.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/migrations/deploy.ts -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/package.json -------------------------------------------------------------------------------- /programs/zk-battleship/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/programs/zk-battleship/Cargo.toml -------------------------------------------------------------------------------- /programs/zk-battleship/Xargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/programs/zk-battleship/Xargo.toml -------------------------------------------------------------------------------- /programs/zk-battleship/src/board_verifying_key.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/programs/zk-battleship/src/board_verifying_key.rs -------------------------------------------------------------------------------- /programs/zk-battleship/src/errors.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/programs/zk-battleship/src/errors.rs -------------------------------------------------------------------------------- /programs/zk-battleship/src/instructions/finalize_game.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/programs/zk-battleship/src/instructions/finalize_game.rs -------------------------------------------------------------------------------- /programs/zk-battleship/src/instructions/join_game.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/programs/zk-battleship/src/instructions/join_game.rs -------------------------------------------------------------------------------- /programs/zk-battleship/src/instructions/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/programs/zk-battleship/src/instructions/mod.rs -------------------------------------------------------------------------------- /programs/zk-battleship/src/instructions/new_game.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/programs/zk-battleship/src/instructions/new_game.rs -------------------------------------------------------------------------------- /programs/zk-battleship/src/instructions/opening_shot.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/programs/zk-battleship/src/instructions/opening_shot.rs -------------------------------------------------------------------------------- /programs/zk-battleship/src/instructions/play.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/programs/zk-battleship/src/instructions/play.rs -------------------------------------------------------------------------------- /programs/zk-battleship/src/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/programs/zk-battleship/src/lib.rs -------------------------------------------------------------------------------- /programs/zk-battleship/src/shot_verifying_key.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/programs/zk-battleship/src/shot_verifying_key.rs -------------------------------------------------------------------------------- /programs/zk-battleship/src/state/game.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/programs/zk-battleship/src/state/game.rs -------------------------------------------------------------------------------- /programs/zk-battleship/src/state/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/programs/zk-battleship/src/state/mod.rs -------------------------------------------------------------------------------- /scripts/circuits.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/scripts/circuits.sh -------------------------------------------------------------------------------- /scripts/parse_verifyingkey.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/scripts/parse_verifyingkey.js -------------------------------------------------------------------------------- /scripts/ptau.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/scripts/ptau.sh -------------------------------------------------------------------------------- /src/battleshipClient.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/src/battleshipClient.ts -------------------------------------------------------------------------------- /src/poseidonEnc.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/src/poseidonEnc.ts -------------------------------------------------------------------------------- /src/utils.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/src/utils.ts -------------------------------------------------------------------------------- /tests/zk-battleship.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/tests/zk-battleship.ts -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/tsconfig.json -------------------------------------------------------------------------------- /yarn-error.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/yarn-error.log -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shigoto-dev19/ZK-Battleships-Solana/HEAD/yarn.lock --------------------------------------------------------------------------------