Skip to content

ZK-072: Replace lossy recipient decoding with a verifiable address-binding strategy #348

@ANAVHEOBA

Description

@ANAVHEOBA

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

Summary

The SDK currently hashes Stellar addresses into fields while the contract tries to decode a concrete address back out of 32 bytes. Replace that mismatch with a recipient-binding design the contract can actually verify.

Relevant Code

  • sdk/src/encoding.ts
  • sdk/src/public_inputs.ts
  • sdk/src/proof.ts
  • contracts/privacy_pool/src/core/withdraw.rs
  • contracts/privacy_pool/src/utils/address_decoder.rs
  • contracts/privacy_pool/src/integration_test.rs

Scope

  • Choose a single recipient-binding model for the proof boundary, such as explicit recipient argument plus hashed public input binding.
  • Update SDK encoding and contract withdraw flow together so the same address semantics are used end to end.
  • Add negative tests for mismatched recipient argument versus proof-bound recipient commitment.

Acceptance Criteria

  • The contract no longer attempts to reconstruct an address from an irreversible hash format.
  • SDK witness generation and contract verification agree on recipient binding rules.
  • Cross-stack tests show the wrong recipient is rejected deterministically.

Out of Scope

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

Dependencies

  • ZK-031

Validation

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

References

  • sdk/src/encoding.ts
  • sdk/src/public_inputs.ts
  • sdk/src/proof.ts
  • contracts/privacy_pool/src/core/withdraw.rs
  • contracts/privacy_pool/src/utils/address_decoder.rs
  • contracts/privacy_pool/src/integration_test.rs

Metadata

Metadata

Assignees

Labels

Stellar WaveEligible to be picked up by the Stellar Wave programarea: 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 wavesecuritySecurity review, audit prep, and hardening worktestingCoverage, 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