Skip to main content

Architecture

OID4Pay decomposes into five independently deployable services plus a family of merchant SDKs. Each service has a single role on the wire and a single set of stored secrets; the service boundaries match the trust boundaries.

Topology

+------------------------+ +------------------------+ | Agent / MCP server | | Wallet Portal | | (Node, Python, Go) | | wallet.oid4pay.com | | holds DPoP keys | | (SvelteKit + Bun) | | | | OIDC RP to AS | +-----------+------------+ +-----------+------------+ | | | | OIDC login + consent | | | +--------------------v---------------------+ | | Authorization Server | +--------->| as.oid4pay.com (FastAPI + joserfc) | | PAR | issues JWT-AT, SD-JWT VC mandate | | token | runs /oauth/{par,token,revoke,introspect,| | | register,jwks.json,status-list} | | | dedicated Postgres + Redis | | +--------+--------+----------+-------------+ | | | | | | | | SSF events | | | v | | | +----------------+ | | | | Billing engine | | | | | (FastAPI, in- | | | | | house ledger) | | | | +-------+--------+ | | | | | | | | monthly invoice | | | v | | | +----------------+ | | | | Stripe Connect | | | | | settlement | | | | +----------------+ | | | v | v +--------------------------+ | +----------------------+ | Merchant SDK | | | Discovery directory | | (@oid4pay/oid4ac-merchant) | | discover.oid4pay.com | | verify-offer, verify- | | | (Go + chi + pgx) | | mandate, charge proxy | | | merchant identities, | +-----------+--------------+ | | JWKS, catalog URLs | | | +-----------+----------+ v | | +---------------------+ | | | Merchant storefront | | | | /.well-known/ |<--------+----------------+ | oid4ac-catalog | | /.well-known/jwks | +---------------------+

Services

ServiceHostRole on the wire
Authorization Serveras.oid4pay.comIssues JWT-AT and SD-JWT VC mandates, validates DPoP, enforces algorithm whitelist, runs the audit chain.
Wallet Portalwallet.oid4pay.comPrincipal's control plane: agents, mandates, approvals, audit, disputes, policy. OIDC RP to the AS.
Discovery Directorydiscover.oid4pay.comMerchant identities only: JWKS, catalog URL, category tags. No SKU aggregation.
Billing Engineas.oid4pay.com/billingSSF-driven double-entry ledger; per-merchant per-rail tiered fees; monthly invoices.
Merchant SDKsnpm, PyPI, Go modules, CDNVerify Offer + mandate + KB-JWT; proxy charge to the AS; identical wire shape across languages.
MCP servernpm @oid4pay/oid4pay-mcpModel Context Protocol tools: agent_payment_initiate, agent_verify_mandate, discovery_list_merchants.

Trust boundaries

Data ownership

DataOwnerWhere it lives
Principal accountWallet PortalWallet Postgres
Agent registrationASAS Postgres oid4pay_client
MandateAS issues; wallet storesAS Postgres + wallet session cache
Offer + catalogMerchantMerchant storefront origin only
Charge ledgerMerchant Stripe Connect accountStripe; mirrored to billing engine ledger
Audit chainOID4Pay (per tenant)AS Postgres oid4pay_audit_chain + S3 Object Lock

Deployment shape

The production fleet runs on five Contabo VPSes joined by a WireGuard mesh, with Cloudflare in front for TLS termination and DNS. Postgres 16 is primary-only today; the standby is for observability only. See operations for the operator runbook and the deploy and disaster-recovery procedures.