Name: zero-knowledge-proofs
Owner: ConsenSys
Description: Zero Knowledge Proofs and how they can be implemented in Quorum
Created: 2017-08-24 13:50:54.0
Updated: 2018-01-11 05:39:11.0
Pushed: 2017-11-13 07:37:41.0
Homepage: null
Size: 25790
Language: C++
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Zero Knowledge Proofs and how they can be implemented in Quorum
This is a SNARK implementation using libsnark for the following:
ZkPoK{ (R1, R2, R3): Hi = sha256(Ri) and R3 = R1 + R2 }
Read: 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
.
This is an implementation and benchmark of the “Receive” zk-SNARK in the Confidential Transaction scheme from this article: https://media.consensys.net/introduction-to-zksnarks-with-examples-3283b554fc3b.
Code based on https://github.com/ebfull/lightning_circuit.
Some more background here: https://www.youtube.com/watch?v=0KhFhvdEpoA
On Ubuntu 16.04 LTS:
`$ sudo apt-get install build-essential cmake git libgmp3-dev libprocps4-dev python-markdown libboost-all-dev libssl-dev`
On Ubuntu 14.04 LTS:
`$ sudo apt-get install build-essential cmake git libgmp3-dev libprocps3-dev python-markdown libboost-all-dev libssl-dev`
./get-libsnark && make
npm install
node index.js startBalance=10000
First select
Follow the prompts.
This creates a new proving key and verification key from the circuit. They are saved to the files:
provingKey-single
or provingKey-multi
verificationKey-single
or verificationKey-multi
This generates a proof using the proving key as well as the following values:
start balance
incoming payment/s
outgoing payment/s
end balance
(start balance + incoming - outgoing)The proof is:
start balance
+ incoming payments
= end balance
+ outgoing payments
Verifies the above proofs
Copyright © 2017 The Quorum Zero Knowledge Proof Authors.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.