The capstone will build upon the knowledge you have gained in the course in order to build a decentralized housing product. You will use zk-SNARKs to create a verification system which can prove you have title to the property without revealing that specific information on the property
- Truffle v5.1.14-nodeLTS.0 (core: 5.1.13)
- Solidity - 0.5.7 (solc-js)
- Node v10.16.0
- Web3.js v1.2.1
- Install node packages:
npm install
- Start Ganache
- Go to contracts folder:
cd eth-contracts
- Run tests:
truffle test
- SolnSquareVerifier: 0x68e325AA8ED0B04dA8C272536d241657D3014814
- SquareVerifier: 0x638b2e7A3BaFF6Fd9E2032d77b0c01fAA51C35E0
- HouseListingToken: 0x4B3A25E1413D69Aa2d9DE3844fA53727F4d2D102
- 0x68e325aa8ed0b04da8c272536d241657d3014814
- Total Supply: 10 HouseListingToken
- https://rinkeby.opensea.io/assets/0x68e325aa8ed0b04da8c272536d241657d3014814/1
- https://rinkeby.opensea.io/assets/0x68e325aa8ed0b04da8c272536d241657d3014814/3
- https://rinkeby.opensea.io/assets/0x68e325aa8ed0b04da8c272536d241657d3014814/4
- https://rinkeby.opensea.io/assets/0x68e325aa8ed0b04da8c272536d241657d3014814/8
- https://rinkeby.opensea.io/assets/0x68e325aa8ed0b04da8c272536d241657d3014814/6
- Install docker
- Run ZoKrates docker container:
docker run -v PATH_TO_PROJECT/zokrates/code:/home/zokrates/code -ti zokrates/zokrates /bin/bash
- Compile Program Compile the program written in ZoKrates DSL
cd code/square
~/zokrates compile -i square.cod
- Trusted Setup Now take the 'flattened' code, which is a circuit and go through a 'trusted setup' Repeat this process, every-time the program.code changes Two keys are generated - 'proving.key' and 'verification.key
~/zokrates setup
- Compute-Witness Having gone through the 'trusted setup' let's compute our 'witness' who knows the answer and it generates a witness file with computation steps
~/zokrates compute-witness -a 3 9
- Generate-Proof Next step is to 'generate our proof' based on the above 'witness' A proof.json file is generated in this step
~/zokrates generate-proof
- Export-Verifier
Last but never the least, let's generate our 'verifier' smart contract
~/zokrates export-verifier