zkBOX aims to ensure private assets holding and enables proof of ownership over some amount of assets without actually revealing the total amount of assets or doxxing financial history by using zero knowledge proof cryptographic technology.
Project presentation slides are here.
Design principle is based on commitment-nullifier scheme: anyone who deposits a coin uses a private secret key - S. User locally compute the commitment - ”leaf" L=hash(S,1), which gets published on-chain and becomes part of the state, and N=hash(S,2), which is called the nullifier. The state gets stored in a Merkle tree. This allows to simultaneously solve privacy and the double spending problem.
- Solidity
- Circom 2.0 (ZK-SNARK Compiler)
- Snarkjs (implementation of the zero-knowledge protocol in javascript)
- Circomlib (library of circom templates)
- Foundry (testing framework)
- Slither (code security analysis)
- Typescript
To generate new proof (replace 'deposit' keyword in example below with required proof: deposit, mint, assert, redeem):
(1) indicate input data in ./circuit/deposit/deposit_Input.json
(2) run ./circuit/deposit/newProof.sh deposit
script
To generate merkle tree proof:
(1) add new leaf to ./leafs.txt
(2) run ./generateMerkleTree.ts
For testing typical workflow use forge test -vvvv
command