Skip to main content

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
Payment requests are encoded as creqA... strings and can be shared via QR codes, NFC, or links.

Protocol Specification

Payment Request Structure

Encoding/Decoding

Detecting Payment Requests

The useProcessPaymentString 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

The SendTokenScreen handles payment request fulfillment:

Payment Request Mode

Workflow

  1. Display confirmation UI
    • Show amount, destination (Nostr npub or URL)
    • Preview memo/description
    • Confirm selected mint
  2. Create ecash token
  3. Send via transport Nostr DM:
    HTTP POST:
  4. 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:
The list screen filters internally:

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

Always check if you have a trusted mint that’s in the allowed list before showing confirmation UI:
If amount is missing, show an input UI rather than rejecting the request. The requester may want any amount.
Display how the payment will be delivered (Nostr DM, HTTP POST, etc.) so users understand where it’s going.
Show a confirmation screen with:
  • Recipient (npub or URL)
  • Amount and unit
  • Selected mint
  • Memo/description

Error Handling

Mint Management

Manage allowed mints for payment requests

Cashu Overview

Learn about Cashu protocol fundamentals