Skip to content

test(zones): add zone-to-zone privacy e2e tests#412

Open
decofe wants to merge 1 commit intomainfrom
daniel/zone-to-zone-privacy-tests
Open

test(zones): add zone-to-zone privacy e2e tests#412
decofe wants to merge 1 commit intomainfrom
daniel/zone-to-zone-privacy-tests

Conversation

@decofe
Copy link
Copy Markdown
Member

@decofe decofe commented Apr 18, 2026

E2E tests verifying sender/receiver blinding during cross-zone transfers (authenticated withdrawal from Zone A → encrypted deposit into Zone B via composable callback).

Changes

  • ZoneToZonePrivacy.t.sol: sets up two zones with separate portals, a CrossZoneEncryptedRouter receiver, and validates 6 privacy properties:
    • senderTag is blinded (not reversible without zone txHash)
    • callbackData contains encrypted payload, not plaintext recipient
    • Withdrawal.to is the router, not the end recipient
    • Router only receives senderTag, never sender address
    • Zone B's deposit queue contains an encrypted deposit
    • Encrypted deposit sender is router, not original sender

Testing

forge test --match-contract ZoneToZonePrivacyTest -vvv

All 237 existing tests continue to pass.

Prompted by: daniel

Adds ZoneToZonePrivacy.t.sol with 3 tests verifying sender/receiver blinding
during cross-zone transfers (authenticated withdrawal → encrypted deposit):

- test_zoneToZone_senderAndRecipientBlinded: full E2E with two zones, router,
  and 6 privacy assertions
- test_senderTag_cannotBeReversedWithoutTxHash: senderTag blinding verification
- test_senderTags_unlinkableAcrossUsers: cross-user unlinkability

Co-Authored-By: 0xKitsune <[email protected]>
Amp-Thread-ID: https://ampcode.com/threads/T-019da009-e45b-7620-bd6d-81a964b11ccf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants