fractalpay
FractalPay AaaS — Python SDK for the post-quantum, AI-verified, multi-chain payment gateway as a service.
Stripe-shaped API. Nine blockchains (8 EVM + Stellar) native. Cryptographic VAID-1 attestation on every payment. 0.618% fee instead of 2.9% + 30¢.
Install
pip install fractalpay
Requires Python 3.9+. Only dependency is httpx.
Quickstart — receive a payment in 5 lines
from fractalpay import FractalPay
fp = FractalPay() # base_url defaults to https://fractalai.net.co
intent = fp.intents.create(
amount="100.00",
currency="USDC",
recipient_address="0xYourWalletOnBase",
recipient_chain="base",
description="Pro plan — monthly",
callback_url="https://your-app.com/webhooks/fractalpay",
)
print(f"Send your customer to: {intent.web_url}")
# → https://fractalai.net.co/pay/{intent.id}
That's it. The customer lands on a hosted checkout page, pays in their wallet, your webhook fires when the payment is confirmed on-chain.
Why this exists
| Stripe | Coinbase Commerce | FractalPay | |
|---|---|---|---|
| Fee per tx | 2.9% + 30¢ | 1.0% | 0.618% (φ⁻¹) |
| Chains supported | 0 (card only) | 4 | 9 (8 EVM + Stellar) |
| Post-quantum signatures | ❌ | ❌ | ✅ CRYSTALS-Dilithium |
| Cryptographic proof per payment | ❌ (PDF receipt) | ❌ | ✅ VAID-1 attestation |
| Open source | ❌ | ❌ | ✅ Apache-2.0 |
| Settlement | T+2 to bank | T+0 to crypto | T+0 to crypto, fiat off-ramp roadmap |
Verify an incoming webhook
from fractalpay import verify_webhook
@app.route("/webhooks/fractalpay", methods=["POST"])
def handle_webhook():
event = verify_webhook(
payload=request.get_data(),
signature=request.headers["X-FractalPay-Signature"],
secret=os.environ["FRACTALPAY_WEBHOOK_SECRET"],
)
if event.type == "payment.completed":
# event.intent.id, event.intent.tx_hash, event.intent.payer_address
fulfill_order(event.intent.metadata["order_id"])
return "ok", 200
Query an intent
intent = fp.intents.retrieve("intent_abc123")
print(intent.status)
# 'created' | 'detecting' | 'confirming' | 'bridging' | 'completed' | 'expired' | 'failed' | 'refunded'
if intent.status == "completed":
print(f"Settled: {intent.settled_amount} {intent.currency} on {intent.recipient_chain}")
print(f"Payer: {intent.payer_address}")
print(f"Tx hash: {intent.tx_hash}")
List intents
# All recent
for intent in fp.intents.list(limit=100):
print(intent.id, intent.amount, intent.status)
# Only completed
for intent in fp.intents.list(status="completed", limit=50):
print(intent.id, intent.completed_at)
Multi-chain payment routing
Your customer can pay from ANY of the 9 supported chains; FractalPay handles the routing and bridges to your settlement chain.
intent = fp.intents.create(
amount="500.00",
currency="USDC",
recipient_address="0xMyBaseWallet",
recipient_chain="base", # I want USDC on Base
# Customer can pay from: ethereum, polygon, arbitrum, stellar, etc.
)
# `intent.suggested_chains` lists the chains the customer can use.
Hosted vs. embedded checkout
Hosted (recommended): redirect the customer to intent.web_url. Zero
frontend work, mobile-optimized, supports every wallet (MetaMask, Coinbase,
Lobstr, hardware wallets, etc.).
Embedded: use the JS widget — see @fractalai/pay (TypeScript SDK) and
/api/pay/widget endpoint.
Real-time updates (SSE)
for event in fp.intents.stream(intent.id):
print(f"{event.timestamp}: {event.status}")
if event.status in ("completed", "failed", "expired"):
break
What's a payment intent?
Same concept as Stripe's PaymentIntent: a server-side object representing
your intent to collect payment from a customer. It's created with an amount,
currency, and recipient; it expires after a TTL (default 30 min); it tracks
status through its lifecycle from created → detecting → confirming →
completed.
The big difference: FractalPay's intent is multi-chain native (the customer chooses where to pay from) and HMAC-signed (the recipient address can't be tampered with in transit).
License
- This SDK: Apache-2.0 (see
LICENSE) - The FractalPay API and protocol: same license, plus open-source server implementation at github.com/johnInarti/FRACTAL-AI
Resources
- API reference
- VAID-1 spec (the attestation standard every payment carries)
- TypeScript SDK (coming)
- Issues (label
fractalpay)
Metadata
Release files for fractalpay 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fractalpay-1.0.0.tar.gz | 16.7 kB | Without provenance | Details for fractalpay-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fractalpay-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for fractalpay-1.0.0-py3-none-any.whl |
Total release size: 30.9 kB
Release files / fractalpay-1.0.0.tar.gz
| Download URL | fractalpay-1.0.0.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9381cb68ac2ce816368f03270c47e085672abdc267ba9242d4947fd6e2821e1f
|
|
BLAKE2b-256 checksum How to use checksums |
a416271b80b962c6aa8a867543c0786db061485e312d25392f254ffd1b5606d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / fractalpay-1.0.0-py3-none-any.whl
| Download URL | fractalpay-1.0.0-py3-none-any.whl |
|---|---|
| Size | 14.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
853370621c130a309bc0fd38d9e1c40eca0e8d0639a01f7c3bc3768835b67b2c
|
|
BLAKE2b-256 checksum How to use checksums |
c0db3b5f859a501dbd19ce1eb8d1e20c6bda7f3e738b7669a2d21966de3a8c17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for fractalpay 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.