proveWithdrawal
Prove a withdrawal: resolve the network's withdrawal circuit artifacts (from its CircuitConfig), flatten the supplied witness, and run it through the config's prover (default Rust/arkworks). Returns the Groth16 proof + public signals, ready for the operator's on-chain submit.
Import
import { proveWithdrawal } from "@0xcurvy/curvy-sdk/actions";Usage
const witness = await generateWithdrawalCircuitInputsFromNotes({ notes, ... });
const { proof, publicSignals } = await proveWithdrawal({ witness });Signature
function proveWithdrawal(parameters: ProveWithdrawalParameters): Promise<ProofResult>Returns
Promise<ProofResult>
The action resolves or returns the value shown in the signature.
Parameters
witness
- Type:
WithdrawCircuitInputs - Required: yes
The withdrawal witness from generateWithdrawalCircuitInputsFromNotes. Input generation stays separate; this action only flattens + proves.
const result = await proveWithdrawal({
witness,
});networkSlug
- Type:
string - Required: no
Network whose deployed withdrawal circuit to prove against; defaults to the active network.
const result = await proveWithdrawal({
witness,
networkSlug,
});config
- Type:
CurvyConfig - Required: no
Curvy config to use. Defaults to the ambient config.
const result = await proveWithdrawal({
witness,
config,
});Errors
Errors from config resolution and the underlying SDK operation are propagated to the caller.
Related
- Interacting with assets guide
buildWithdrawRequest— Build a submit-ready withdrawal proof from committed notes.submitToChain— Submit a built aggregator proof on-chain with the caller's wallet client.relaySubmission— Relay a built proof via the SDK's relay service — no EVM wallet, no gas.waitForRelay— Poll a relayed submission to the requested lifecycle milestone.
Source
packages/@0xcurvy/sdk/src/actions/proving/proveWithdrawal.ts