Skip to main content

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

x402grants-0.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

x402grants-0.1.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

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

Hashes for x402grants-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1c4e9a2b6c36e83ff1c9eba9f812d3a21186ead95014be17327e8f6fbf120c45
MD5 2698914bd49079f31f4f03052c62d675
BLAKE2b-256 b736ecbf896fa7f54e3f58fb90f9d94ae3f99ab083bd17b9600af27333f76e09

See more details on using hashes here.

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

Hashes for x402grants-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb34565b21c545815c25b6687d6b41725e223f441ec18b74d1227f1ac5ebda3b
MD5 81dc6ff1060ce8c0d929c10257893063
BLAKE2b-256 ee5af3b08fe3e8f1feb0f1bc231351ea406ad5a5099b5ecff380a6ecf7a0d9a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page