- Rust (latest stable)
- Circom
- Node.js (latest stable)
- NPM (latest stable)
git clone https://github.com/iden3/circom.git cd circom && cargo build --release && cargo install --path circom
git submodule update --init --recursive
cd circom-ecdsa && npm install && cd .. && npm install
Minimum required power for .ptau file is 21 (verify.circom has ~1.5m constraints).
Howto prepare .ptau file could be found in guide here https://github.com/iden3/snarkjs starting from Step 1 to Step 8 (inclusive)
Pre-built final .ptau files could be found in NOTE section right after Step 7
Howto compile circuit could be found in guide here https://github.com/iden3/snarkjs in Step 10
Howto prepare .zkey file and export it to .json file could be found in guide here https://github.com/iden3/snarkjs starting from Step 15 to Step 22 (inclusive).
This example currently supports only Groth16 proving system.
npm start -- --message="%MESSAGE%" --gen-random-wallet --circuit %CIRCUIT_WASM_PATH% --zkey %ZKEY_PATH% --vkey %VERIFICATION_KEY_PATH%
where:
%MESSAGE%: any message which should be signed and verified%CIRCUIT_WASM_PATH%: path to built circuit.wasmfile%ZKEY_PATH%: path to prepared.zkeyfile (could be created during PowersOfTau Ceremony)%VERIFICATION_KEY_PATH%: path to exported verification key file in JSON format (should be exported from.zkeyfile)
--message: provides any text message for signing and verification--gen-random-wallet: generates etherium wallet randomly to be used later for signing--use-phrase: creates wallet using provided words phrase--circuit: path to compiled circuit.wasmfile (usually located at./verify_js/directory)--zkey: path to prepared.zkeyfile--vkey: path to exported verification key file (could be exported from.zkeyfile by usingsnarkjs)
npm test