{"id":18794492,"url":"https://github.com/chainstacklabs/zk-battleship-game-hardhat","last_synced_at":"2026-05-03T07:47:38.214Z","repository":{"id":173727961,"uuid":"651184161","full_name":"chainstacklabs/zk-battleship-game-hardhat","owner":"chainstacklabs","description":"This repository provides a hands-on tutorial on how to develop a battleship game using zero-knowledge principles","archived":false,"fork":false,"pushed_at":"2024-04-04T15:31:45.000Z","size":539,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-21T16:12:54.543Z","etag":null,"topics":["chainstack","game","smat-contracts","solidity","zero-knowledge"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chainstacklabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-08T17:27:08.000Z","updated_at":"2024-05-02T16:42:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f3b41b4-6e6c-43cb-80eb-1c5c15d880bb","html_url":"https://github.com/chainstacklabs/zk-battleship-game-hardhat","commit_stats":null,"previous_names":["chainstacklabs/zk-battleship-game-hardhat"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chainstacklabs/zk-battleship-game-hardhat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainstacklabs%2Fzk-battleship-game-hardhat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainstacklabs%2Fzk-battleship-game-hardhat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainstacklabs%2Fzk-battleship-game-hardhat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainstacklabs%2Fzk-battleship-game-hardhat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chainstacklabs","download_url":"https://codeload.github.com/chainstacklabs/zk-battleship-game-hardhat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainstacklabs%2Fzk-battleship-game-hardhat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32562118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chainstack","game","smat-contracts","solidity","zero-knowledge"],"created_at":"2024-11-07T21:29:35.740Z","updated_at":"2026-05-03T07:47:38.196Z","avatar_url":"https://github.com/chainstacklabs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg width=\"1200\" alt=\"Labs\" src=\"https://user-images.githubusercontent.com/99700157/213291931-5a822628-5b8a-4768-980d-65f324985d32.png\"\u003e\n\n\u003cp\u003e\n \u003ch3 align=\"center\"\u003eChainstack is the leading suite of services connecting developers with Web3 infrastructure\u003c/h3\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca target=\"_blank\" href=\"https://chainstack.com/build-better-with-ethereum/\"\u003e\u003cimg src=\"https://github.com/soos3d/blockchain-badges/blob/main/protocols_badges/Ethereum.svg\" /\u003e\u003c/a\u003e\u0026nbsp;  \n  \u003ca target=\"_blank\" href=\"https://chainstack.com/build-better-with-bnb-smart-chain/\"\u003e\u003cimg src=\"https://github.com/soos3d/blockchain-badges/blob/main/protocols_badges/BNB.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://chainstack.com/build-better-with-polygon/\"\u003e\u003cimg src=\"https://github.com/soos3d/blockchain-badges/blob/main/protocols_badges/Polygon.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://chainstack.com/build-better-with-avalanche/\"\u003e\u003cimg src=\"https://github.com/soos3d/blockchain-badges/blob/main/protocols_badges/Avalanche.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://chainstack.com/build-better-with-fantom/\"\u003e\u003cimg src=\"https://github.com/soos3d/blockchain-badges/blob/main/protocols_badges/Fantom.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  • \u003ca target=\"_blank\" href=\"https://chainstack.com/\"\u003eHomepage\u003c/a\u003e •\n  \u003ca target=\"_blank\" href=\"https://chainstack.com/protocols/\"\u003eSupported protocols\u003c/a\u003e •\n  \u003ca target=\"_blank\" href=\"https://chainstack.com/blog/\"\u003eChainstack blog\u003c/a\u003e •\n  \u003ca target=\"_blank\" href=\"https://docs.chainstack.com/quickstart/\"\u003eChainstack docs\u003c/a\u003e •\n  \u003ca target=\"_blank\" href=\"https://docs.chainstack.com/quickstart/\"\u003eBlockchain API reference\u003c/a\u003e • \u003cbr\u003e\n  • \u003ca target=\"_blank\" href=\"https://console.chainstack.com/user/account/create\"\u003eStart for free\u003c/a\u003e •\n\u003c/p\u003e\n\n# Game of Battleship Solidity and Hardhat\n\nThis project is the practical part of a tutorial that outlines how to build a game of Battleship on the Ethereum blockchain. It discusses the challenges of storing private data on a public blockchain and proposes a solution that uses public-private signatures to ensure that the players' ship coordinates remain private while still allowing the game to be played on the blockchain.\n\n\u003e Find the article in the Chainstack developer portal []()\n\n## Quick start\n\nClone the repository:\n\n```sh\ngit clone https://github.com/chainstacklabs/zk-battleship-game-hardhat.git\n```\n\nInstall dependencies:\n\n```shell\nnpm install\n```\n\nRun tests:\n\n```shell\nnpx hardhat test\n```\n\nAdd environment variables to `.env.sample` and rename to `.env`:\n\nDeploy a node with Chainstack:\n\n1. [Sign up with Chainstack](https://console.chainstack.com/user/account/create).  \n1. [Deploy a node](https://docs.chainstack.com/platform/join-a-public-network).  \n1. [View node access and credentials](https://docs.chainstack.com/platform/view-node-access-and-credentials).\n\n\n\u003e In this specific version we specify the account playing by taking the private key from the environment variable. Develop this further by adding a user interface.\n\n```env\nSEPOLIA_ENDPOINT=\"YOUR_CHAINSTACK_ENDPOINT\"\nGOERLI_ENDPOINT=\"YOUR_CHAINSTACK_ENDPOINT\"\nMAINNET_URL=\"YOUR_CHAINSTACK_ENDPOINT\"\nPRIVATE_KEY=\"PRIVATE_KEY_1\"\nPRIVATE_KEY_2=\"PRIVATE_KEY_2\"\nETHERSCAN=\"ETHERSCAN_API_KEY\"\n```\n\nUse the [Chainstack faucet](https://faucet.chainstack.com/sepolia-faucet) to get test funds:\n\nDeploy the smart contract:\n\n```sh\nnpx hardhat run scripts/deploy.ts --network sepolia\n```\n\nor \n\n```sh\nnpx hardhat run scripts/deploy.ts --network goerli\n```\n\nNow the contract will be deployed and verified on Etherscan.\n\n## Example response\n\n```sh\nCompiled 3 Solidity files successfully\nDeploying contract...\nBattleShipGame was deployed at: 0x27F1a73dB2aCD037B9AeAA993F1A2D6c5606456B\nWaiting for 3 blocks...\n3 blocks have passed!\nVerifying contract...\nContract verified!\nThe contract 0x27F1a73dB2aCD037B9AeAA993F1A2D6c5606456B has already been verified\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainstacklabs%2Fzk-battleship-game-hardhat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchainstacklabs%2Fzk-battleship-game-hardhat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainstacklabs%2Fzk-battleship-game-hardhat/lists"}