Paid checkout.
Controlled provisioning.
Authenticate Stripe’s exact bytes, bind the paid session to its buyer’s public holder key, and commit one signed CUSTOS lease with durable deduplication.
Production uses the complete custom LIVE_* Stripe configuration, including restricted live keys. Preview keeps the managed sandbox credentials. Test/live events and sessions cannot cross modes. The signer checks that its environment-only seed matches the issuer pin. The issuer must also be enrolled in the engine’s trust file; storefront configuration alone cannot enroll it.
Webhook route
POST /api/stripe/webhook\nStripe-Signature: [Stripe-signed header]Raw-body parsing runs before JSON parsing. Invalid signatures return 400. A paid checkout.session.completed is retrieved from Stripe, checked for product, price, quantity, and buyer linkage, then provisioned. Failures before commit return 503 for retry.
Environment-only signing
CUSTOS_ISSUER_SEED # Server-only 32-byte seed as hex
LIVE_STRIPE_SECRET_KEY # Production-only rk_live_ or sk_live_ credential
LIVE_VITE_STRIPE_PUBLISHABLE_KEY # Production pk_live_ key; public config only
LIVE_STRIPE_WEBHOOK_SECRET # Production live endpoint signing secret
LIVE_STRIPE_PRICE_ID # Approved production one-time Price
STRIPE_SECRET_KEY # Managed sandbox credential; development
STRIPE_WEBHOOK_SECRET # Managed sandbox endpoint; development
CUSTOS_TRUSTED_ISSUER_PUBLIC_KEY # Optional override of public issuer pin
CUSTOS_LEASE_POLICY # Optional override of public grant policy
STRIPE_PRICE_ID # Optional development test Price override
APP_ORIGIN # Actual public browser originThere are no hardcoded private keys or fallback seeds. Scopes, maximum amount, swarm, and logical TTL are operator-approved policy—not buyer-controlled fields. Public defaults live in server/tier-config.ts; the actual Preview origin is allowed for sandbox testing. Set APP_ORIGIN to https://ericscott.ai for this production deployment. Live secrets never fall back individually to sandbox values. Readiness validates the active one-time USD Price against the selected Stripe account and mode.
The issued lease
lease_id 16 random bytes, lowercase hex
issuer trusted issuer's 32-byte public key, hex
holder buyer-provided 32-byte public key, hex
swarm_id approved swarm identifier
scopes sorted unique approved scopes
max_amount canonical u128 decimal string
lamport_issued current pinned clearance head clock
ttl 1–100000 Lamport ticks (not seconds)
sig Ed25519 signature, lowercase hexSigning input is ARKHEIA/custos/lease/v1, a zero byte, and JCS of the lease without sig. The engine’s own signing key is not a CUSTOS issuer.
One stored lease per checkout
A transaction inserts the unique event ID and locks the checkout row. Signing and fulfillment commit together. Event redelivery and distinct events for an already fulfilled session reuse the committed entitlement rather than minting another stored lease.
Delivery and operations
The purchase page requires the secure buyer cookie; a public session ID alone grants no access. It shows pending until the webhook commits, then offers a lease download. Access is browser-bound for 30 days; cross-device recovery is not implemented.
Only immediate, one-time card payments are offered. Refund-driven revocation, recurring renewal, and delayed payment fulfillment require separate lifecycle handling.
Download deployment instructionsThe custom production variables do not change the managed sandbox integration or register a live webhook. The live Stripe account must have an enabled checkout.session.completed endpoint at https://ericscott.ai/api/stripe/webhook with the matching signing secret. Restricted credentials require Checkout Sessions read/write and Prices read access. No real payment or live mandate approval was performed during deployment verification.