explain-algorand-x402-python

Explains the x402-avm Python package for Algorand payment protocol integration.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developers integrating the x402 payment protocol with Algorand in Python face confusing extras-based installation, async/sync variant mismatches, and tricky algosdk base64 encoding boundaries that cause common runtime errors. ## Core Features & Use Cases - Extras Installation Guidance: Explains which pip extras ([avm], [fastapi], [flask], [httpx], [requests], [all]) to install for each client, server, or facilitator use case. - Signer Protocol Implementation: Details the ClientAvmSigner and FacilitatorAvmSigner Protocol interfaces with complete implementation examples, including fee-abstracted payment groups. - Encoding Boundary Troubleshooting: Documents the raw msgpack bytes vs base64 string conversion rules for algosdk v2.11.1, with a table of common errors and fixes. - Use Case: A developer building a FastAPI facilitator service can follow the skill to register the exact AVM scheme, implement a facilitator signer, and handle simulate/send/confirm flows on Algorand TestNet. ## Quick Start Ask the assistant to explain how the x402-avm Python package works and which extras to install for your FastAPI or Flask Algorand payment integration.

Frequently Asked Questions about explain-algorand-x402-python

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

FAQPage Schema
How do I install the x402-avm Python package for Algorand?▼

Install x402-avm with pip extras matching your use case, such as pip install "x402-avm[fastapi,avm]" for a FastAPI server or "x402-avm[httpx,avm]" for an async client. The package installs as x402-avm but imports use the x402 namespace.

What is the difference between ClientAvmSigner and FacilitatorAvmSigner?▼

ClientAvmSigner signs payment transactions on the client side with an address property and sign_transactions method. FacilitatorAvmSigner adds server-side operations: sign_group, simulate_group, send_group, and confirm_transaction for settling payments on Algorand.

Should I use x402Client or x402ClientSync in Python?▼

Use x402Client with async frameworks like FastAPI and httpx, and x402ClientSync with sync frameworks like Flask and requests. Mixing variants causes runtime errors such as x402HTTPAdapter requiring a sync client.

Why does msgpack_decode fail with a bytes-like object error in algosdk?▼

Python algosdk msgpack_decode expects a base64 string, but the x402 SDK passes raw msgpack bytes. Convert with base64.b64encode(raw_bytes).decode("utf-8") before decoding, and base64.b64decode after msgpack_encode.

What format must the AVM_PRIVATE_KEY environment variable use?▼

AVM_PRIVATE_KEY must be a Base64-encoded 64-byte key consisting of a 32-byte Ed25519 seed plus a 32-byte public key. The Algorand address is derived with encoding.encode_address(secret_key[32:]).