Privacy-Preserving Payment Links on Aleo
Get paid in crypto without revealing your wallet address. Share a simple link, protect your privacy.
Traditional crypto payments expose everything:
- Recipient wallet addresses are publicly visible
- Transaction history is permanently on-chain
- Financial privacy is non-existent for payees
Payment links on other platforms (PayPal, Venmo, Cash App) work because they use centralized servers to hide addresses. On transparent blockchains, this privacy doesn't exist — creating a payment link means doxxing your wallet.
AnonPay solves this using zero-knowledge cryptography.
AnonPay uses cryptographic commitments to break the public link between usernames and wallet addresses:
When a user creates a payment link:
- Generate a random
secret - Compute
commitment = Hash(recipient_address + secret) - Store the commitment on-chain (not the address)
- Link becomes shareable:
anonpay.com/pay/alice
Result: The blockchain only knows a commitment hash — the actual wallet address stays private.
When someone pays through the link:
- Sender provides the recipient's address + secret (off-chain)
- Contract verifies:
Hash(address + secret) == stored_commitment - Payment executes only if the commitment matches
- Transaction completes without exposing recipient to the public
Result: Sender knows who they're paying, but blockchain observers see only hashes.
- ✅ Recipient address never appears on-chain in plaintext
- ✅ Only payment amounts and stats are publicly visible
- ✅ Link owners can deactivate/reactivate links at will
- ✅ Sender privacy protected via address hashing
- Link commitments:
Hash(address + secret) - Payment statistics: total volume, payment count
- Link active status: boolean flag
- Actual wallet addresses (encrypted in database)
- User-to-username mappings
- Payment metadata and history
record PaymentReceived {
owner: address, // Only recipient can decrypt
amount: u64,
sender_hash: field, // Hashed for privacy
payment_id: field,
link_id: field,
timestamp: u32,
}Recipients receive private records that only they can decrypt — completely invisible to the network.
- Recipient addresses hidden using cryptographic commitments
- Zero-knowledge proof verification ensures payments reach correct recipient
- On-chain data reveals nothing about user identities
- Share one link for all payments:
anonpay.com/pay/yourname - No need to share wallet address for each payment
- Works like PayPal/Venmo but fully decentralized
- Content creators can accept tips without doxxing wallets
- Freelancers can share payment links on profiles
- Merchants can use human-readable payment pages
- Users maintain financial privacy by default
- Full monorepo with smart contracts, API, and UI
- Wallet integration via Leo Wallet Adapter
- Encrypted data storage with AES-256-GCM
- Responsive Next.js frontend with modern UX
Language: Leo (Aleo's zkSNARK programming language)
Core Functions:
create_link()- Registers payment link with commitmentsend_payment()- Executes payment with ZK verificationdeactivate_link()/reactivate_link()- Link management
Privacy Mechanism:
// Commitment generation
let addr_as_field: field = BHP256::hash_to_field(self.caller);
let commitment: field = BHP256::hash_to_field(addr_as_field + secret);
// Payment verification
assert_eq(stored_commitment, expected_commitment);- Framework: Express.js + TypeScript
- Database: Prisma ORM (SQLite dev / PostgreSQL prod)
- Security: Wallet-based authentication, encrypted address storage
- Services: Aleo blockchain integration, payment tracking
- Framework: Next.js 14 (App Router)
- Styling: Tailwind CSS + shadcn/ui
- State: Zustand for wallet management
- Integration: Leo Wallet Adapter for transactions
- SDK: Core Aleo helpers, transaction builders, type converters
- UI: Reusable React components with consistent theming
Streamers, YouTubers, and artists can share one permanent payment link without revealing their wallet across platforms.
Add anonpay.com/pay/yourname to email signatures, portfolios, and social profiles for private payment collection.
Accept payments with human-readable links while protecting customer privacy and business wallet security.
Enable anonymous tipping for online communities, forums, and social platforms without tracking individual wallets.
anonpay/
├── contracts/ # Leo smart contracts
│ └── src/
│ └── main.leo # Core privacy logic
├── apps/
│ ├── api/ # Express.js backend
│ │ ├── src/
│ │ │ ├── controllers/
│ │ │ ├── services/
│ │ │ └── middleware/
│ │ └── prisma/
│ └── web/ # Next.js frontend
│ └── src/
│ ├── app/
│ ├── components/
│ └── lib/
└── packages/
├── sdk/ # Aleo SDK & helpers
└── ui/ # Shared UI components
- Node.js 18+
- Leo CLI (for contract development)
- Leo Wallet browser extension
- Clone and install dependencies:
npm install- Set up environment variables:
cp apps/api/.env.example apps/api/.env
cp apps/web/.env.example apps/web/.env- Run development servers:
# API (port 3001)
npm run dev:api
# Web (port 3002)
npm run dev:web- Open the app:
http://localhost:3002
cd contracts
leo buildPrivacy is a fundamental right, not a luxury.
On transparent blockchains, payment recipients have no choice but to expose their financial activity. Every payment link becomes a permanent record of their identity and transaction history.
AnonPay proves that privacy and usability aren't trade-offs — they can coexist through zero-knowledge cryptography.
This isn't just a demo. It's a blueprint for how payments should work when privacy is the default.
- Uses BHP256 hash commitments for address hiding
- Implements Leo 3.4+ async/await model
- Private records ensure recipient-only decryption
- Sender hashing protects payer identities
- Wallet-based challenge-response authentication
- AES-256-GCM encryption for sensitive data at rest
- Input validation and sanitization across all APIs
- Secure secret generation using crypto libraries
- Scalable monorepo architecture
- Type-safe TypeScript throughout
- Database schema designed for privacy compliance
- Error handling and graceful degradation
MIT