Skip to content
Lattice

IShieldedWithdrawVerifier

Git Source

Title: IShieldedWithdrawVerifier

The verifier a shielded pool calls to check a withdrawal proof. A consumer deploys a Groth16 verifier for their audited withdraw circuit (whose 5 public signals are, in order, [root, nullifierHash, recipient, relayer, fee]) and registers its address on the pool.

The implementation MUST pin its circuit's verifying key: whoever can choose the key can forge a withdrawal and drain the pool. Compile the key in (see src/examples/privacy/). A key in writable storage, or a Groth16 verifier whose code someone can replace, is only as trustworthy as whoever controls it.

Functions

verifyProof

function verifyProof(
        uint256[2] calldata a,
        uint256[2][2] calldata b,
        uint256[2] calldata c,
        uint256[5] calldata input
    ) external view returns (bool);

Parameters

NameTypeDescription
auint256[2]Groth16 proof point A.
buint256[2][2]Groth16 proof point B.
cuint256[2]Groth16 proof point C.
inputuint256[5]The public signals [root, nullifierHash, recipient, relayer, fee].

Returns

NameTypeDescription
<none>boolTrue iff the proof is valid.