Recover
Parse the recovery material in memory controlled by your application. Reject the wrong chain, pool, runtime, template, commitment, checksum, or encrypted payload before making RPC calls. A restored record is only a candidate note until membership and spent-state checks pass. Never log it or send it through analytics and error-reporting hooks.Synchronize
Read from the runtime RPC starting at the configured deployment block:- Commitment insertion and leaf index
- Merkle path to a currently accepted root
- Nullifier spent state
- Active fee and bounded fee policy
- Pool and verifier bytecode identity where required
Prove
Build one fixed withdrawal intent containing the accepted root, child nullifier, destination, gross amount, fee, chain, pool, proof context, and encrypted cover-payload hash. Load only proving files authenticated by the independent manifest pin.Preflight
Immediately before submission:- Recheck RPC chain ID.
- Recheck nullifier remains unspent.
- Recheck active fee and user bounds.
- Simulate exact zero-value transaction with
eth_call. - Run remote
eth_estimateGasagainst MegaETH.
Submit
Send the exact prepared transaction through the user’s connected wallet after preflight. Relayer requests and deadlines are still pending in the SDK, so keep them out of calldata wrappers for now. An unknown wallet result needs investigation, not an automatic retry. See Submission transport for the boundary any future transport must preserve.Reconcile
Resolve success from the configured pool:- Transaction succeeded at expected pool
- Pool
nullifiersmarks the intended child nullifier as spent Withdrawalmatches nullifier, destination, gross amount, net amount, fee, and encrypted payload- Any unspent sibling child remains in the restored bundle inventory
Negative test matrix
The TypeScript SDK performs these checks around the local prover. See Withdrawal public inputs and Where a Nullark flow can fail for exact stop conditions.