---
updatedAt: 2026-10-17T17:26:28.000Z
agentTools:
  projectIndex: https://dev.proof.com/llms.txt
---

# Use with x402

Learn how to pay for x401 presentations with x402.

x401 Verifiers whose Proof account has no credit card or bank account on file pay for presentations with [x402](https://www.x402.org). Proof delivers their `vp_token` with both signature segments removed, and the Verifier fetches them from the x401 Signatures endpoint, paying in USDC. The claims stay readable, but the presentation is not cryptographically verifiable until the signatures are restored.

The [Proof SDK](https://github.com/proof/proof-vc-common/tree/main/packages/server) fetches the signatures and pays with x402 automatically for you when you call `verifyVPToken` with an x402-capable `fetch`. See [Use with x402](https://dev.proof.com/docs/x401#6-optional-use-with-x402) to set it up.

<svg viewBox="0 0 900 650" width="100%" role="img" aria-label="x401 detached signatures sequence: user agent, your endpoint, Proof API"><defs ><marker id="x401-sig-arrow-indigo" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0 0L10 5L0 10z" fill="#6366F1" /></marker><marker id="x401-sig-arrow-green" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0 0L10 5L0 10z" fill="#10B981" /></marker></defs><line x1="110" y1="60" x2="110" y2="600" stroke="currentColor" strokeOpacity="0.18" strokeWidth="1.5" strokeDasharray="4 6" strokeLinecap="round" /><rect x="18" y="14" width="184" height="44" rx="22" fill="#94A3B8" fillOpacity="0.12" stroke="#94A3B8" strokeOpacity="0.55" strokeWidth="1.5" /><text x="110" y="41" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="16" fontWeight="600" fill="#94A3B8">User agent</text><line x1="400" y1="60" x2="400" y2="600" stroke="currentColor" strokeOpacity="0.18" strokeWidth="1.5" strokeDasharray="4 6" strokeLinecap="round" /><rect x="308" y="14" width="184" height="44" rx="22" fill="#6366F1" fillOpacity="0.12" stroke="#6366F1" strokeOpacity="0.55" strokeWidth="1.5" /><text x="400" y="41" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="16" fontWeight="600" fill="#6366F1">Your endpoint</text><line x1="770" y1="60" x2="770" y2="600" stroke="currentColor" strokeOpacity="0.18" strokeWidth="1.5" strokeDasharray="4 6" strokeLinecap="round" /><rect x="678" y="14" width="184" height="44" rx="22" fill="#10B981" fillOpacity="0.12" stroke="#10B981" strokeOpacity="0.55" strokeWidth="1.5" /><text x="770" y="41" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="16" fontWeight="600" fill="#10B981">Proof API</text><line x1="126" y1="108" x2="396" y2="108" stroke="#6366F1" strokeWidth="2" markerEnd="url(#x401-sig-arrow-indigo)" strokeLinecap="round" /><text x="255.0" y="98" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="14" fill="currentColor">GET /protected + PROOF-RESPONSE</text><circle cx="110" cy="108" r="11" fill="#6366F1" /><text x="110" y="112" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="11" fontWeight="700" fill="#FFFFFF">1</text><rect x="250" y="148" width="300" height="32" rx="10" fill="#6366F1" fillOpacity="0.10" stroke="#6366F1" strokeOpacity="0.45" strokeWidth="1" /><text x="408.0" y="168.5" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="14" fill="currentColor">Decode vp\_token · read proof.com#sig-1</text><circle cx="250" cy="164" r="11" fill="#6366F1" /><text x="250" y="168" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="11" fontWeight="700" fill="#FFFFFF">2</text><line x1="416" y1="220" x2="766" y2="220" stroke="#10B981" strokeWidth="2" markerEnd="url(#x401-sig-arrow-green)" strokeLinecap="round" /><text x="585.0" y="210" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="14" fill="currentColor">POST /x401-signatures + client assertion</text><circle cx="400" cy="220" r="11" fill="#10B981" /><text x="400" y="224" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="11" fontWeight="700" fill="#FFFFFF">3</text><text x="880" y="247" textAnchor="end" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="12" fill="currentColor" fillOpacity="0.7">Only when payment is due</text><rect x="384" y="252" width="500" height="160" rx="12" fill="none" stroke="currentColor" strokeOpacity="0.25" strokeWidth="1" strokeDasharray="5 5" /><line x1="754" y1="276" x2="404" y2="276" stroke="#10B981" strokeWidth="2" markerEnd="url(#x401-sig-arrow-green)" strokeLinecap="round" strokeDasharray="6 5" /><text x="585.0" y="266" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="14" fill="currentColor">402 + PAYMENT-REQUIRED</text><circle cx="770" cy="276" r="11" fill="#10B981" /><text x="770" y="280" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="11" fontWeight="700" fill="#FFFFFF">4</text><line x1="416" y1="332" x2="766" y2="332" stroke="#10B981" strokeWidth="2" markerEnd="url(#x401-sig-arrow-green)" strokeLinecap="round" /><text x="585.0" y="322" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="14" fill="currentColor">POST /x401-signatures + PAYMENT-SIGNATURE</text><circle cx="400" cy="332" r="11" fill="#10B981" /><text x="400" y="336" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="11" fontWeight="700" fill="#FFFFFF">5</text><rect x="660" y="372" width="200" height="32" rx="10" fill="#10B981" fillOpacity="0.10" stroke="#10B981" strokeOpacity="0.45" strokeWidth="1" /><text x="768.0" y="392.5" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="14" fill="currentColor">Settle USDC payment</text><circle cx="660" cy="388" r="11" fill="#10B981" /><text x="660" y="392" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="11" fontWeight="700" fill="#FFFFFF">6</text><line x1="754" y1="444" x2="404" y2="444" stroke="#10B981" strokeWidth="2" markerEnd="url(#x401-sig-arrow-green)" strokeLinecap="round" strokeDasharray="6 5" /><text x="585.0" y="434" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="14" fill="currentColor">200 + signatures + PAYMENT-RESPONSE</text><circle cx="770" cy="444" r="11" fill="#10B981" /><text x="770" y="448" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="11" fontWeight="700" fill="#FFFFFF">7</text><rect x="260" y="484" width="300" height="32" rx="10" fill="#6366F1" fillOpacity="0.10" stroke="#6366F1" strokeOpacity="0.45" strokeWidth="1" /><text x="418.0" y="504.5" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="14" fill="currentColor">Restore signatures · verify vp\_token</text><circle cx="260" cy="500" r="11" fill="#6366F1" /><text x="260" y="504" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="11" fontWeight="700" fill="#FFFFFF">8</text><line x1="384" y1="556" x2="114" y2="556" stroke="#6366F1" strokeWidth="2" markerEnd="url(#x401-sig-arrow-indigo)" strokeLinecap="round" strokeDasharray="6 5" /><text x="255.0" y="546" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="14" fill="currentColor">200 + protected resource</text><circle cx="400" cy="556" r="11" fill="#6366F1" /><text x="400" y="560" textAnchor="middle" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="11" fontWeight="700" fill="#FFFFFF">9</text><line x1="40" y1="622" x2="70" y2="622" stroke="#6366F1" strokeWidth="2" strokeLinecap="round" /><text x="80" y="626" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="12" fill="currentColor">x401</text><line x1="150" y1="622" x2="180" y2="622" stroke="#10B981" strokeWidth="2" strokeLinecap="round" /><text x="190" y="626" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="12" fill="currentColor">x401 Signatures endpoint</text><text x="880" y="626" textAnchor="end" fontFamily="Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" fontSize="12" fill="currentColor">Steps 2 to 8 are handled by the Proof SDK</text></svg>

## Detached-signature presentation

The `vp_token` keeps the format described in [SD-JWT VC Format](https://dev.proof.com/docs/sd-jwt-vc-format), except that the Issuer-Signed JWT and the Key Binding JWT have an empty signature segment:

```text
<issuer-header>.<issuer-payload>.~<Disclosure 1>~...~<Disclosure n>~<kb-header>.<kb-payload>.
```

The Key Binding JWT header carries a critical header parameter ([RFC 7515 §4.1.11](https://www.rfc-editor.org/rfc/rfc7515#section-4.1.11)) holding the id of the signature record:

```json Key Binding JWT header
{
  "typ": "kb+jwt",
  "alg": "ES256",
  "crit": ["proof.com#sig-1"],
  "proof.com#sig-1": "<record id>"
}
```

* The signatures are available for **1 hour** after the presentation is created.
* Verifiers MUST reject a Key Binding JWT whose `crit` lists a header parameter they do not implement.
* Attempting to verify the `vp_token` without fetching the signature segments first results in failure.

## Pay with x402

Proof implements [x402](https://www.x402.org) version 2 with the `exact` scheme and USDC.

| Environment  | Network                                      | `payTo`                                      |
| ------------ | -------------------------------------------- | -------------------------------------------- |
| `production` | Base · `eip155:8453`                         | `0x7f3bb9341698005d0b557550f4a3690388400a2f` |
| `sandbox`    | Base Sepolia (testnet USDC) · `eip155:84532` | `0x3b0b371ae3cb08f272b87319684f6518b3b313a0` |

1. Fetch the signature segments from the x401 Signatures endpoint, documented in the [API reference](https://dev.proof.com/reference/getx401signatures). The request carries the record id and a `private_key_jwt` client assertion ([RFC 7523](https://www.rfc-editor.org/rfc/rfc7523)) signed with a key published in the `jwks` of your [OAuth Client ID Metadata Document](https://dev.proof.com/docs/x401#3-host-an-oauth-client-id-metadata-document). The endpoint responds `402 Payment Required` with the payment requirements in its `PAYMENT-REQUIRED` header.

   [`POST https://api.proof.com/verifiable-credentials/v1/x401-signatures`](https://dev.proof.com/reference/getx401signatures)
2. Sign an [EIP-3009](https://eips.ethereum.org/EIPS/eip-3009) `transferWithAuthorization` for the `accepts` entry, wrap it in an x402 payment payload and resend the same request with the payload base64-encoded in the `PAYMENT-SIGNATURE` header.
3. Proof settles the payment and responds `200` with the signatures and a `PAYMENT-RESPONSE` header. Payment is required once per presentation.

x402 client libraries such as [`@x402/fetch`](https://github.com/x402-foundation/x402) handle these steps for you. See [Use with x402](https://dev.proof.com/docs/x401#6-optional-use-with-x402) to wire one into the Proof SDK.

## Restore and verify

Set `issuer_signature` as the third segment of the first `~` part and `kb_signature` as the third segment of the last `~` part:

```text
<issuer-header>.<issuer-payload>.<issuer_signature>~<Disclosure 1>~...~<Disclosure n>~<kb-header>.<kb-payload>.<kb_signature>
```

Then run the checks of [Validation](https://dev.proof.com/docs/verify-a-credential#validation) on the complete presentation. Comparing the `nonce` of the Key Binding JWT with the nonce of your request remains your responsibility.

***

See also: [x401](https://dev.proof.com/docs/x401) · [Verify a Credential (OID4VP)](https://dev.proof.com/docs/verify-a-credential) · [SD-JWT VC Format](https://dev.proof.com/docs/sd-jwt-vc-format) · [Proof Certificate Authority](https://dev.proof.com/docs/proof-certificate-authority)