Specification · c402/1

The c402 protocol

c402 is a confidential compute layer that sits on top of x402 the same way x402 sits on top of HTTP. It adds exactly two headers. Everything else - what the computation is, what the inputs and outputs mean - is defined by the server.

HTTPgive me a resource
request / response
x402pay to access a resource
402 + PAYMENT-REQUIRED
c402pay to access a private thought
x402 + 2 headers

Two headers

Compute-Requiredon the 402

Describes the confidential computation: the TEE standard, the on-chain compute contract, the input schema/encoding, and the output schema. The client reads it to know what to encrypt and what to expect.

X-Attestationon the paid 200

Proves the TEE executed. Every field is a real, independently re-verifiable on-chain artifact - decisionId, commitment, registry, tx, output handles. No fabricated quotes.

Reference packages

@c402/spec
The protocol in code: constants, types, header codecs, SPEC.md, JSON schema.
@c402/server
c402(config) Express middleware - declare a confidential paid endpoint in one call.
@c402/client
c402Fetch(opts) - pay, consume, and verify an attestation as one fetch.
@c402/verify
Standalone on-chain attestation verifier anyone can run.

Trustless verification

The attestation is not a trust-us blob: it points at an on-chain commitment. A verifier re-reads that commitment from the registry on the declared network and confirms it matches, with no cooperation from the server. Try it on a real decision:

Full specification: packages/c402-spec/SPEC.md · JSON schema: packages/c402-spec/schema/attestation.schema.json
c402 · Confidential compute over x402
Composes x402 · iExec Nox · Safe · Uniswap - unmodified, on Ethereum Sepolia