ENS made addresses human-readable. We make transactions human-meaningful.
Live Demo β’ Documentation β’ Report Bug β’ Request Feature
PayNote is a decentralized protocol for attaching human-readable references to blockchain transactions. Think of it as ENS for transaction references - send ETH with invoice numbers, rent payments, donation messages, or any reference you need to track.
Traditional blockchain transactions are just addresses and amounts. How do you track:
- π§Ύ Invoice payments (
"Invoice #12345") - π Rent payments (
"Rent - January 2025") - π Donations (
"For the children's fund") - π¦ Business transactions (
"Order #ABC-789")
PayNote lets you send payments with references in a single atomic transaction, stored permanently on-chain with cryptographic authentication. No post-transaction tagging, no forgery, just pure trustless reference storage.
// Send 1 ETH with a reference
payNoteRegistry.sendPaymentWithReference{value: 1 ether}(
recipientAddress,
"Invoice #12345 - Website Design"
);- β‘ Atomic Payments - Reference stored in the same transaction as the payment
- π Authenticated - Only the sender can create the reference (no forgery)
- π Standard Interface - Designed to become an ecosystem-wide standard like ENS
- π Permanent Storage - References stored on-chain forever
- π Easy Queries - Get all payments sent/received by any address
- π° Low Cost - Deployed on Optimism L2 for 100x cheaper gas
- π‘οΈ Battle-Tested - OpenZeppelin contracts for security
- β Verified - Source code verified on Etherscan & Blockscout
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User / DApp β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PayNoteRegistry Contract β
β β’ sendPaymentWithReference(recipient, reference) β
β β’ resolvePayNote(payNoteId) β
β β’ getPayNotesBySender(sender) β
β β’ getPayNotesByRecipient(recipient) β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββ΄ββββββββββββββββ
βΌ βΌ
ββββββββββββββββββββ ββββββββββββββββββββ
β Forward ETH to β β Store PayNote β
β Recipient β β On-Chain β
ββββββββββββββββββββ ββββββββββββββββββββ
PayNote/
βββ contracts/ # Smart contracts
β βββ contracts/
β β βββ PayNoteRegistry.sol # Main implementation
β β βββ interfaces/
β β β βββ IPayNoteRegistry.sol # Standard interface
β β βββ tests/
β β βββ PayNoteRegistry.t.sol # Solidity tests
β βββ test/
β β βββ PayNoteRegistry.ts # TypeScript tests
β βββ scripts/
β β βββ deploy.ts # Deployment script
β β βββ test-payment.ts # Test interaction
β βββ ignition/
β β βββ modules/
β β βββ PayNoteRegistry.ts # Ignition deployment
β βββ docs/
β βββ DEPLOYMENT_GUIDE.md # How to deploy
β βββ KEYSTORE_GUIDE.md # Hardhat keystore guide
β βββ DEPLOYMENTS.md # Deployment addresses
β
βββ frontend/ # Next.js frontend (coming soon)
βββ paynote/
- Node.js 18+
- npm or pnpm
- MetaMask or compatible wallet
# Clone the repository
git clone https://github.com/ck0x/PayNote.git
cd PayNote/contracts
# Install dependencies
npm install
# Compile contracts
npx hardhat compile
# Run tests
npx hardhat test# Set up encrypted secrets
npx hardhat keystore set OPTIMISM_SEPOLIA_PRIVATE_KEY
npx hardhat keystore set OPTIMISM_SEPOLIA_RPC_URL
npx hardhat keystore set OPTIMISM_ETHERSCAN_API_KEY
# Deploy
npx hardhat ignition deploy ignition/modules/PayNoteRegistry.ts --network optimismSepolia
# Verify
npx hardhat verify --network optimismSepolia --build-profile production <CONTRACT_ADDRESS> <OWNER_ADDRESS>See DEPLOYMENT_GUIDE.md for detailed instructions.
import { parseEther } from "viem";
// Connect to contract
const payNoteRegistry = await viem.getContractAt(
"PayNoteRegistry",
"0x0294b9c5902361b0f11bBAf0F1A4ca9F745ec13f"
);
// Send payment with reference
const hash = await payNoteRegistry.write.sendPaymentWithReference(
["0xRecipientAddress", "Invoice #12345"],
{ value: parseEther("1.0") }
);
console.log("Payment sent:", hash);// Get all PayNotes sent by an address
const payNotes = await payNoteRegistry.read.getPayNotesBySender([
"0xSenderAddress"
]);
// Resolve a specific PayNote
const payNote = await payNoteRegistry.read.resolvePayNote([payNoteId]);
console.log({
sender: payNote.sender,
recipient: payNote.recipient,
amount: payNote.amount,
reference: payNote.payReference,
timestamp: payNote.timestamp
});| Property | Value |
|---|---|
| Contract | PayNoteRegistry v2.0.0 |
| Address | 0x0294b9c5902361b0f11bBAf0F1A4ca9F745ec13f |
| Chain ID | 11155420 |
| Status | β Active & Verified |
| Etherscan | View on Etherscan |
| Blockscout | View on Blockscout |
π§ Coming Soon - Mainnet deployment planned after testnet validation
PayNote has comprehensive test coverage with both Solidity and TypeScript tests:
# Run all tests
npx hardhat test
# Run Solidity tests only
npx hardhat test contracts/tests/PayNoteRegistry.t.sol
# Run TypeScript tests only
npx hardhat test test/PayNoteRegistry.tsTest Results:
Running Solidity tests
β test_InitialState()
β test_SendPaymentWithReference()
β test_ResolvePayNote()
β test_GetPayNotesBySender()
β test_GetPayNotesByRecipient()
Running TypeScript tests
β Should set the correct owner
β Should start with zero registration fee
β Should have correct version
β Should send payment and store reference atomically
β Should emit PaymentSent event
β Should resolve a PayNote correctly
11 passing (1.6s)
- Solidity 0.8.28 - Latest stable version
- Hardhat 3.0 - Development environment
- OpenZeppelin 5.4.0 - Battle-tested contracts
- Viem 2.38 - Type-safe Ethereum library
- Hardhat Test - TypeScript integration tests
- Forge-std - Solidity unit tests
- Chai - Assertions
- Hardhat Ignition - Declarative deployments
- Hardhat Verify - Contract verification
- Encrypted Keystore - Secure secret management
- Optimism Sepolia - L2 testnet
- Optimism Mainnet - L2 production (planned)
| Action | Direct Transfer | PayNote Transfer | Premium |
|---|---|---|---|
| Gas | ~21,000 | ~100-120k | ~5x |
| Optimism L2 | ~$0.001 | ~$0.005 | +$0.004 |
| Ethereum L1 | ~$0.50 | ~$3.00 | +$2.50 |
- π Cryptographic Authentication - Provably from the sender
- π Permanent Storage - Reference stored forever on-chain
- π‘οΈ No Forgery - Impossible to fake a PayNote
- β‘ 100x Cheaper on L2 - Optimism makes it affordable
- π― Single Transaction - Atomic payment + reference
- Deployment Guide - Step-by-step deployment
- Keystore Guide - Hardhat encrypted secrets
- Verification Flow - How contract verification works
- Blockscout vs Etherscan - Block explorer comparison
- Deployment Success - What we built
- β³ Audit Status: Pending (testnet phase)
- π― Planned: Professional audit before mainnet launch
- β OpenZeppelin - Industry-standard secure contracts
- β ReentrancyGuard - Protection against reentrancy attacks
- β Ownable - Access control for administrative functions
- β Automated Tests - 11/11 tests passing
- β Verified Source - Code verified on Etherscan & Blockscout
Found a security issue? Please email: security@paynote.io (or open a private security advisory)
- PayNoteRegistry contract implementation
- Standard interface (IPayNoteRegistry)
- Comprehensive test suite
- Deployment to Optimism Sepolia
- Contract verification
- Next.js web application
- Wallet integration (MetaMask, WalletConnect)
- Payment history dashboard
- Search and filter PayNotes
- Export to CSV
- Mainnet deployment (Optimism)
- Professional security audit
- SDK/NPM package
- Multi-chain support (Arbitrum, Base)
- EIP proposal for standard
- PayNote escrow contracts
- Recurring payment support
- Multi-recipient splits
- Reference templates
- API for integration
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Write tests for new features
- Follow Solidity style guide
- Update documentation
- Keep gas costs in mind
- Use conventional commits
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenZeppelin - Secure smart contract library
- Hardhat - Amazing development environment
- Optimism - Affordable L2 infrastructure
- Viem - Modern Ethereum library
- The Ethereum Community - For building the future
- Website: paynote.io (coming soon)
- Twitter: @PayNoteProtocol
- Discord: Join our community
- Email: hello@paynote.io