{"id":13591422,"url":"https://github.com/ConsenSys/zero-knowledge-proofs","last_synced_at":"2025-04-08T17:31:36.206Z","repository":{"id":54677464,"uuid":"101300054","full_name":"Consensys/zero-knowledge-proofs","owner":"Consensys","description":"Zero Knowledge Proofs and how they can be implemented in Quorum","archived":false,"fork":false,"pushed_at":"2024-06-24T13:22:55.000Z","size":25789,"stargazers_count":130,"open_issues_count":7,"forks_count":58,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-11-06T12:43:44.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/Consensys.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,"publiccode":null,"codemeta":null}},"created_at":"2017-08-24T13:50:54.000Z","updated_at":"2024-11-05T18:02:04.000Z","dependencies_parsed_at":"2024-01-14T04:38:34.500Z","dependency_job_id":"dacdd1e8-6d66-49df-96eb-52e5b169d382","html_url":"https://github.com/Consensys/zero-knowledge-proofs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Consensys%2Fzero-knowledge-proofs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Consensys%2Fzero-knowledge-proofs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Consensys%2Fzero-knowledge-proofs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Consensys%2Fzero-knowledge-proofs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Consensys","download_url":"https://codeload.github.com/Consensys/zero-knowledge-proofs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247892460,"owners_count":21013706,"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-01T16:00:57.280Z","updated_at":"2025-04-08T17:31:34.361Z","avatar_url":"https://github.com/Consensys.png","language":"C++","funding_links":[],"categories":["Index"],"sub_categories":["Tutorials"],"readme":"# zero-knowledge-proofs\nZero Knowledge Proofs and how they can be implemented in Quorum\n\nThis is a SNARK implementation using libsnark for the following:\n\n``ZkPoK{ (R1, R2, R3): Hi = sha256(Ri) and R3 = R1 + R2 }``\n\nRead: given `H1`, `H2`, `H3`, prove you know `R1`, `R2`, `R3` such that `R1` is the preimage of `H1`, `R2` is the preimage of `H2`, `R3` is the preimage of `H3`, and `R3` is `R1 + R2`.\n\nThis is an implementation and benchmark of the \"Receive\" zk-SNARK in the Confidential Transaction scheme from this article: \u003chttps://media.consensys.net/introduction-to-zksnarks-with-examples-3283b554fc3b\u003e.\n\nCode based on \u003chttps://github.com/ebfull/lightning_circuit\u003e.\n\nSome more background here: \u003chttps://www.youtube.com/watch?v=0KhFhvdEpoA\u003e\n\n## howto\n\n### Required packages\n\n* On Ubuntu 16.04 LTS:\n\n        `$ sudo apt-get install build-essential cmake git libgmp3-dev libprocps4-dev python-markdown libboost-all-dev libssl-dev`\n\n* On Ubuntu 14.04 LTS:\n\n        `$ sudo apt-get install build-essential cmake git libgmp3-dev libprocps3-dev python-markdown libboost-all-dev libssl-dev`\n\n### Installation\n\n`./get-libsnark \u0026\u0026 make`\n\n`npm install`\n\n### Running  \n`node index.js startBalance=10000`\n\nFirst select  \n1. Single payment in and single payment out\n2. Multiple payments in and multiple payments out\n\nFollow the prompts.  \n\n1. Generate a key pair\n2. Generate a proof (single or multiple)\n4. Verify proof\n0. Quit\n\n#### Generate a new key pair  \nThis creates a new proving key and verification key from the circuit.  They are saved to the files:  \n* `provingKey-single` or `provingKey-multi`\n* `verificationKey-single` or `verificationKey-multi`\n\n#### Generate a payment proof  \nThis generates a proof using the proving key as well as the following values:\n\n* `start balance`\n* `incoming payment/s`\n* `outgoing payment/s`\n* `end balance` (start balance + incoming - outgoing)\n\nThe proof is:  \n* `start balance` + `incoming payments` = `end balance` + `outgoing payments`\n\n#### Verify payment proof  \nVerifies the above proofs\n\n# License\nCopyright (C) 2017 The Quorum Zero Knowledge Proof Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FConsenSys%2Fzero-knowledge-proofs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FConsenSys%2Fzero-knowledge-proofs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FConsenSys%2Fzero-knowledge-proofs/lists"}