Sableye is Stripe for stablecoins: a drop-in SDK that lets any business accept USDT on Whitechain without ever handing its money to a middleman.
The problem. Businesses that want to take crypto payments today have two bad options. A custodial gateway holds their money and can freeze it. Or they paste a wallet address and check an explorer by hand: no invoices, no refunds, no receipts, no accounting. Sableye gives them the full Stripe experience (invoices, a checkout widget, refunds, subscriptions, webhooks, emails, a dashboard) while every payment goes straight from the customer's wallet to the merchant's wallet. Sableye never holds funds.
How it works. The merchant's server signs an EIP-712 invoice with its own key: amount, token, order ID, expiry, payout address. Signing costs no gas and needs no transaction. The customer pays it through our PaymentProcessor contract, which checks the merchant's signature, the expiry and the exact amount, and moves USDT directly to the merchant. Each invoice can be paid only once, refunds are capped on-chain at what was paid, and the contract never holds tokens. The checkout picks the best payment path automatically:
- gasless: EIP-3009, where the customer holds no gas token and the merchant's server pays a fraction of a cent;
- permit: one transaction;
- approve: works with any token.
The server confirms each payment from the chain before fulfilment, never from the browser.
What a merchant gets (one npm package: npm install sableye):
- invoices and payment links with QR codes;
- a styled <Checkout> component with themes, plus a one-line <script> drop-in for plain HTML sites;
- mobile wallets via WalletConnect;
- gasless payments;
- full and partial refunds;
- recurring subscriptions with a customer-approved spending cap, charged automa keeper;
- coupons;
- signed webhooks with replay;
- email invoices, receipts and "you got paid" notices with PDFs;
- revenue analytics (MRR, churn), reconciliation and CSV export.
Built for AI coding agents. npx sableye init asks the merchant what they need: ting, checkout look. It writes their settings, then sets up their coding agentwith version-matched docs, an AGENTS.md and a skill, and prints a prompt that wires Sableye into the app's existing payment step without redesigning it. In our evaluation, Claude Code
integrated Sableye correctly in 12/12 trials across four real-shaped apps: Nexterver, Express, and a static HTML site.
Merchant-owned records on Arkiv. Every paid invoice, refund and subscription is the merchant's wallet and written by the merchant's own server. Public fieldsare only what is already public on-chain. Order details and customer data are encrypted with a view key derived from the merchant's wallet signature. Our Books page reads these records
directly from Arkiv in the browser with no Sableye code, verifies each one again, and decrypts with the merchant's wallet. The merchant's books survive even if every Sableye server goes offline. A paid invoice costs about 0.00038 GLM per year on Arkiv.
Verified, not just tested. The contracts are deployed and fully verified on Whitechain Sepolia, and the source on the explorer is byte-identical to our repo.
- PaymentProcessor: 0x8312552Ec716F0c159D88F73230Fff98C4aeCfB5
- SubscriptionManager: 0x4E2571F08f6399b769F5F04ED7a54CE55729Bb78
Beyond unit, fuzz and invariant tests:
- we proved the core properties with Halmos (symbolic execution) and SMTChecker
- Gambit mutation testing: our test suite killed 165 of 165 mutants;
- we model-checked the SDK's indexer and subscription keeper with Quint/Apalach
That process found and fixed eight real bugs.
Try it. The live sandbox at https://sableye.xyz runs a real merchant on Whitech
- create and pay invoices with real test USDT, use gasless checkout, refund, and subscribe with renewals every 5 seconds;
- watch webhooks and emails arrive;
- see everything in the merchant's Client view;
- open the merchant's books on Arkiv.
Contracts (Solidity 0.8.30, Foundry, OpenZeppelin).
- PaymentProcessor checks an EIP-712 signed invoice (merchant, payout, token, amount, expiry, nonce):
- Signatures: SignatureChecker, so both normal wallets (EOAs) and smart-contract wallets (ERC-1271, e.g. Safes) can be merchants.
- Transfers: SafeERC20 moves tokens straight from payer to payout. The processor never holds a balance.
- Three payment paths: pay (approve), payWithPermit (EIP-2612), and payWithAuthorization (EIP-3009, gasless, with the authorization bound to the invoice hash so a relayer can't redirect it).
- Refunds are capped at what was paid, and revocation works via nonce bumps.
- SubscriptionManager stores a customer-approved spending cap and lets the merchant's keeper charge one period at a time, with on-chain timing checks.
- Deployment: both are deployed and verified on Whitechain Sepolia. We confirmed the explorer's verified source is byte-identical to the repo.
Formal verification, done for real during the hackathon:
- Halmos symbolic proofs (17), with symbolic block time and number. Proofs that pass vacuously are a classic trap, so we planted 13 deliberate bugs and confirmed every proof catches them.
- solc's SMTChecker.
- Gambit mutation testing: we wrote a parallel worker-queue runner, and the test suite killed 165 of 165 mutants.
- Quint models of our TypeScript indexer and subscription keeper, model-checked with Apalache.
Together these found eight real bugs, e.g. a reorg could lose an event, and a failing subscription could block every other renewal behind it. All were fixed.
SDK (TypeScript, viem, pnpm monorepo) → one npm package, sableye.
- sableye (core, browser-safe): a headless checkout engine that runs a "capability ladder" (gasless → permit → approve), EIP-6963 wallet discovery, and invoice/signature checks done before any wallet prompt, so a forged payment link can't phish an approval.
- sableye/server:
- invoice signing and verifyPayment;
- an indexer that follows Whitechain's latest, safe and finalized heads, with reorg rollback, signed webhooks and replay;
- a persisted outbox (keyed jobs, retries) for emails, Arkiv writes and webhooks, so side effects never block a payment;
- a subscription keeper;
- emails (nodemailer or Resend over HTTPS) and PDF invoices and receipts (pdf-lib);
- coupons and revenue analytics.
- sableye/react: <Checkout> with scoped CSS themes (light, night, none plus brand variables).
- sableye/mcp: an MCP server for AI agents.
- CLI: init, agents, doctor, listen (like stripe listen), create, view-key.
Partner tech.
- Whitechain: the chain and its official USDT. EIP-3009 support on USDT lets customers pay with zero gas tokens, while the merchant sponsors about 0.0001 WBT per payment. Whitechain's safe and finalized block tags drive our confirmation states: Arkiv records are written only at safe.
- Arkiv (Rabdi testnet, @arkiv-network/sdk): the merchant's own system of record. The merchant's server publishes sableye.invoice.v1, refund.v1, subscription.v1 and merchant.v1 entities, signed by the merchant key so the merchant's wallet owns them.
- Updates and lifetime: refunds and charges patchEntity, and a loop extendEntitys records before their 180-day expiry.
- Privacy: public columns contain only facts already on-chain, and private fields are AES-256-GCM encrypted.
- Reading: the Books page reads records with ownedBy(merchant) and checks each tx_hash on Whitechain, because anyone can write lookalike entities.
- Cost: we measured it, about 0.00038 GLM per invoice per year.
- Reown / WalletConnect: we used universal-provider without the modal, drawing our own pairing QR so the checkout stays small and on-brand.
Website: Next.js 16 on Railway, with a persistent volume for the indexer, outbox and keeper state, auto-deployed from GitHub to sableye.xyz. Emails go through Resend from our own domain.
Notable hacks:
- A view key that's never stored. It's keccak256 of the merchant's signature over a fixed message. Wallet signatures are deterministic (RFC 6979), so the server (from the private key) and the browser (from MetaMask personal_sign) derive the same key. The merchant unlocks their encrypted books just by signing.
- A books app with zero Sableye code. The Books page is deliberately written using only the Arkiv SDK and viem, with decryption reimplemented from our public schema doc. A test fails the build if it ever imports Sableye. It proves any accountant's app could read a merchant's books.
- One npm package from five. A build script copies the compiled workspace packages into a single package and rewrites the @sableye/* imports into relative paths. It also transpiles the docs website's TypeScript content into markdown, so the docs ship inside node_modules/sableye/docs and always match the installed version.
- AI-agent setup driven by config. init saves the merchant's choices in package.json and generates an AGENTS.md block covering only the enabled features, plus a prompt. Our eval harness runs claude -p on four fixture apps, each with a fake payment step, and grades nine checks. One check fails the trial if the agent adds any new buttons, fields or pages. Result: 12/12.
- Not touching the verified contracts.
- Ended subscriptions: the contract keeps a cap-exhausted subscription active, so the SDK and UI detect "ended" themselves, and "Subscribe again" cancels then re-subscribes.
- Subscription emails: a watcher diffs on-chain snapshots against what it last saw, and its first run records a baseline so nobody gets emails about the past.
- Railway's plan blocks SMTP. We added a Resend HTTPS transport behind the same nodemailer interface.
- Lost background jobs: a test caught a race where a job enqueued just as the outbox finished draining was lost; fixed with a "dirty" re-loop.