Protocol
x402
Type
Spec
Stars
572
License
Apache-2.0
Last push
Aug 4, 2026

A2A x402 Extension x402 spec

by google-agentic-commerceโ€ข 572โ€ข
x402SpecPython

Extension bringing x402 crypto payments to the A2A protocol

About A2A x402 Extension

A2A x402 Extension is an open-source x402 spec by google-agentic-commerce, written mainly in Python. Extension bringing x402 crypto payments to the A2A protocol. It has 572 GitHub stars and uses the Apache-2.0 license, and its code was last pushed on Aug 4, 2026.

New to x402? Our x402 Protocol guide explains how it works and lists other projects built on it.

At a glance

Protocol
x402
Type
Spec
Language
Python
License
Apache-2.0
GitHub stars
572
Last push
Aug 4, 2026

Listed from public GitHub data, checked 2026-11-08. Not scanned by AgenticMart.

Questions about A2A x402 Extension

What is A2A x402 Extension?

Extension bringing x402 crypto payments to the A2A protocol It is listed as a x402 spec, maintained in the google-agentic-commerce/a2a-x402 repository on GitHub.

How do I install A2A x402 Extension?

The README in google-agentic-commerce/a2a-x402 has the setup steps. Clone the repository with git clone https://github.com/google-agentic-commerce/a2a-x402.git and follow its instructions.

Is A2A x402 Extension an official x402 project?

No. It is a community project built on x402, not published by the organisation that runs the protocol.

What license does A2A x402 Extension use?

It is published under the Apache-2.0 license. Check the license file in the repository before using it commercially.

Is A2A x402 Extension still maintained?

Its code was last pushed on Aug 4, 2026, and it had 572 GitHub stars when we checked on 2026-11-08. Look at recent issues and releases in the repository for a fuller picture.

README

A2A x402 Extension

The A2A x402 Extension brings cryptocurrency payments to the Agent-to-Agent (A2A) protocol, enabling agents to monetize their services through on-chain payments. This extension revives the spirit of HTTP 402 "Payment Required" for the decentralized agent ecosystem.

๐ŸŽฏ Goal

Enable agent commerce by providing a standardized way for agents to charge for their services and receive payments on-chain. This transforms any A2A agent into a commercial service that can charge for API calls, data processing, AI inference, or any other valuable capability.

๐Ÿ—‚๏ธ Repository Structure

This repository contains the specification, core libraries, and example implementations for the A2A x402 extension, supporting multiple languages.

x402-a2a/
โ”œโ”€โ”€ spec/
โ”‚   โ””โ”€โ”€ v0.1/
โ”‚       โ””โ”€โ”€ spec.md         # The official x402 extension specification
โ”‚
โ”œโ”€โ”€ schemes/                # Directory contains experimental x402 payment schemes drafted by partners and other contributors
โ”‚
โ””โ”€โ”€ {language}/             # Language-specific implementations (e.g., python/, typescript/)
    โ”œโ”€โ”€ x402_a2a/           # The core library for the x402 extension
    โ”‚
    โ””โ”€โ”€ examples/
        โ””โ”€โ”€ {demo}/         # Demonstrations for each language implementation

๐Ÿค” How It Works

The x402 extension defines a simple, robust payment flow between agents:

  1. Payment Required: A merchant agent, when payment is required for a service, responds with a payment-required message.
  2. Payment Submitted: The client agent signs the payment details and sends them back to the merchant in a payment-submitted message.
  3. Payment Completed: The merchant verifies the payment, settles it on-chain, and responds with a payment-completed message, delivering the requested service.

This flow is designed to be implemented in any language, allowing developers to focus on their agent's core logic.

๐Ÿš€ Getting Started

Each language-specific implementation (e.g., python/x402_a2a) contains its own README.md with detailed instructions on how to install dependencies, run tests, and use the library.

The examples/ directory contains various demonstrations of the x402 extension. Each example also has its own README.md with instructions on how to run it.

๐Ÿ—๏ธ Architecture

The x402_a2a libraries follow a functional core, imperative shell architecture:

  • Core Protocol: The fundamental data structures and functions for creating, signing, and verifying payments.
  • Executors: Middleware that automates the payment flow, making it easy to add payment capabilities to any agent.

This design provides both flexibility and ease of use, allowing developers to either build custom payment logic with the core protocol or use the executors for a more hands-off approach.

๐Ÿ“š Learn More

  • Specification: The complete technical specification for the x402 extension.
  • Python Library: The documentation for the Python implementation of the x402 extension.
  • Python Examples: The directory containing demonstration applications for the Python implementation.
  • A2A Protocol: The core agent-to-agent protocol.
  • x402 Protocol: The underlying payment protocol.
  • AP2 Protocol: The Agent Payments Protocol.

๐Ÿค Contributing

Contributions are welcome! Please read the specification and the existing code to understand the project's design and goals. Then, feel free to open a pull request with your changes.

More x402 projects

All 20 โ†’