# Whitepaper

> The protocol's normative specification. Wire format, validation rules, security model.

The full normative specification for the `aa-native` scheme is published as a whitepaper (PDF). It is the authoritative source for any conformance question.

[Download the whitepaper (PDF, ~280 KB, 16 pages)](/whitepaper.pdf)

## What's inside

1. **Background.** The x402 V2 protocol; why ERC-4337 accounts cannot satisfy `exact`; the two motivations for `aa-native`.
2. **The aa-native scheme.** Payload format, wire-format integration, `requestHash` derivation, verification rules, settlement procedure, and the complete error code list.
3. **Comparison to `exact`.** Side-by-side table plus prose on operational simplicity and trust assumptions.
4. **Reference implementation.** `SettlementContract.sol`, the facilitator service, and the four-package SDK suite.
5. **Security considerations.** Replay protection (on-chain and off-chain), cross-merchant replay, paymaster abuse, settlement finality, refund posture.
6. **Future work and standardization.** Multi-chain deployment, per-merchant settlement contracts, session keys, and the path to upstream standardization through `coinbase/x402#639`.

The two appendices are a glossary of the AA and x402 terms used throughout, and a reference list of every external standard and document the spec relies on (RFC 2119, ERC-4337, EIP-3009, x402 V2 transport, NERO AA platform docs).

## Citing

The whitepaper version printed on the title page is the canonical reference. When citing the spec in upstream conversations, link directly to the PDF; when referring to a specific clause, cite the section number (e.g., "see whitepaper §2.4 for the full validation rules").

## Source

The whitepaper source is in the project repo at [`docs/whitepaper/whitepaper.md`](https://github.com/nerochain/nero-x402/blob/main/docs/whitepaper/whitepaper.md). It builds to PDF via Pandoc + Typst (`make pdf` in that directory). The protocol-flow figure is generated from a D2 diagram source at `docs/whitepaper/figures/protocol-flow.d2`.
