etherlime zk compile
Running this command will compile a circuitfile located inzero-knowledge-proof/circuits
and generates anew foldercompiled-circuits
.
etherlime zk setup
Running this command will establish a trustedsetup based on compiled circuit and generates a folder `trustedsetupwith
proving_keyand
verification_key`. The commandreads the compiled circuit fromzero-knowledge-proof/compiled-circuits
.
etherlime zk proof [signal] [circuit] [provingKey]
Running thiscommand will generates a proof based on compiled circuit, publicsignal input and proving key. A new foldergenerated-proof
isgenerated withproof
andpublic_signals
. This proof can beused for off-chain Zero-Knowledge-Proof verification.
Parameters:
signal
- [Optional] Specifies the file with publicsignals input to be used for generating a proof.Defaults toinput.json
read fromzero-knowledge-proof/input
folder.circuit
- [Optional] Specifies the compiled circuitfor checking of matched signals. Defaults to:circuit.json
read fromzero-knowledge-proof/compiled-circuits
folder.provingKey
- [Optional] Specifies the prooving keyto be used for generating a proof. Defaults to:circuit_proving_key.json
read fromzero-knowledge-proof/trusted-setup
folder.
etherlime zk verify [publicSignals] [proof] [verifierKey]
Running this command will generates a verifier based on publicsignals file that comes out of the proof command, the proof itselfand verifier key. A new folderverified-proof
is generated withoutput.json
file.
Parameters:
publicSignals
- [Optional] Specifies the file withsignals to be used for generating verifying a proof.Defaults tocircuit_public_signals.json
read fromzero-knowledge-proof/generated-proof
folder.proof
- [Optional] Specifies the compiled proof thatwould be used for generating a proof based on it.Defaults to:circuit_proof.json
read fromzero-knowledge-proof/generated-proof
folder.verifierKey
- [Optional] Specifies the verifier keyto be used for generating a proof. Defaults to:circuit_verification_key.json
read fromzero-knowledge-proof/trusted-setup
folder.output.json
file has two params:
verified
- whatever the proof is verified or nottimestamp
- identifier for the time that event occurs
etherlime zk generate [verifierKey]
Generates a verifier smartcontract based on verification key which can be used for on-chainverification. The smart contract is written in contracts folderand it is ready to be compiled and deployed with `etherlimecompileand
etherlime deploy`. The verifier smart contract has apublic view methodverifyProof
that can be called for on-chainverification. You can generate the call parameters with `etherlimezk-generate-call` cli command.
Parameters:
verifierKey
- [Optional] Specifies the verifier keyto be used for generating a verifier smart contract.Defaults to: circuit_verification_key.json read fromzero-knowledge-proof/generated-proof
folder.
etherlime zk call [publicSignals] [proof]
Running this commandwill generates a call based on proof and public signals. A newfoldergenerated-call
is generated withgeneratedCall.json
file. This generated call can be used for on-chain verification,for calling public view methodverifyProof
of the generatedverifier contract with this data.
Parameters:
publicSignals
- [Optional] Specifies the file withsignals to be used for generating verifying a proof.Defaults tocircuit_public_signals.json
read fromzero-knowledge-proof/generated-proof
folder.proof
- [Optional] Specifies the compiled proof thatwould be used for generating a proof based on it.Defaults to:circuit_proof.json
read fromzero-knowledge-proof/generated-proof
folder.