create-python-x402-facilitator

Build FastAPI facilitator services that verify and settle x402 payments on Algorand.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires x402-avm, py-algorand-sdk, fastapi, uvicorn, and includes references (resource) components.

What problem does it solve? Building an x402 payment facilitator for Algorand requires implementing the FacilitatorAvmSigner protocol, handling algosdk's tricky base64/msgpack encoding boundaries, and wiring up verification and settlement endpoints—tasks that are error-prone without a proven reference implementation. ## Core Features & Use Cases - FacilitatorAvmSigner Implementation: Provides a complete, production-ready signer class covering sign_transaction, sign_group, simulate_group, send_group, and confirm_transaction using py-algorand-sdk. - FastAPI Service Scaffolding: Generates /verify, /settle, and /supported endpoints registered via register_exact_avm_facilitator for Algorand testnet and mainnet. - Multi-Network Support: Covers registration patterns for combined EVM, SVM, and AVM facilitators, plus lifecycle hooks for custom verification and settlement logic. - Use Case: A developer needs to accept x402 payments on Algorand; this Skill produces a working facilitator service with correct algosdk encoding handling and troubleshooting guidance for common errors like msgpack_decode failures. ## Quick Start Create a Python x402 facilitator service for Algorand testnet with FastAPI endpoints for verifying and settling payments.

Frequently Asked Questions about create-python-x402-facilitator

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

FAQPage Schema
How do I create a Python x402 facilitator for Algorand payments?

Install x402-avm with the avm and fastapi extras, implement the FacilitatorAvmSigner protocol using py-algorand-sdk, register it via register_exact_avm_facilitator, and expose /verify, /settle, and /supported endpoints through FastAPI.

How to implement the FacilitatorAvmSigner protocol in Python?

Implement six methods: get_addresses, sign_transaction, sign_group, simulate_group, send_group, and confirm_transaction. The protocol uses structural typing, so any class implementing all methods satisfies it without inheritance.

Why does msgpack_decode fail with raw bytes in algosdk?

Python algosdk's msgpack_decode expects a base64 string, not raw bytes. Convert with base64.b64encode(raw_bytes).decode() before decoding, and use base64.b64decode on msgpack_encode output when returning bytes.

Can one facilitator support EVM, SVM, and Algorand networks?

Yes, a single x402Facilitator instance supports multiple networks by calling register_exact_evm_facilitator, register_exact_svm_facilitator, and register_exact_avm_facilitator with their respective signer implementations.

What environment variables does an Algorand facilitator need?

AVM_PRIVATE_KEY is required as a base64-encoded 64-byte key. ALGOD_SERVER and ALGOD_TOKEN are optional for custom nodes; otherwise public AlgoNode endpoints for testnet and mainnet are used by default.

Why does transaction simulation fail during payment verification?

Simulation fails when the transaction group would fail on-chain, typically due to insufficient balances, missing asset opt-ins, or incorrect fee amounts. Check the failure-message field in the simulation result for the specific cause.