Transaction Memos
Y Protocol implements a memo system for transaction identification, enabling payment references, exchange routing, and document linking while maintaining full backward compatibility.
Why Memos Matter
Exchanges can use ID memos to route deposits to the correct customer accounts without requiring unique addresses for each user.
Businesses can include invoice numbers, order references, or payment descriptions directly in the transaction.
Support for regulatory requirements like travel rule compliance by including necessary reference information.
Memo Types
Example:
"Invoice #12345"Use Cases:
Payment references, order IDs, customer notes
Example:
123456789Use Cases:
Exchange customer IDs, account numbers, routing codes
Example:
0x1234...abcdUse Cases:
Invoice hashes, document references, external data links
Example:
nullUse Cases:
Simple transfers, privacy-focused transactions
Implementation Examples
// Text memo for invoice reference
let memo = Memo::text("Invoice #12345").unwrap();
let tx = Transaction::new_with_memo(
"y_sender".to_string(),
"y_recipient".to_string(),
"1000000000".to_string(), // 10 YPC
"10000".to_string(), // 0.0001 YPC fee
nonce,
timestamp,
memo,
);
// ID memo for exchange routing
let customer_id = 987654321u64;
let memo = Memo::id(customer_id);
// Hash memo for document reference
let document_hash = sha256(invoice_data);
let memo = Memo::hash(&document_hash).unwrap();
// No memo (backward compatible)
let tx = Transaction::new(...); // Defaults to Memo::NoneTechnical Features
Backward Compatible
Existing transactions work unchanged with Memo::None as default
Transaction Integrity
Memos are included in transaction signatures and ID calculation
Deterministic Encoding
Binary encoding with type prefixes for consistent hashing
Low-Cost Fees
Only 0.0001 YPC per transaction regardless of memo size