Skip to main content

Abstract

This specification defines the nvm:vic extension to the x402 protocol that enables fiat payment settlement using Visa Intelligence Commerce (VIC) and Visa Token Service (VTS). While the x402 Smart Accounts extension settles payments via blockchain smart contracts, this extension allows settlement through Visa’s payment infrastructure—enabling traditional card-based payments within the x402 HTTP payment flow. This extension shares the same HTTP handshake pattern as other x402 schemes but replaces blockchain settlement with Visa payment credentials.
Version: 0.1
Status: Draft
Last Updated: January 2026

1. Introduction

1.1 Relationship to Base Specification

This specification extends the base x402 protocol and follows the same HTTP flow documented in the x402 Smart Accounts Extension. Readers SHOULD be familiar with that specification before reading this document. Key differences from the nvm:erc4337 extension:
Aspectnvm:erc4337nvm:vic
Schemecontractvisa
NetworkCAIP-2 blockchain (e.g., eip155:84532)visa:cert or visa:prod
AuthorizationERC-4337 Session KeysVisa Token Service credentials
SettlementSmart contract executionVisa payment network
CurrencyERC-20 tokensFiat (USD, EUR, etc.)
Rate limitingBalance-basedUsage count-based

1.2 Use Cases

The nvm:vic extension enables:
  • Fiat payments for AI agents — Clients without crypto wallets can pay using Visa credentials
  • Enterprise integrations — Organizations using traditional payment infrastructure
  • Hybrid payment options — Merchants accepting both crypto and fiat via x402

2. Terminology

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.

2.1 Visa-Specific Terms

TermDefinition
VTSVisa Token Service — Visa’s tokenization platform that replaces card numbers with tokens
VICVisa Intelligence Commerce — Visa’s API platform for commerce applications
vProvisionedTokenIDA Visa-provisioned token identifier representing a payment credential
instructionIdA VIC instruction identifier for the payment mandate
MandateA pre-authorized payment agreement with defined limits

3. Extension Structure

3.1 Extension Identifier

This extension is identified by the scheme visa and certification and production networks visa:cert and visa:prod.

3.2 Payload Schema

The complete x402 payment payload with the Visa VIC extension:
{
  "x402Version": 2,
  "resource": {
    "url": "https://api.example.com/resource",
    "description": "Premium API access",
    "mimeType": "application/json"
  },
  "accepted": {
    "scheme": "visa",
    "network": "visa:cert",
    "amount": "100.00",
    "asset": "USD",
    "payTo": "merchant_123",
    "maxTimeoutSeconds": 3600,
    "extra": {
      "vProvisionedTokenID": "tok_abc123",
      "instructionId": "instr_xyz789",
      "maxUsage": 10,
      "merchantName": "AI Agent Service",
      "merchantUrl": "https://merchant.com",
      "merchantCountryCode": "US"
    }
  },
  "payload": {
    "vProvisionedTokenID": "tok_abc123",
    "instructionId": "instr_xyz789",
    "signedPayload": "<visa-signed-payload>",
    "authorization": "<visa-authorization>",
    "validAfter": 1735603200,
    "validBefore": 1735606800,
    "nonce": "unique-nonce-value"
  }
}

3.3 Field Definitions

Root Fields

FieldTypeRequiredDescription
x402VersionnumberYesProtocol version. MUST be 2.
resourceobjectYesDescription of the protected resource.
acceptedobjectYesPayment requirements accepted by the merchant.
payloadobjectYesVisa authorization data.

Resource Fields

FieldTypeRequiredDescription
urlstringYesURL of the protected resource.
descriptionstringNoHuman-readable description.
mimeTypestringNoMIME type of the resource.

Accepted Fields

FieldTypeRequiredDescription
schemestringYesPayment scheme. MUST be "visa".
networkstringYesPayment network. MUST be "visa:cert" or "visa:prod".
amountstringYesMaximum payment amount (decimal string, e.g., "100.00").
assetstringYesCurrency code (e.g., "USD", "EUR").
payTostringYesMerchant identifier.
maxTimeoutSecondsnumberYesAuthorization validity window in seconds.
extraobjectYesVisa-specific parameters.

Extra Fields

FieldTypeRequiredDescription
vProvisionedTokenIDstringYesVisa provisioned token identifier.
instructionIdstringYesVIC instruction identifier for the mandate.
maxUsagenumberYesMaximum number of times this authorization can be used.
merchantNamestringNoMerchant display name.
merchantUrlstringNoMerchant website URL.
merchantCountryCodestringNoISO 3166-1 alpha-2 country code (e.g., "US").

Payload Fields (Visa Authorization)

FieldTypeRequiredDescription
vProvisionedTokenIDstringYesVisa provisioned token identifier.
instructionIdstringYesVIC instruction identifier.
signedPayloadstringYesVisa-signed payment payload.
authorizationstringYesVisa authorization code.
validAfternumberYesUnix timestamp when authorization becomes valid.
validBeforenumberYesUnix timestamp when authorization expires.
noncestringYesUnique nonce for replay protection.

4. Protocol Flow

4.1 Overview

The protocol flow follows the standard x402 pattern with Visa-specific verification and settlement:

4.2 Key Differences from Blockchain Settlement

Phasenvm:erc4337nvm:vic
Token GenerationClient signs UserOperations locallyClient requests signed payload from Facilitator via Visa
VerificationSimulate UserOperations on-chainValidate with Visa API + check rate limits
SettlementExecute UserOperations on blockchainIncrement usage count + future Visa settlement

5. Verification Requirements

5.1 Payload Validation

The facilitator MUST verify:
CheckRequirement
Versionx402Version MUST equal 2
Schemeaccepted.scheme MUST equal "visa"
Networkaccepted.network MUST equal "visa:cert" or "visa:prod"
Time WindowCurrent time MUST be within validAfter and validBefore
AmountRequested amount MUST NOT exceed accepted.amount
AssetRequested asset MUST match accepted.asset

5.2 Rate Limit Validation

The facilitator MUST track usage per instructionId:
CheckRequirement
Mandate ExistsA mandate MUST exist for the instructionId
Usage CountCurrent usage count MUST be less than maxUsage

5.3 Visa Validation

The facilitator MUST verify credentials with Visa:
CheckRequirement
Token ValidvProvisionedTokenID MUST be valid with Visa VTS
Instruction ValidinstructionId MUST match Visa response
Signature ValidsignedPayload MUST be verified by Visa

6. Settlement Requirements

6.1 Settlement Process

When settling a payment, the facilitator MUST:
  1. Re-verify the payment payload
  2. Increment the usage count for the instructionId
  3. Return a settlement receipt
Current implementation tracks usage counts for rate limiting. Future versions MAY integrate with Visa’s payment settlement for actual fund transfers.

6.2 Receipt Format

The facilitator MUST return a receipt containing:
FieldTypeDescription
successbooleanWhether settlement succeeded.
transactionstringTransaction identifier (format: visa_tx_{timestamp}_{id}).
networkstringNetwork identifier ("visa:cert").
payerstringThe vProvisionedTokenID of the payer.
remainingUsagenumberRemaining uses before rate limit is reached.

7. Error Handling

7.1 Error Codes

CodeNameDescription
invalid_x402_versionInvalid Versionx402Version is not 2
authorization_expiredAuthorization ExpiredCurrent time is after validBefore
mandate_not_foundMandate Not FoundNo mandate exists for instructionId
rate_limit_exceededRate Limit ExceededUsage count has reached maxUsage
amount_exceeds_limitAmount Exceeds LimitRequested amount exceeds accepted.amount
asset_mismatchAsset MismatchRequested asset doesn’t match accepted.asset
instruction_id_mismatchInstruction MismatchVisa response doesn’t match instructionId
visa_verification_failedVisa Verification FailedError calling Visa API

7.2 Verify Response Format

Success:
{
  "isValid": true,
  "payer": "tok_abc123",
  "remainingUsage": 9
}
Failure:
{
  "isValid": false,
  "invalidReason": "rate_limit_exceeded",
  "payer": "tok_abc123",
  "remainingUsage": 0
}

7.3 Settle Response Format

Success:
{
  "success": true,
  "transaction": "visa_tx_1734355200_abc123",
  "network": "visa:cert",
  "payer": "tok_abc123",
  "remainingUsage": 8
}
Failure:
{
  "success": false,
  "transaction": "",
  "network": "visa:cert",
  "payer": "tok_abc123",
  "errorReason": "amount_exceeds_limit"
}

8. HTTP Transport

This extension uses the standard x402 HTTP transport headers:
HeaderDirectionDescription
PAYMENT-REQUIREDServer → ClientBase64-encoded payment requirements (402 response)
PAYMENT-SIGNATUREClient → ServerBase64-encoded PaymentPayload
PAYMENT-RESPONSEServer → ClientBase64-encoded settlement response
Payloads MUST be encoded using standard Base64:
// Encode
const encoded = Buffer.from(JSON.stringify(payload), 'utf-8').toString('base64')

// Decode
const decoded = JSON.parse(Buffer.from(encoded, 'base64').toString('utf-8'))

9. Security Considerations

9.1 Token Security

  • vProvisionedTokenID values MUST be treated as sensitive credentials
  • Tokens SHOULD be transmitted only over HTTPS
  • Tokens MUST NOT be logged in plain text

9.2 Authorization Window

  • validBefore SHOULD be set to a reasonable window (default: 1 hour)
  • Facilitators MUST reject authorizations outside their validity window
  • Nonces MUST be unique to prevent replay attacks

9.3 Rate Limiting

  • maxUsage provides client-side rate limiting
  • Facilitators SHOULD implement additional server-side rate limiting
  • Usage counts MUST be persisted reliably to prevent abuse

10. References