Skip to content

[Audit N-07] Withdraw auditor checkpoint pad collides with transfer amount pad #785

Closed

Description

@brozorec

encrypt_auditor_sender_balance pads the withdraw balance checkpoint with Poseidon2(AUDITOR_SENDER, [s_x, sigma]) — the first sponge output, which is also the transfer circuit's amount pad. transfer, set_spender, and revoke_spender all use the second output for balance pads; only withdraw diverges. Under (r_e, sigma) reuse, anyone who knows a transfer amount (e.g. its recipient) can recover the pad from the published v_tilde_aud_s and decrypt a later withdraw's balance checkpoint.

Planned fix: derive the checkpoint from sponge_squeeze_2(AUDITOR_SENDER, s_x, sigma)[1], restoring the "balance pad = second output" invariant across all circuits → regenerate the withdraw VK + testdata; update DESIGN W_a3/W_a4 and document the unique-(r_e, sigma)-per-operation requirement.

Files: packages/tokens/src/confidential/circuits/lib/src/lib.nr, circuits/withdraw/, vks/, docs/DESIGN*.md

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions