Facilitator¶
xrpl-mpp-facilitator is the settlement service behind the middleware.
Use It When¶
Use this package when you are operating the seller-side service that validates
presigned XRPL transactions, enforces replay rules, and manages prepaid session
balances.
The facilitator stays non-custodial: it verifies and settles buyer-signed transactions but does not hold the buyer's private key or run an internal ledger.
Install¶
pip install xrpl-mpp-facilitator
Run Locally¶
Set the core runtime variables first:
MY_DESTINATION_ADDRESSFACILITATOR_BEARER_TOKENwhenGATEWAY_AUTH_MODE=single_tokenREDIS_URLMPP_CHALLENGE_SECRET
Then start the service:
xrpl-mpp-facilitator --reload
For local docs and testing, the application loads .env automatically when present.
Endpoints¶
It exposes:
GET /healthGET /supportedPOST /chargePOST /session
GET /supported advertises the XRPL payment method and asset support the
middleware should expect. POST /charge handles exact-pay-per-request settlement.
POST /session handles open, use, top_up, and close session actions.
Important Settings¶
The most important facilitator knobs are:
SETTLEMENT_MODE=validatedoroptimisticNETWORK_IDandXRPL_RPC_URLMAX_PAYMENT_LEDGER_WINDOWfor publicredis_gatewaysmodeREPLAY_PROCESSED_TTL_SECONDSfor replay retentionSESSION_IDLE_TIMEOUT_SECONDSandSESSION_STATE_TTL_SECONDSfor prepaid sessions
The full environment reference is documented in Configuration.
Python App Factory¶
from xrpl_mpp_facilitator import create_app
app = create_app()
This is useful when you want to embed the facilitator in your own ASGI process instead of launching the packaged CLI entry point.
Operational Notes¶
- Redis is required for replay markers and session state.
validatedmode is the safer internet-facing default because the facilitator waits for XRPL validation before success.redis_gatewaysmode is stricter thansingle_tokenbecause it assumes third-party sellers or public relays may sit in front of the facilitator.