Overview
Cashu payment requests (NUT-18) allow you to request ecash payments with optional constraints:- Amount - Specific amount or open-ended
- Mints - Restrict to specific mints or accept any
- Transport - Delivery method (Nostr DM, HTTP POST, WebSocket)
- Memo - Description for the payment
creqA... strings and can be shared via QR codes, NFC, or links.
Protocol Specification
Payment Request Structure
Encoding/Decoding
Detecting Payment Requests
TheuseProcessPaymentString hook handles payment request scanning:
Processing Payment Requests
When a payment request is scanned/pasted, Sovran routes based on available data:Routing Logic
Valid Mints Calculation
Fulfilling Payment Requests
TheSendTokenScreen handles payment request fulfillment:
Payment Request Mode
Workflow
-
Display confirmation UI
- Show amount, destination (Nostr npub or URL)
- Preview memo/description
- Confirm selected mint
-
Create ecash token
-
Send via transport
Nostr DM:
HTTP POST:
-
Show confirmation
- Display success message
- Update transaction history
- Return to previous screen
Creating Payment Requests
Basic Example
QR Code Display
Scan History
Payment requests are saved to scan history:Mint Filtering
When payment request specifies allowed mints, filter the mint list:Nostr Integration
Sending Payments via DM
Sovran uses NIP-04 encrypted DMs to deliver tokens:Receiving Payment Notifications
Listen for incoming DMs with tokens:Currency Screen Integration
When amount is missing, the currency screen handles it:Best Practices
Validate Allowed Mints
Validate Allowed Mints
Always check if you have a trusted mint that’s in the allowed list before showing confirmation UI:
Handle Missing Amount Gracefully
Handle Missing Amount Gracefully
If amount is missing, show an input UI rather than rejecting the request. The requester may want any amount.
Show Transport Method
Show Transport Method
Display how the payment will be delivered (Nostr DM, HTTP POST, etc.) so users understand where it’s going.
Verify Before Sending
Verify Before Sending
Show a confirmation screen with:
- Recipient (npub or URL)
- Amount and unit
- Selected mint
- Memo/description
Error Handling
Related Documentation
Mint Management
Manage allowed mints for payment requests
Cashu Overview
Learn about Cashu protocol fundamentals