Programmable Stablecoin Spending Revolution

Payment Intents are cryptographically signed messages that transform stablecoins from simple tokens into programmable money with sophisticated business logic and spending controls.

The Breakthrough

One signed intent becomes a universal payment method that works across NFC cards, messaging apps, QR codes, and direct blockchain transactions.

How Payment Intents Work

Intents are encoded from JSON to make them easy to transfer via various interfaces. Users sign payment intentions once that work everywhere.

Standard Intent Structure

{
  // Core Identity & Control
  "fromAddress": "0x742d35Cc7661C8A5D7C99A6798Ead96e9426aC79", // Required
  "toAddress": "0xAddress",   // Optional
  "nonce": 42,               // Global user nonce for revocation required
  
  // Payment Rules
  "amount": null,            // null = flexible, number = exact amount
  "maxPerTx": 100,           // Max per transaction (null = unlimited)
  "maxTotal": 1000,          // Max total usage (null = unlimited)
  "maxCount": null,          // Max number of transactions (null = unlimited)
  "isVariable": true,         // Variable Intent (NFC Card) default is True
  
  // Time Controls
  "validFrom": 1704067200,   // Start timestamp (null = immediate)
  "validUntil": null,        // End timestamp (null = never expires)
  
  // Behavioral Controls
  "transferValue": true,     // true = payment, false = identity/proof only
  "requireConfirm": false,   // Require user confirmation for each payment 
  
  // Advanced Restrictions (all optional)
  "restrictions": {
    "recipients": null,     // Array of allowed recipient addresses (null = any)
    "networks": null,       // Array of allowed settlement networks (null = any)
    "geoFence": null,       // "lat,lng,radius" or null
    "timeWindows": null,    // ["09:00-17:00", "19:00-23:00"] or null
    "categories": null,     // Merchant category restrictions
  },
  
  // Conditional Logic (optional)
  "conditions": null,       // Array of complex conditions or null
  
  // Metadata
  "label": null             // Human readable label
}

Three Intent Types

1. One-Time Payment

Perfect for: P2P transfers, bill payments, specific purchases
{
  "fromAddress": "0x742d35Cc7661C8A5D7C99A6798Ead96e9426aC79",
  "toAddress": "0xAliceAddress...",
  "nonce": 1,
  "amount": 5.50,              // Exact amount
  "maxPerTx": 5.50,
  "maxTotal": 5.50,
  "maxCount": 1,               // Only one use
  "validUntil": 1722531900,    // 5 minutes from now
  "isVariable": false,         // Fixed payment
  "transferValue": true,
  "label": "Coffee payment to Alice"
}
Use Cases:
  • Splitting dinner bills with friends
  • Paying for specific services or products
  • One-time donations or tips
  • Emergency payments with time limits

2. Spending Card

Perfect for: Employee cards, subscription limits, allowances
{
  "fromAddress": "0x742d35Cc7661C8A5D7C99A6798Ead96e9426aC79",
  "toAddress": null,           // Any recipient
  "nonce": 2,
  "amount": null,              // Flexible amount
  "maxPerTx": 25,              // Max $25 per coffee
  "maxTotal": 500,             // $500 monthly limit
  "validUntil": 1725123900,    // 30 days from now
  "isVariable": true,          // Variable spending card
  "transferValue": true,
  "restrictions": {
    "timeWindows": ["06:00-11:00", "14:00-17:00"], // Breakfast & afternoon
    "categories": ["food", "beverage"]
  },
  "label": "Monthly coffee allowance"
}
Use Cases:
  • Employee expense cards with category restrictions
  • Children’s allowances with spending controls
  • Travel cards with geographic limits
  • Subscription services with usage caps

3. Identity Proof

Perfect for: Event access, age verification, membership
{
  "fromAddress": "0x742d35Cc7661C8A5D7C99A6798Ead96e9426aC79",
  "toAddress": null,           // Not applicable for identity proof
  "nonce": 3,
  "amount": null,
  "maxPerTx": null,
  "maxTotal": null,
  "validUntil": 1704153600,    // Event date
  "isVariable": false,         // Identity proof, not variable
  "transferValue": false,      // No payment capability
  "label": "VIP event access pass"
}
Use Cases:
  • Event tickets and access passes
  • Age verification for restricted venues
  • Membership proof for exclusive services
  • Identity verification for KYC processes

Advanced Spending Controls

Time-Based Restrictions

Geographic Controls

"geoFence": "40.7128,-74.0060,1000"  // 1km radius around NYC office

Category Restrictions

"categories": ["food", "beverage", "restaurants"]

Intent Lifecycle & Management

Creation Process

1

Define Rules

User specifies spending limits, restrictions, and expiration
2

Cryptographic Signing

Intent signed with private key using EIP-712 standard
3

Universal Distribution

Same intent works across NFC, messaging, QR, apps
4

Ready for Use

Recipients can process payments against user’s vault balance

Execution Flow

1

Payment Initiation

Recipient scans QR, taps NFC, or clicks payment link
2

Intent Validation

Protocol checks signature, balance, and spending limits
3

Settlement Processing

Transaction settles on Base chain with full transparency
4

Balance Update

User and recipient balances updated in real-time

Revocation System

Instant RevocationUsers can instantly invalidate ALL intents by incrementing their global nonce. This immediately makes all existing intents unusable.
// Revoke all existing intents
await gasyard.revokeAllIntents(userAddress);
// User nonce incremented from 42 to 43
// All intents with nonce 42 or lower become invalid

Business Logic Examples

Corporate Expense Card

{
  "fromAddress": "0xEmployeeAddress...",
  "toAddress": null,         // Any approved merchant
  "nonce": 5,
  "amount": null,
  "maxPerTx": 200,           // Max $200 per transaction
  "maxTotal": 2000,          // $2000 monthly budget
  "validUntil": 1725123900,  // Monthly reset
  "isVariable": true,        // Variable expense card
  "transferValue": true,
  "restrictions": {
    "categories": ["transportation", "meals", "office_supplies"],
    "timeWindows": ["06:00-22:00"],  // Business hours + travel
    "geoFence": "40.7128,-74.0060,50000"  // 50km around office
  },
  "requireConfirm": true,    // Manager approval for each transaction
  "label": "Employee expense card"
}

Gift Card with Expiration

{
  "fromAddress": "0xGifterAddress...",
  "toAddress": "0xGifteeAddress...",  // Specific recipient
  "nonce": 6,
  "amount": null,
  "maxTotal": 100,           // $100 gift value
  "validUntil": 1735689600,  // Expires December 31st
  "isVariable": true,        // Variable gift card
  "transferValue": true,
  "restrictions": {
    "categories": ["retail", "entertainment", "food"],
    "recipients": ["0xGifteeAddress..."]  // Only specific recipient
  },
  "label": "Holiday gift card for Sarah"
}

Security & Validation

Cryptographic Security

  • EIP-712 signatures prevent tampering and ensure authenticity
  • Nonce system enables instant revocation of all intents
  • Time-based expiration limits exposure window
  • Spending limits control maximum potential loss

Smart Contract Validation

  • On-chain balance checks ensure sufficient funds
  • Automatic limit enforcement prevents overspending
  • Real-time settlement provides immediate finality
  • Audit trail records all transactions immutably
Next Step: Learn about Multi-Interface Distribution - how one intent works everywhere.