This project aims to use Zero Knowledge Proof protocol to implement a Two Factor Authentication on blockchain.
How does it work?
Users of the site store the hash of their password onchain, then when they perform sensitive operations such as withdrawing ethers from the smart contract, they have to provide the ZKP proof that they know the pre-image of the hash and thus their password. This way, even if a dishonest person manages to steal a user's ethereum private key, the thief will not be able to perform sensitive operations.
A complete and detailed description of how the application works can be found here, thanks to rich sequence diagrams.
To get a local copy up and running follow these simple steps.
You need to have node and npm installed on your computer.
-
Node
You can download node from the official website. -
Npm
npm install npm@latest -g
- Clone the repo
git clone https://github.com/AymericNoel/POC_OCTO_ZKP.git
- Install NPM packages
npm install
- Setup Zero Knowledge Proof locally
npm run setup:zkp
- Compile smart contracts locally
npm run compile
- Open a new terminal and launch ganache-cli
npm run ganache
- Put your ethereum addresses as administrators in migration file in order to validate gardens
- Deploy the smart contracts locally on ganache on the first terminal
npm run migrate:ganache
- Run website locally
npm start
- Create .env file at the root of the repo with your mnemonic and your infura api key :
MNEMONIC = ""
INFURAY_KEY = ""
- Put your ethereum addresses as administrators in migration file in order to validate gardens
- Deploy the smart contracts on Rinkeby
npm run migrate:rinkeby
- Run website locally
npm start
- Open a new terminal and launch ganache-cli
npm run ganache
- Run tests of smart contracts on the first terminal
npm run test:sol
- Run tests of website
npm run test:js
Use this website to make decentralized garden rentals. A minimum number of administrators must however be defined when deploying smart contracts in order to verify the existence of the different gardens. Any owner can add his garden anonymously and any tenant can rent anonymously too.
A demo can be found here : https://zeroknowledgegarden.surge.sh
Distributed under the MIT License. See LICENSE for more information.
Aymeric NOEL - [email protected]
Project Link : https://github.com/AymericNoel/POC_OCTO_ZKP

