joey8801 / zkrpChain

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zkrpChain

ZkrpChain, which integrates Bulletproofs [1] and Hyperledger Fabric [2] in a weak-coupling way, is a privacy-preserving data auditing solution for consortium blockchains. It allows the verifier peer to conduct privacy-preserving data auditing and verify the zero-knowledge range proofs, which the prover peer generates from its off-chain private data, mainly based on the chaincodes and on-chain data of Hyperledger Fabric. This project is based on Hyperledger Fabric v1.1.0 and includes codes for the one-prover-peer-one-verifier-peer scenario.

The main implementation of zkrpChain consists of 5 chaincodes, namely GenPrfs_StdRng.go, GenPrfs_ArbRng.go, VerPrfs_StdRng.go, VerPrfs_ArbRng.go and RangeMgt.go. The former two are used to generate standard-range and arbitrary-range proofs for prover’s private data, and the following two can be used by verifier peer to verify standard-range and arbitrary-range proofs generated by the prover peer. If the number of input private data item is greater than 1, the proof-generation chaincodes automatically aggregate all the proofs generated from the private data items. The last chaincode RangeMgt is invoked by the former four chaincodes and responsible for uploading/downloading the range values to/from on-chain public ledgers and querying all the update logs of the range values under one given range key ID.

Besides the 5 main chaincodes, client codes are also developed to show how to invoke the chaincodes and related APIs. In the repository, 4 client codes are presented, namely RangeManagement.js, Prover.js, Verifier.js and Service.js, of which the former three can be used to invoke corresponding chaincode APIs and the latter is the invocation interfaces between client codes and the corresponding chaincodes APIs.

Additionally, Prover.js is also responsible for retrieving the private data from off-chain database, which is MySQL and the related database file is project_VegetablesInfo.sql.

[1] B. Bnz, J. Bootle, D. Boneh, A. Poelstra, P. Wuille, and G. Maxwell, “Bulletproofs: Short proofs for confidential transactions and more,” in Proc. IEEE S&P, San Francisco, CA, USA, 2018, pp. 315–334.

[2] Hyperledger. Hyperledger Fabric home. Accessed: Jul. 25, 2020. [Online]. Available: https://www.hyperledger.org/use/fabric.

About


Languages

Language:Go 45.8%Language:JavaScript 43.9%Language:TSQL 10.2%