R402 Profile Specification (v1)
The R402 profile defines a standard structure for representing rental and licensing requirements within the x402Β payment protocol.
It extends the base x402 specification by introducing fields for usage tiers, access rights, and time-based validity.
π§© Overview
R402 allows servers to sell temporary usage rights to digital resources using standard HTTP flows:
- Client requests the resource
- Server responds with
402 Payment Requiredand an R402 JSON payload - Client pays and resubmits the request with proof of payment
- Server issues a signed receipt and returns the resource
All R402 exchanges are valid x402 transactions β they simply include additional semantic data for rentals and licensing.
π§ Field Summary
| Field | Type | Required | Description |
|---|---|---|---|
standard | string | β | Always "x402" β identifies the parent protocol. |
profile | string | β | Must equal "r402/v1". |
usage | object | β | Defines rights, tiers, and durations. |
usage.tiers | array | β | List of time-based access options (1d, 7d, 30d, etc.). |
usage.modes | array | optional | Rights such as "view", "remix", "commercial-lite". |
pay_to | object | β | Destination for payments (address + chain). |
facilitator | string | optional | Endpoint for verifying and signing receipts. |
nonce | string | optional | Unique identifier for request replay protection. |
expires_at | string (ISO-8601) | optional | When the requirement itself becomes invalid. |
π¦ Example: Server β Client (402 Response)
HTTP/1.1 402 Payment Required
Content-Type: application/json
X-402-Version: 1{
"standard": "x402",
"profile": "r402/v1",
"resource": "nft:solana:mint:9abc...xyz",
"usage": {
"modes": ["view", "remix"],
"tiers": [
{
"id": "1d",
"label": "1 Day Access",
"duration_seconds": 86400,
"price": { "amount": "0.50", "currency": "USDC", "chain": "solana" }
},
{
"id": "7d",
"label": "1 Week Access",
"duration_seconds": 604800,
"price": { "amount": "2.00", "currency": "USDC", "chain": "solana" }
}
]
},
"pay_to": { "address": "SoLWallet111...", "chain": "solana" },
"facilitator": "https://facilitator.fx402.xyz/settle",
"nonce": "bf1c...e7",
"expires_at": "2025-10-30T00:00:00Z"
}π³ Example: Client β Server (Payment Submission)
After the user selects a tier and pays, the client retries with proof:
{
"standard": "x402",
"profile": "r402/v1",
"tier_id": "7d",
"payment_proof": {
"chain": "solana",
"currency": "USDC",
"tx": "4sJQd2cA...FyW"
}
}The server (or facilitator) validates the proof, delivers the resource, and issues a receipt.
π§Ύ Example: Receipt Object
{
"profile": "r402/v1",
"receipt": {
"resource": "nft:solana:mint:9abc...xyz",
"tier_id": "7d",
"paid": { "amount": "2.00", "currency": "USDC" },
"valid_from": "2025-10-29T00:00:00Z",
"valid_until": "2025-11-05T00:00:00Z",
"jwt": "<signed JWT>"
}
}π Versioning & Compatibility
- Current version:
r402/v1 - Future updates may extend
usage.modesor add verification primitives. - Servers should include a
profilefield to ensure forward compatibility.
π Related Documents
Last updated on