Skip to content

@circom:verifier

Compile circom source (inline text or a http/ipfs URL), run an in-place setup, and return the Solidity verifier source with the verification key embedded, ready to pipe into @contracts:solidity to deploy. groth16 setups are DEV-ONLY (no ceremony); plonk/fflonk setups are deterministic and production-grade given a real powers-of-tau.

⚗️ Experimental — available at next.evmcrispr.com.

Returns: string

@circom:verifier(source ptau:<value> system:<value>)
NameTypeDescription
sourcestringcircom source code, or a http(s)/ipfs URL to fetch it from
ptau:stringPowers-of-tau: ptau:dev or ptau:<url> (default: auto-download a hez file sized to the circuit)
system:stringProof system: `system:groth16
  • groth16 (default) setups are generated on the spot with no multi-party ceremony: anyone who reproduces the setup can forge proofs that the verifier accepts. Prototyping only.
  • system:plonk / system:fflonk setups are deterministic — no circuit-specific ceremony exists, and security reduces to the powers-of-tau alone. With a real ptau (the auto-downloaded Hermez ceremony files) the exported verifier is production-grade, at a higher verification gas cost than groth16. With ptau:dev any system is dev-only, since a local ptau is itself unceremonied.
OptionEffect
(none)Auto-download powersOfTau28_hez_final_<p>.ptau from the public Hermez ceremony, with 2^p sized to the circuit (min 2^8, cap 2^16)
ptau:devGenerate a local powers-of-tau (fast for small circuits; cap 2^12)
ptau:<url>Fetch a specific ptau file (http(s) or ipfs)

Setups are cached per (circuit, ptau option) for the session, and circom:prove --circom resolves through the same cache — so the verifier you deploy and the proofs you generate in one script always match.

load circom
load contracts
set $src <<<CIRCOM
pragma circom 2.0.0;
template Multiplier2() {
signal input a;
signal input b;
signal output c;
c <== a * b;
}
component main = Multiplier2();
CIRCOM
contracts:deploy $verifier @contracts:solidity(@circom:verifier($src ptau:dev))
circom:prove $proof --circom $src --ptau dev --inputs [[a 3] [b 11]]
set [$a $b $c $signals] @circom:proof($proof)
print "Valid:" @get($verifier "verifyProof(uint256[2],uint256[2][2],uint256[2],uint256[1])(bool)" $a $b $c $signals)

include statements are prefetched before compiling: absolute URLs as written, version-pinned npm paths (e.g. circomlib@2.0.5/circuits/poseidon.circom) from npm-registry tarballs verified against their published integrity hash, and relative includes when the including file lives at a URL. Unpinned npm paths throw (mutable content has no stable hash to verify), as do relative includes in inline source. The circom compiler wasm itself is verified against a repo-pinned hash before it runs.