Internet-Draft x402-pqc-cred-binding November 2026
Hopley Expires 21 May 2027 [Page]
Workgroup:
Independent Submission
Internet-Draft:
draft-hopley-x402-pqc-credential-binding-01
Published:
Intended Status:
Informational
Expires:
Author:
C. Hopley
AlgoVoi

Post-Quantum Credential Binding for x402 Agentic Payment Authorization

Abstract

This document defines how Falcon-1024 (NIST FIPS 206 / FN-DSA) and ML-DSA-65 (NIST FIPS 204) credentials bind to x402 agentic payment authorization. It specifies the credential envelope format, the JCS canonicalization discipline applied to signed payloads, the gateway verification procedure, and the session token binding that replaces per-request API key authentication for credentialed agents.

This is the first Internet-Draft in the agentic payments space to anchor credential binding to the NIST post-quantum cryptography standards (FIPS 203/204/206).

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on 21 May 2027.

▲

Table of Contents

1. Introduction

The x402 payment protocol [x402] enables HTTP-native micropayments between autonomous agents and API providers. As agent deployments scale, two problems emerge:

  1. Per-request authentication overhead. An agent making thousands of payment-gated requests must authenticate on every call. API keys are long-lived secrets that create revocation and rotation complexity.

  2. Quantum vulnerability. All deployed x402 credentials use Ed25519 or ES256 — algorithms broken by a cryptographically-relevant quantum computer running Shor's algorithm.

This document addresses both by defining a credential binding scheme where:

1.1. Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174].

Issuer: An entity that evaluates an agent and signs a credential asserting the result. The reference implementation is the AlgoVoi Agent Trust Bench.

Gateway: The x402 payment gateway that accepts credentials and issues session tokens.

Agent: An autonomous software system presenting credentials to a gateway in exchange for payment-authorization session tokens.

ATB Pass Certificate: A Falcon-1024-signed credential asserting that an agent passed adversarial evaluation. Phase 1 contains a plaintext score; Phase 2 replaces the score with a Bulletproofs range proof (zero-knowledge).

2. Credential Envelope Format

A PQC credential is a JSON object serialised to UTF-8 and encoded as base64url (without padding). The structure is:

{
  "alg":     "<algorithm>",
  "kid":     "<key-id>",
  "payload": { ... },
  "sig":     "<base64url signature>"
}

2.1. alg field

MUST be one of:

  • "Falcon-1024" — FN-DSA-1024 per NIST FIPS 206.

  • "ML-DSA-65" — Module-Lattice Digital Signature per NIST FIPS 204.

The "Falcon-1024" algorithm is the RECOMMENDED choice. It provides 1,024-bit classical security, 256-bit post-quantum security, and compact signatures (~1,280 bytes).

2.2. kid field

A 16-character lowercase hex string derived as:

kid = hex(SHA-256(public_key_bytes))[:16]

The gateway MUST verify that the kid in the envelope matches the kid of the issuer's public key in its trusted-key registry before proceeding to signature verification.

2.3. payload field

A JSON object. Required fields for ATB Phase 2 credentials:

Table 1
Field Type Description
atb_cert_version string MUST be "2" for Phase 2 ZKP credentials.
bench_issuer string Issuer DID (e.g. did:algovoi:bench:prod).
commitment_b64 string Bulletproofs Pedersen commitment (base64 std).
proof_b64 string Bulletproofs range proof (base64 std).
threshold_milliunits integer Range proof lower bound (0–1000).
expires_at string ISO 8601 UTC expiry timestamp.
issued_at string ISO 8601 UTC issuance timestamp.
methodology_version string Evaluation methodology version string.

The commitment_b64 field MUST decode to exactly 32 bytes (a compressed Ristretto255 point). The proof_b64 field MUST decode to 200–900 bytes (a 64-bit Bulletproofs range proof over Ristretto255).

2.4. sig field

Base64url-encoded detached signature over the JCS-canonical form of the payload field. The signer applies RFC 8785 [RFC8785] canonicalization to the payload object, then signs the resulting UTF-8 bytes.

For alg = "Falcon-1024", the signature is a Falcon-1024 detached signature (NIST FIPS 206, PQClean format, ~1,280 bytes, base64url).

3. Signing Procedure

The issuer:

  1. Constructs the payload JSON object with all required fields.

  2. Applies RFC 8785 JCS canonicalization to produce canonical_bytes.

  3. Signs canonical_bytes using Falcon-1024 or ML-DSA-65.

  4. Base64url-encodes the signature as sig.

  5. Assembles the envelope: {"alg":…,"kid":…,"payload":…,"sig":…}.

  6. Base64url-encodes the envelope JSON as the credential string.

The issuer MUST NOT include the sig field in the payload before signing. The alg and kid envelope fields MUST NOT be signed.

4. Verification Procedure

The gateway receiving X-ATB-ZK-Credential: <credential>:

  1. Base64url-decode and JSON-parse the envelope.

  2. Verify alg is a supported algorithm.

  3. Resolve the bench_issuer DID from the payload to a trusted hub entry.

  4. Verify kid matches hex(SHA-256(hub.public_key))[:16].

  5. Verify expires_at has not elapsed.

  6. Base64url-decode sig.

  7. Apply JCS canonicalization to payload.

  8. Verify the Falcon-1024 (or ML-DSA-65) signature.

  9. Decode and structurally validate commitment_b64 and proof_b64.

  10. Call the ZKP verification service to verify the Bulletproofs range proof.

  11. If all checks pass, passed = true.

A gateway SHOULD implement an LRU cache keyed by (sha256(sig)[:32], kid) to avoid re-running Falcon verification for repeated presentations within the cache TTL. The cache TTL MUST NOT exceed the credential's expires_at.

5. Session Token Binding

On successful credential verification, the gateway issues a session token:

POST /auth/token
Authorization: Bearer <api-key>
X-Tenant-Id: <tenant-id>
Content-Type: application/json

{
  "atb_zk_credential": "<credential>",
  "spend_cap_usd": 100.0,
  "ttl_secs": 3600
}

Response:

{
  "token": "<session-token>",
  "token_type": "Bearer",
  "expires_in": 3600,
  "spend_cap_usd": 100.0,
  "jti": "<unique-token-id>"
}

The session token is a JWT [RFC7519] signed with the gateway's HMAC key. Its claims include tenant_id, jti, spend_cap (in micro-USD), exp, and iat. Subsequent requests carry only:

Authorization: Bearer <session-token>

No API key or tenant header is required for the session duration.

5.1. Spend Cap Enforcement

The gateway tracks cumulative spend per jti in-process. On each successful payment, spend is incremented. If spend >= spend_cap, the gateway MUST reject the request with HTTP 402.

6. Algorithm Comparison

Table 2
Property Ed25519 Falcon-1024 (FIPS 206) ML-DSA-65 (FIPS 204)
Classical security 128-bit 1024-bit 192-bit
Post-quantum security Broken ~256-bit ~192-bit
Signature size 64 B ~1,280 B ~3,309 B
NIST standard No FIPS 206 FIPS 204
Deployed in x402 Yes AlgoVoi only AlgoVoi only

Implementations SHOULD prefer Falcon-1024 for its signature compactness in HTTP header contexts.

7. Security Considerations

7.1. Quantum threat model

An adversary with a cryptographically-relevant quantum computer can break Ed25519 and ES256 signatures using Shor's algorithm. All credentials using these algorithms are vulnerable to retrospective forgery once such a machine exists. Issuers SHOULD migrate to Falcon-1024 or ML-DSA-65 before quantum computers reach this capability threshold.

7.2. Score privacy

Phase 2 ATB credentials include a Bulletproofs range proof rather than a plaintext score. The range proof attests that score >= threshold without revealing the exact score. Gateways MUST NOT attempt to reconstruct scores from commitment values.

7.3. Replay attacks

The jti in each session token is a random 128-bit value generated at issuance. Gateways MUST track issued jti values and reject replayed tokens. The credential nonce in Phase 1 activation flows prevents replay at the license-activation layer.

7.4. Key rotation

Issuers SHOULD rotate Falcon-1024 keys at least annually. The kid field allows gateways to maintain a key registry and identify credentials by key version without revoking the full issuer DID.

8. IANA Considerations

This document has no IANA actions.

9. References

9.1. Normative References

[FIPS204]
NIST, "Module-Lattice-Based Digital Signature Standard (ML-DSA)", NIST FIPS 204 , .
[FIPS206]
NIST, "Module-Lattice-Based Digital Signatures — FN-DSA (Falcon)", NIST FIPS 206 , .
[RFC8785]
Rundgren, A., Jordan, B., and S. Erdtman, "JSON Canonicalization Scheme (JCS)", .
[RFC7519]
"JSON Web Token (JWT)", .

9.2. Informative References

[x402]
"The x402 Payment Protocol for Internet-Native Micropayments", n.d., <https://x402.org/spec>.
[ATB]
Hopley, C., "AlgoVoi Agent Trust Bench: Adversarial Evaluation, Post-Quantum Credential Binding, and Cross-Issuer Federation for Agentic Payment Safety", IACR ePrint 2026/109852 , , <https://eprint.iacr.org/2026/109852>.
[BULLETPROOFS]
al., B. B. et., "Bulletproofs: Short Proofs for Confidential Transactions and More", IEEE S&P 2018 , .

Author's Address

C. Hopley
AlgoVoi