Skip to content

ZK-071: Split the withdrawal circuit schema from the contract verifier payload explicitly #347

@ANAVHEOBA

Description

@ANAVHEOBA

Wave: PrivacyLayer ZK Wave 2
Issue Key: ZK-071
Area: withdraw
Priority: High
Drips Complexity: High

Summary

The circuit now exposes eight public inputs while the Soroban verifier still behaves like it only sees six. Make the split between circuit-facing and contract-facing payloads explicit so witness generation and contract calls stop drifting.

Relevant Code

  • circuits/withdraw/src/main.nr
  • sdk/src/encoding.ts
  • sdk/src/public_inputs.ts
  • sdk/src/proof.ts
  • contracts/privacy_pool/src/crypto/verifier.rs
  • contracts/privacy_pool/src/types/state.rs

Scope

  • Define separate typed payloads for full circuit public inputs and the reduced contract verifier input set.
  • Remove comments and helper names that imply one schema serves both boundaries unchanged.
  • Add parity tests that prove the reduced contract payload is derived from the full circuit payload deterministically.

Acceptance Criteria

  • SDK code, contract types, and tests use distinct names for full versus reduced public-input payloads.
  • Schema order is pinned in one place per boundary and regression tested.
  • No helper silently drops or reorders pool or denomination fields.

Out of Scope

  • New wallet UX and non-ZK frontend polish
  • Unrelated Soroban business logic outside the withdrawal proof boundary

Dependencies

  • ZK-032
  • ZK-045

Validation

  • Inspect derived checks: node scripts/zk_ticket_check.mjs --issue-key ZK-071
  • Run derived checks: node scripts/zk_ticket_check.mjs --issue-key ZK-071 --run
  • Pull requests should include Wave Issue Key: ZK-071 in the title or body.

References

  • circuits/withdraw/src/main.nr
  • sdk/src/encoding.ts
  • sdk/src/public_inputs.ts
  • sdk/src/proof.ts
  • contracts/privacy_pool/src/crypto/verifier.rs
  • contracts/privacy_pool/src/types/state.rs

Metadata

Metadata

Assignees

Labels

area: withdrawWithdrawal circuit constraints and proof semanticsbountyEligible for Drips Wave bounty reviewcircuitsNoir circuit and proving workcomplexity: highDrips complexity: high / 200 pointspriority: highCritical path work for the current wavetestingCoverage, fixtures, fuzzing, and regression workwave: zk-2Wave 2: ZK parity, backend, and deployment hardening

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions