ASAP Protocol
The Handshake Protocol
Last updated Recently
ASAP revives the reserved HTTP status code 402 Payment Required to create a standard for machine commerce.
The Protocol Flow
| Step | Actor | Action | Data Exchanged |
|---|---|---|---|
| 1 | Consumer | GET /resource | None |
| 2 | Provider | Returns 402 | JSON: { recipient, token, amount, chainId } |
| 3 | Consumer | Signs Tx | On-Chain: ERC20.transfer(recipient, amount) |
| 4 | Consumer | GET /resource | Header: Authorization: Bearer 0xTxHash... |
| 5 | Provider | Verifies Tx | RPC Call: eth_getTransactionReceipt |
| 6 | Provider | Returns 200 | JSON: { requested_data } |
Why this is revolutionary
- Stateless: The provider doesn't need to maintain a database of users or API keys. The blockchain is the database.
- Permissionless: Any agent can pay any service without signing up.
- Composable: Agents can chain these requests (Agent A pays Agent B, who pays Agent C) to build complex supply chains.