Boilerplate to deploy EdDSA signature validation circuit smart-contract.
First install snark tool:
npm i -g snarkjs
Install dependencies:
npm i
Generate new private key and input.json
containing it:
node generate_inputs.js
Calculate the snark scheme witness, witness.json
for provided input
snarkjs calculatewitness
Generate local proof and scheme outputs
snarkjs proof
Test is all went smooth:
snarkjs verify
Generate the solidity verifier.sol
smart-contract
snarkjs generateverifier
Now deploy the smart-contract on your favorite EWM based chain And then use the tool to generate the smart-contract method call
snarkjs generatecall
- Circom Tutorial
- Circom Features
- Binary to Field and Field to Binary converters
- BabyJub Addition and scalar multiplication
- EdDSA
- BabyJub Point compressor/decompressor
- Pedersen commitments
- MiMC7 Hash
- Sparse Merkle trees processors to add/update/remove elements to a Sparse merkle tree.
- Sparse Merkle tree verifiers to verify inclusion and exclussion.
- Comparators
- Logical operators like adders and Binary Gates.
- SHA256 Hash function.
- EdDSA on Wikipedia
- Glitching Arduino Nano to steal EdDSA keys
- Zcash on JubJub and other new primitives included in Circom