World is Flat hackathon eligibility requires using $wif onchain on Robinhood
Chain; the existing integration only proved testnet Mock-USDC. Adds a real
robinhoodWif registry entry (18-decimal $wif, contract and chain id verified
live via eth_call), a Permit2 facilitator asset entry, and a ready-to-run
LIVE=1-gated mainnet settlement proof script (scripts/wif-mainnet-proof.ts)
with a safe default SIMULATE mode (no funds, no key) smoke-tested against
the live chain.
Also diagnoses and partially fixes settlekit-api.onrender.com timing out:
neither the migration client nor the app's DB connection set a
connect_timeout, so a stale DATABASE_URL hung boot indefinitely, and the
Dockerfile CMD's `&&` meant a migration failure blocked the server from even
starting. Adds a bounded default timeout and decouples server start from
migration success so failures are fast and visible instead of silent.
packages/chains + packages/x402-facilitator: 194/194 tests pass (registry
invariants updated for the two intentional exceptions: $wif=18 decimals,
robinhoodWif is mainnet-only).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Checkout fixtures are dated 2026-09-29 but expiry reads the wall clock, so
24 tests started failing once the real date passed the checkout window.
The schema test predated the x402_nonces table, which is keyed by the
claimed authorization instead of id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every seller webhook delivery now keeps an attempt log (status code,
error, time, next retry) in the worker queue (Postgres) or in memory.
New routes: GET /v1/webhooks/deliveries(/:id), POST
/v1/webhooks/events/:id/resend, POST /v1/webhooks/endpoints/:id/test
(signed webhook.test event), rotate-secret with a 0-168h grace window
(both secrets sign as two v1 values, verified by @settlekit/webhooks, the
TS/Python/Go/Rust SDKs and the WooCommerce plugin), and disable/enable.
The worker retries on a 1m..6h exponential schedule instead of every tick,
signs with the live endpoint secret, skips disabled endpoints and
auto-disables one after 100 failed attempts in a row
(WEBHOOK_DISABLE_AFTER_FAILURES). Outbound requests get a 10s timeout.
The dashboard Webhooks page shows the event log with Resend and endpoint
actions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- PgX402NonceStore (x402_nonces, migration 0012): reserve is INSERT ... ON
CONFLICT DO NOTHING on the primary key, so one settle wins across replicas.
The API wires it whenever DATABASE_URL is set; otherwise the facilitator
falls back to the in-memory store and logs a boot warning. One store is
now shared by every per-environment facilitator part.
- allowedPayTo defaults to this deployment's own EVM receiving addresses
(X402_EVM_PAY_TO + X402_PAY_TO_<CHAIN>); an empty allowlist refuses every
recipient, and only X402_FACILITATOR_ALLOWED_PAY_TO=* opens the relayer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in packages/routing, packages/hyperliquid (hypercore network), checkout
AnyTokenPay/HyperCorePay, Node 22 pins, tenant-ownership guards and the zcash
tag lock. Only conflict: drizzle _journal.json (kept 0010_onchain_billing and
0011_coupons_organization in order).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Migration 0010 adds onchain_subscriptions, onchain_charges (UNIQUE per
subscription+period) and onchain_escrow_payments. PgOnchainBillingStore
claims a period under a row lock so API and worker replicas can never
charge the same period twice. Adds shared access hooks (extend/suspend
core subscription, record payments, expire entitlements) and links
escrow payments to their checkout session.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coupons gain an organizationId (column + migration 0010); legacy rows with no
owner stay hidden from every tenant.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tag assignment was read-then-write, so concurrent sessions paying the same
transparent address could lock the same tag and one payment would match
both. The base quote is now locked with tag 0 and the tag is chosen and
saved under a per-payTo lock (pg_advisory_xact_lock(hashtext(key)) shared
by the API and checkout when Postgres is wired, an in-process mutex
otherwise), with a post-save uniqueness re-check that retries on the next
tag.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace payments_tx_hash_idx with a unique index on payments.tx_hash
(WHERE tx_hash IS NOT NULL) so a transaction can settle at most one
payment across processes. Migration 0009 + schema test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CRITICAL-1: validate SIWE domain/chainId server-side (EIP-4361 cross-site replay guard); AuthService gains siweDomain/siweChainIds, wired from AUTH_SIWE_DOMAIN/AUTH_SIWE_CHAIN_IDS in apps/api context.
CRITICAL-2: UNIQUE index on auth_accounts.wallet_address (migration 0007) as the final gate against the link/login race; loginWithWallet + linkWallet catch the violation -> conflict. Verified on live Postgres (dup rejected, NULLs allowed).
CRITICAL-3: /api/session (dashboard + portal) now verify the token with the API before persisting the cookie (no session fixation); + same-origin check on cookie-setting + /api/wallet/link routes (MEDIUM-3 CSRF).
HIGH-1: require expirationTime; enforce notBefore + issuedAt skew (shared verifyWalletMessage); clients now set expirationTime.
HIGH-2 (rate-limiting, task a): /v1/auth no longer exempt — stricter AUTH_RATE_LIMIT_PER_MINUTE (default 20) in a separate bucket; opportunistic expired-nonce prune (store + Pg).
HIGH-3: reserve the wallet email domain — block email/magic-link registration on it (no synthetic-email squatting).
HIGH-4: gate X-Forwarded-For trust behind TRUST_PROXY.
LOW-1: require a 65-byte (130-hex) ECDSA signature at the API boundary.
+ web3 tests for domain mismatch, missing-expiration, reserved-email. 1308 tests / 213 suites, typecheck + full build green; migrations 0006/0007 verified on Postgres.
Adds @settlekit/attribution — reuse-detection, weighted provenance lineage,
and HMAC-signed proofs-of-citation — wired live into the rsshub-citation-toll
sidecar (POST /attribution/{detect,proof,verify}) and persisted via
PgLineageStore/PgProofStore over new lepton_lineage_edges + lepton_citation_proofs
tables.
Adds apps/creator-dashboard — a Next.js earnings view in the Statement
greenbar-ledger design system, driven by real domain logic (createSource +
computeRoyaltyDistribution + detectReuse, not mocks). Statement / Sources /
Payouts / Reuse & proofs (interactive) / Wallet. next build green.
Also bundles in-progress settlement hardening: settlement-core idempotency
concurrency, api env validation, bundles + contracts/worker tweaks.
Verified: 943 vitest tests, 27 Foundry tests, next build all green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>