Skip to content

Conversation

@critesjosh
Copy link
Contributor

Summary

  • Adds a new streaming payments contract example demonstrating private salary streaming, token vesting, and subscription payments on Aztec
  • Full privacy: amounts, schedules, and participant identities remain hidden
  • Integrates with defi-wonderland/aztec-standards Token contract

Features

  • Linear vesting with configurable start/end times
  • Optional cliff period before which no withdrawals are allowed
  • Private streams stored as notes owned by recipients
  • Withdrawal of vested tokens to recipient's private balance
  • Cancellation by sender with automatic return of unvested tokens

Test Coverage

Type Count Description
Unit tests 11 Vesting calculation logic
Integration tests (TXE) 4 Full token transfer flows
E2E tests (TypeScript) 7 Real network deployment and interaction

Test plan

  • aztec test --package streaming_payments_contract - 15 Noir tests pass
  • yarn test - 7 TypeScript e2e tests pass
  • CI workflow runs successfully

🤖 Generated with Claude Code

critesjosh and others added 4 commits January 14, 2026 21:09
A private streaming payments contract for Aztec that enables salary streaming,
token vesting, and subscription payments with full privacy.

Features:
- Linear vesting with optional cliff period
- Private streams using notes (amounts, schedules, identities hidden)
- Recipient withdrawal of vested tokens
- Sender cancellation with unvested token recovery
- Full integration with defi-wonderland/aztec-standards Token contract

Includes:
- 11 unit tests for vesting calculations
- 4 integration tests with Token contract (TXE)
- 7 e2e TypeScript tests with TestWallet
- CI workflow for automated testing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Enable Corepack for Yarn
- Start local network after Noir tests
- Wait for network to be ready
- Install dependencies and run e2e tests
- Upload pxe-test-data on failure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix cancellation issue where sender couldn't nullify recipient's private note.
Now stream metadata is stored publicly while token balances remain private.

Changes:
- Add StreamData struct for public storage in lib.nr
- Replace private note storage with PublicMutable<StreamData>
- Sender can now cancel streams since data is publicly accessible
- Update cancel_stream to take (stream_id, unvested_amount) instead of
  (stream_id, recipient, unvested_amount)
- Add public helper functions for state updates via enqueue

Privacy tradeoffs:
- Stream existence, parties, and schedule are now public
- Token balances and actual withdrawal amounts remain private

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Document public stream registry design vs previous private notes approach
- Update privacy model: stream metadata public, token balances private
- Update function signatures (cancel_stream now takes stream_id, unvested_amount)
- Add design rationale explaining why public registry was chosen
- Update storage architecture documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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