x402 Agent Grant System — EIP-712 signed spend grants for AI agent payments on Base L2
Project description
AgentPay — x402 Payment Infrastructure for AI Agents
AgentPay is the payment infrastructure layer for autonomous AI agents, IoT devices, and machine-to-machine commerce. It implements the x402 Agent Grant System — EIP-712 signed spend policies that let agents pay each other without sharing private keys.
What It Does
- Agent Grants — short-lived, budget-capped, scope-restricted spend authorizations (IAM for agents)
- Event-driven settlement — Base L2 payment confirmation in 2–6 seconds, automatic refunds on failure
- Reputation scoring — optional Sybil-resistant trust layer via The Graph subgraph
- Open spec — fully documented, conformance-tested, implement without AgentPay
Quick Start (60 seconds, no wallet)
git clone https://github.com/shawnhvac/x402.git
cd x402/examples/minimal-node-python
# Terminal 1 — receiving agent
cd python-receiving-agent && pip install -r requirements.txt && python app.py
# Terminal 2 — paying agent
cd node-paying-agent && npm install && npm start
See a full payment cycle — grant → verify → settle → receipt — in your terminal.
On-Chain (Base Sepolia)
Flip two env vars and run the same example with real USDC on Base Sepolia: BASE_SEPOLIA.md
How It Works
Every x402 payment is an HTTP request with a signed grant header:
POST /api/tool HTTP/1.1
X-402-Payment: <base64-encoded EIP-712 grant + EIP-3009 authorization>
The receiving agent verifies the grant offline (no RPC in the happy path), settles on-chain via EIP-3009 transferWithAuthorization, and returns a receipt in the response header.
Spec Suite
Six live documents covering every layer of the stack:
| Spec | Description |
|---|---|
| grants.md | EIP-712 grant schema, security rules, revocation |
| payment-flow.md | End-to-end lifecycle |
| conformance.md | One-command test suite |
| reputation.md | Reputation scoring |
| subgraph.md | The Graph deployment guide |
Links
- Website: x402-agent-pay.com
- GitHub: github.com/shawnhvac/x402
- Implementations: COMMUNITY.md
- Network: Base L2 (USDC)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file x402grants-0.1.0.tar.gz.
File metadata
- Download URL: x402grants-0.1.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c4e9a2b6c36e83ff1c9eba9f812d3a21186ead95014be17327e8f6fbf120c45
|
|
| MD5 |
2698914bd49079f31f4f03052c62d675
|
|
| BLAKE2b-256 |
b736ecbf896fa7f54e3f58fb90f9d94ae3f99ab083bd17b9600af27333f76e09
|
File details
Details for the file x402grants-0.1.0-py3-none-any.whl.
File metadata
- Download URL: x402grants-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb34565b21c545815c25b6687d6b41725e223f441ec18b74d1227f1ac5ebda3b
|
|
| MD5 |
81dc6ff1060ce8c0d929c10257893063
|
|
| BLAKE2b-256 |
ee5af3b08fe3e8f1feb0f1bc231351ea406ad5a5099b5ecff380a6ecf7a0d9a4
|