{"id":13525992,"url":"https://github.com/zCloak-Network/icp-zk-maze","last_synced_at":"2025-04-01T06:30:58.184Z","repository":{"id":232316409,"uuid":"783999922","full_name":"zCloak-Network/icp-zk-maze","owner":"zCloak-Network","description":"Canister for zk-maze","archived":false,"fork":false,"pushed_at":"2024-04-09T06:34:37.000Z","size":181,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T17:58:23.613Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zCloak-Network.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-04-09T01:39:58.000Z","updated_at":"2024-04-24T13:46:57.000Z","dependencies_parsed_at":"2024-04-21T06:30:44.960Z","dependency_job_id":"73c4c6b5-804c-4e31-bb55-05fa47828a55","html_url":"https://github.com/zCloak-Network/icp-zk-maze","commit_stats":null,"previous_names":["zcloak-network/icp-zk-maze"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zCloak-Network%2Ficp-zk-maze","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zCloak-Network%2Ficp-zk-maze/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zCloak-Network%2Ficp-zk-maze/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zCloak-Network%2Ficp-zk-maze/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zCloak-Network","download_url":"https://codeload.github.com/zCloak-Network/icp-zk-maze/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246596664,"owners_count":20802866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-01T06:01:24.138Z","updated_at":"2025-04-01T06:30:57.708Z","avatar_url":"https://github.com/zCloak-Network.png","language":"Rust","funding_links":[],"categories":["ZK"],"sub_categories":["TON"],"readme":"# ZK Coprocessor\n\n## Description\nZK coprocessor offloads intensive Zero-Knowledge (ZK) computations from traditional blockchains, enabling the creation and verification of Zero-Knowledge Proofs (ZKPs) without revealing private information. Established on ICP, the ZK coprocessor is designed to be multi-chain compatible, cost-effective, and high-speed. With the ZK Coprocessor, users and developers can enjoy Web3 services with near Web2 experience, fostering a new era of privacy-first digital identity and credentials on blockchain. \nFor demo application use, we built a [ZK Maze game](https://zkmaze.zkid.app/) to show that ZK coprocessor can be seamless integrated into a project.\n\n## Why using ICP\n| Comparison (STARK proof verification) | ICP | EVM chains |\n| :----- | :----- | :----- |\n| Cost | as low as 2 cents | thousand of dollars |\n| Efficiency | 0.2s per proof | 30s to tens of minutes |\n| Interoperability | Reusable result in any **tECDSA** compatible chain | Result locked in one chain |\n| UX | No gas fee, no wallet (**reverse gas**) | Install wallet and buy ETH to simply get started |\n\n## How to Run\n🫙 Canister ID (on IC main net): `7n7be-naaaa-aaaag-qc4xa-cai`.\n\nIf you want to deploy this canister locally, you can flow this flowing step:\n```bash\ncd icp-zk-maze/\ncargo update\n\n# if you don't have wasm32 toolchain, please install it first\nrustup target add wasm32-unknown-unknown\n\n# start ICP background locally\ndfx start --clean --background\n\n# build canister\ndfx build zkmaze_backend\n\n# deploy the zk coprocessor canister\ndfx deploy zkmaze_backend\n```\n\n## How to integrate with your frontend on IC main net (e.g. TypeScript)\n- Step1: get `idl_factory` and other ZK proof input data\n```ts\n// zk.ts\nimport fs from \"fs\";\n\nexport const programHash =\n  \"79414c1c82c0ef42aff896debc5b8ed351189264f32085ea5fad753b19f48d4e\";\n\nexport const publicInput =\n  \"7,4,6,5,6,2,5,4,5,3,5,1,4,6,4,5,4,4,3,6,2,5,2,3,2,2,1,7,1,3,1,2,0,7,17,15,7,7,0,0,8,8\";\n\nexport const zkp_result = fs.readFileSync(\"./zkpResult.json\", {\n  encoding: \"utf-8\",\n});\n\nexport const canister_id = \"7n7be-naaaa-aaaag-qc4xa-cai\";\n\nexport const idl_factory = ({ IDL }: { IDL: any }) =\u003e {\n  return IDL.Service({\n    greet: IDL.Func([IDL.Text], [IDL.Text], []),\n    public_key: IDL.Func(\n      [],\n      [\n        IDL.Variant({\n          Ok: IDL.Record({ public_key_hex: IDL.Text }),\n          Err: IDL.Text,\n        }),\n      ],\n      []\n    ),\n    zk_verify: IDL.Func(\n      [IDL.Text, IDL.Text, IDL.Text],\n      [IDL.Text, IDL.Text, IDL.Vec(IDL.Text)],\n      []\n    ),\n  });\n};\n\n```\n\n- Step2: Interact with ZK Coprocessor canister\n```ts\n// zkp-verify.ts\nimport fetch from \"isomorphic-fetch\";\nimport { Actor, HttpAgent } from \"@dfinity/agent\";\nimport {\n  programHash,\n  publicInput,\n  zkp_result,\n  canister_id,\n  idl_factory,\n} from \"./zk\";\n\n(async () =\u003e {\n  const agent = new HttpAgent({ fetch, host: \"https://ic0.app\" });\n\n  const actor = Actor.createActor(idl_factory, {\n    agent,\n    canisterId: canister_id,\n  });\n\n  const res = await actor.zk_verify(programHash, publicInput, zkp_result);\n  console.log(res);\n})();\n\n```\n\n## ZK Coprocessor Application (ZK Maze game)\n🔗 ZK Maze Github: https://github.com/zCloak-Network/ZK-Maze\n\n🔗 ZK Maze Game: https://zkmaze.zkid.app/\n\n🎬 Demo Video:\n\nhttps://github.com/zCloak-Network/icp-zk-maze/assets/71303553/8f4c18d2-15a5-49a4-828e-d88edd654558\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FzCloak-Network%2Ficp-zk-maze","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FzCloak-Network%2Ficp-zk-maze","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FzCloak-Network%2Ficp-zk-maze/lists"}