use-python-x402-core-avm

Implement custom x402 payment integrations on Algorand using the x402-avm Python SDK core components.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/Rudhrakoushik10/RootNode --skill use-python-x402-core-avm-rudhrakoushik10
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: use-python-x402-core-avm
Source: https://github.com/Rudhrakoushik10/RootNode/tree/main/projects/.opencode/skill/use-python-x402-core-avm
Command: npx skills add https://github.com/Rudhrakoushik10/RootNode --skill use-python-x402-core-avm-rudhrakoushik10

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires x402-avm, algosdk, and includes references (resource) components.

What problem does it solve? Building custom x402 payment flows on Algorand requires understanding signer protocols, CAIP-2 network identifiers, atomic transaction groups, and fee abstraction, which is error-prone without structured guidance on the x402-avm Python SDK. ## Core Features & Use Cases - Signer Protocol Implementation: Implement ClientAvmSigner and FacilitatorAvmSigner protocols for signing Algorand transactions in x402 payment flows. - Constants and Utilities: Use network constants (ALGORAND_TESTNET_CAIP2, USDC ASA IDs) and utility functions for address validation, amount conversion, and transaction decoding. - Fee-Abstracted Payment Groups: Build atomic transaction groups where a facilitator covers fees via pooled-fee self-payments. - Use Case: Register ExactAvmScheme on an x402Client so that fetch calls automatically handle 402 payment-required responses with USDC payments on Algorand testnet. ## Quick Start Use the x402-avm Python SDK to register an exact AVM scheme on an x402Client with a private key signer and fetch a paid resource on Algorand testnet.

Frequently Asked Questions about use-python-x402-core-avm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I register an AVM payment scheme on an x402Client in Python?

Import register_exact_avm_client from x402.mechanisms.avm.exact, create an x402Client instance, and call register_exact_avm_client(client, signer) with a ClientAvmSigner implementation. The client then handles 402 responses automatically on fetch calls.

How do I implement a ClientAvmSigner for Algorand payments?

Implement the ClientAvmSigner protocol with an address property and a sign_transactions method that accepts raw msgpack bytes. Convert raw bytes to base64 before calling algosdk encoding.msgpack_decode, sign with a base64 private key, and convert back to raw bytes.

What is fee abstraction in x402 Algorand payments?

Fee abstraction uses a two-transaction atomic group: a USDC transfer with zero fee signed by the client, and a self-payment from the fee payer covering both fees signed by the facilitator. Both transactions execute atomically, so the client never needs ALGO for fees.

Why does msgpack_decode fail when passing raw transaction bytes?

The Python algosdk msgpack_decode expects a base64 string, not raw bytes. Wrap raw bytes with base64.b64encode(raw).decode() before decoding, and base64-decode the output of msgpack_encode when converting back to raw bytes.

Does x402-avm support Algorand mainnet and testnet?

Yes, the SDK provides ALGORAND_MAINNET_CAIP2 and ALGORAND_TESTNET_CAIP2 constants with corresponding USDC ASA IDs (31566704 mainnet, 10458941 testnet). Facilitators can register multiple networks in a single register_exact_avm_facilitator call.

What Python version and packages are required for x402-avm?

Python 3.10 or later is required. Install the package with pip install "x402-avm[avm]" for the core AVM mechanism, or add framework extras like "x402-avm[avm,fastapi]" for web framework integration.