Coinbase Onramp + Offramp (feature-flagged, mock mode) with server-side screening; USDC as dollars #4

Merged
Taskuler-bot merged 4 commits from feat/coinbase-ramps into feat/phase1-scaffold 2026-11-11 03:41:52 +00:00
Member

This reopens the work from web #2 under Taskuler-bot so George can review it. Head: feat/coinbase-ramps @f596353 (merge of #3 @786e1f7 into the screening update @7c5ddd5).

Stacked on #3 (feat/nov9-tax-notice-cr2-plan @786e1f7, keeps TaxNotice and the CR2 plan/sketch aligned with contracts #5 @1f2e460 / #6 @c988b9c). George's request, relayed by Taskuler on Nov 10, 2026, 10:29 AM CT: "start the coinbase work". PR only: don't merge, deploy, sign up for Coinbase/CDP, submit an app for approval, or spend.

What this adds (Coinbase UI off by default; live escrow screening on unless disabled)

  • Funding (Post job, USDC): "Need USDC? Buy it with Coinbase" shows wallet USDC vs. the total to approve (bounty + fee + deposit) and pre-fills the shortfall. Coinbase Onramp delivers USDC to the customer's own connected wallet on Arbitrum, then they click Approve & post as usual. Taskuler never holds funds, and TaskulerMarket is unchanged. While the wallet is short, Approve & post stays disabled (ramps flag only).

  • /withdraw (builders): "Cash out USDC to your bank with Coinbase". This follows Coinbase's Offramp flow: hosted sell page, redirect back, read the transaction (to_address, sell_amount) from the status API, then the user sends the USDC from their wallet (within Coinbase's 30-minute window), and Coinbase pays the bank. Before sending, the app checks the asset is USDC, the network matches, and the amount isn't more than the wallet holds.

  • Screening gate on posting, funding, bidding and Market withdraw (DECIDED 2026-11-10). VPN/proxy/Tor is blocked (VH2; browsing stays open). Chainalysis runs on top of OFAC (BS2). Syria stays on the default geo-block (counsel list): CU,IR,KP,SY plus UA: Crimea/Sevastopol/Donetsk/Luhansk. Once screening is live (COINBASE_RAMPS_MODE=live and VITE_SCREENING_ENABLED unset / auto), the escrow gate runs by default on every Approve & post, on Approve deposit & bid, and on Market Withdraw, unless it is explicitly disabled with VITE_SCREENING_ENABLED=false. Mock mode stays previewable (npm run dev:mock sets the flag to true). The overall Coinbase feature flag (VITE_COINBASE_RAMPS_ENABLED) stays off by default, so nothing Coinbase-related goes live without keys and explicit enablement. Coinbase buy/cash-out are always screened when the ramps UI is on, regardless of the escrow flag.

  • USDC shown as dollars everywhere amt() is used (Market, job detail, post, withdraw, history): "$100 (USDC)", "$12.50 (USDC)". Other tokens are unchanged.

  • Server (server/): Fetch-style handlers. The same code runs as a standalone Node server (npm run api) or inside npm run dev through a Vite plugin (mounted in live mode, when ramps or a screening preview is on, or when screening is auto, so the client can read the server mode).

    • GET /api/ramps/config, POST /api/ramps/screen (action: fund | buy | cashout | bid | withdraw)
    • POST /api/ramps/onramp/session uses CDP v2 Create Onramp Session (POST https://api.cdp.coinbase.com/platform/v2/onramp/sessions, purchaseCurrency=USDC, destinationNetwork=arbitrum, purchaseAmount, redirectUrl, clientIp, partnerUserRef) and returns session.onrampUrl.
    • POST /api/ramps/offramp/session uses the Session Token API (POST https://api.developer.coinbase.com/onramp/v1/token, addresses:[{address, blockchains:["arbitrum"]}], assets:["USDC"], clientIp), then builds https://pay.coinbase.com/v3/sell/input?sessionToken=…&partnerUserRef=…&redirectUrl=….
    • GET /api/ramps/offramp/status uses GET /onramp/v1/sell/user/{partnerUserRef}/transactions. Each ref is bound to the wallet that opened it.
    • Auth is a JWT from a CDP Secret API Key via @coinbase/cdp-sdk/auth generateJwt. The SDK is server-only and is not in the browser bundle.
    • Security follows Coinbase's security requirements: CORS allowlist (never *); live mode needs a fresh wallet signature (≤5 min) before a session is minted; screening runs again server-side before every session; clientIp comes from the socket or one explicitly trusted proxy header, never X-Forwarded-For.
  • Checks (server-side, fail closed: a check that's on but can't run refuses the action and leaves browsing open):

    1. OFAC SDN wallet addresses, parsed from OFAC's SDN.CSV (Digital Currency Address - … 0x…). Refreshed hourly; refuses if the last good refresh is over 2 hours old (0005, Nov 8, provisional). Live smoke test: 94 EVM addresses parsed, and a listed address is blocked.
    2. Chainalysis free sanctions API (GET https://public.chainalysis.com/api/v1/address/{address}, X-API-Key) — DECIDED (BS2, Nov 10).
    3. Sanctioned country/region block. Default CU,IR,KP,SY plus UA: Crimea/Sevastopol/Donetsk/Luhansk (DECIDED Nov 10; Syria stays on the counsel list). Country comes from a trusted CDN header (e.g. cf-ipcountry) or ipapi.is.
    4. VPN/proxy/Tor block (DECIDED, VH2, Nov 10): ipapi.is (is_vpn/is_proxy/is_tor; the free key allows 1,000 lookups a day) plus the Tor bulk exit list (free). Each check can still be turned off with SCREEN_*=false.

    UI copy makes no compliance claims. No W-9/W-8 collection. The tax notice is unchanged on Withdraw and Work history.

How to run mock mode

npm install
npm run dev:mock     # = VITE_COINBASE_RAMPS_ENABLED=true VITE_SCREENING_ENABLED=true vite ; ramps API in mock mode at /api/ramps/*
npm test             # vitest, 24 tests
npm run build        # tsc (app + server) + vite build

Connect any injected wallet. On Post job pick USDC, then Buy … with Coinbase. That opens /ramps/mock-coinbase, a clearly labelled stand-in, not Coinbase. Buy now (mock) credits a mock wallet balance and returns you to the form. On Withdraw, Withdraw (mock) the USDC row first (it lands in the mock wallet; this button is also screening-gated), then Cash out, then Cash out now (mock), then Send … to Coinbase (mock). The yellow Mock mode bar has a "Screening result" select for previewing the blocked states: sanctioned wallet, blocked region, VPN/proxy, Tor, and screening outage. Mock mode makes no network calls and needs no keys.

Real vs. stubbed

Part Status
Coinbase session calls, JWT auth, offramp URL and status parsing Real code, untested against Coinbase (no CDP account yet). Request shapes are covered by unit tests against the documented API.
Coinbase pages Mock in mock mode; live mode opens real pay.coinbase.com in a popup (Coinbase says the widget can't be iframed).
Wallet USDC balance / send Mock data source: an in-memory mock wallet. Indexer/live: ERC-20 balanceOf/transfer on native USDC (Arbitrum One 0xaf88…5831).
OFAC list Real (fetched and parsed in a live-mode smoke test).
Chainalysis, ipapi.is Real code, no keys yet, so live mode currently fails closed ("unavailable").
Mock screening toggles Honored only when COINBASE_RAMPS_MODE=mock.
Headless/guest Onramp (Apple Pay, POST /v2/onramp/orders) Not built; needs Coinbase approval first (see below).
Post-job form state Mock mode navigates away to the mock page, so the form resets; live mode uses a popup and keeps it.

Coinbase facts, checked against current docs on Nov 10, 2026

(a) Hosted guest checkout ending June 30, 2026: matches the date, but the docs still use future tense. Every Onramp page carries: "Will be deprecated on June 30, 2026: Guest Checkout (debit card, Apple Pay) via the Coinbase-hosted Onramp widget is being discontinued. Use the Headless Onramp API instead" (Onramp overview, Coinbase-hosted Onramp, FAQ). I found no page confirming that it actually ended. Assume it's gone: the hosted flow in this PR is for Coinbase account holders (card/bank linked to Coinbase, or balance). Offramp never had guest checkout: "A Coinbase account with linked bank details is required for Offramp" (FAQ).

(b) Guest card buyers need the Headless API, US-only, with app approval: confirmed, with details. "For Apple Pay or debit card flows, start with the Headless Onramp API — you get access immediately after your app is approved." Headless is "Card payment methods only · Up to $2.5K weekly for cards · US-only" (overview). "Available for US users with valid US phone numbers … not a VoIP phone number"; users' email and phone must be OTP-verified (phone re-verified every 60 days); "apply for access" via support.cdp.coinbase.com/onramp-onboarding (Headless Onramp). On the web it is Apple Pay in an iframe (Google Pay is Android only). It also needs domain allowlisting, domain-ownership verification, no other Apple Merchant ID on the domain, and acceptance of Coinbase's Guest Checkout Terms. A "debit card" here means a card inside Apple Pay or Google Pay, not a typed card form. Embedded orders, where Coinbase collects the phone, email and OTP, need separate account enablement. Sandbox works by prefixing partnerUserRef with sandbox-.

(c) Fees (claimed: ~2.5% card, 0.5% bank, 0% USDC if approved): partly matches.

  • Card and bank: the Onramp FAQ says "There is a 2.5% fee for credit card transactions, and 0.5% fee for ACH". It also lists a spread and network fees on top, and says fees "may differ for similar transactions" and are shown before confirming. Note: Payment methods says "Coinbase does not support credit cards in the US", so the 2.5% presumably applies to debit cards for US users. The docs don't say so explicitly.
  • 0% USDC: Coinbase's Nov 27, 2024 post Introducing Zero-Fee Onramping and Offramping for USDC says zero-fee USDC is offered "to select apps upon request … Our team will be in touch if your app qualifies" and "may not be available to all regions". Discrepancy: the current Onramp product page says "Buying and transferring USDC on Base is free. Contact us to get no-fee USDC". Nothing I found says zero-fee applies to USDC delivered on Arbitrum.
  • Offramp: no published percentage found. The status API returns a per-transaction coinbase_fee.

Also checked: USDC on Arbitrum isn't confirmed. The Layer 2 networks table lists USDC on "Ethereum / Base / Polygon / Solana / Optimism / Avalanche C-Chain", without Arbitrum (ETH, DAI and wBTC do list Arbitrum). The FAQ says Onramp supports whatever Coinbase.com supports and points to the Buy/Sell Options API. Once keys exist, call GET /onramp/v1/buy/options?country=US&subdivision=IL and the sell options before relying on RAMPS_NETWORK=arbitrum. If Arbitrum USDC isn't offered, the options are Base delivery plus a bridge, or deferring ramps.

Other docs facts used: session tokens are single-use and expire after 5 minutes; Offramp requires partnerUserRef and redirectUrl; redirect URLs must be on the Onramp & Offramp domain allowlist (otherwise "silently ignored"); new integrations start in trial mode until the onboarding form is approved (welcome).

What George would need to do (each needs his OK)

  1. Create a CDP account at portal.cdp.coinbase.com (verify email, 2FA) and a project.
  2. In API Keys, Secret API Key, create a key (a Secret key, not a Client key) and set CDP_API_KEY_ID and CDP_API_KEY_SECRET on the server only.
  3. In Payments, Onramp & Offramp, Domain Allowlist, add the app origin(s), e.g. https://app.taskuler.com. Set RAMPS_REDIRECT_BASE_URL and RAMPS_ALLOWED_ORIGINS to match. Optionally set a display name.
  4. Apply via Onramp onboarding for full access beyond trial limits. If guest card buyers are wanted, apply for Headless Onramp (US-only, Apple Pay on web, domain verification) as a separate follow-up PR. Ask about zero-fee USDC, specifically on Arbitrum.
  5. Free keys for screening: Chainalysis sanctions API (sign-up) as CHAINALYSIS_API_KEY; ipapi.is (free, 1,000/day) as IPAPI_IS_API_KEY. Alternatively, behind Cloudflare, set RAMPS_TRUSTED_IP_HEADER=cf-connecting-ip and RAMPS_TRUSTED_COUNTRY_HEADER=cf-ipcountry; ipapi.is is still needed for VPN/proxy, and the Tor list is free.
  6. Then set COINBASE_RAMPS_MODE=live and VITE_COINBASE_RAMPS_ENABLED=true, and run npm run api behind the same origin or set VITE_RAMPS_API_URL. Leave VITE_SCREENING_ENABLED unset so the escrow gate defaults ON in live; set it to false only to disable the gate.

Decided Nov 10 (removed from open questions)

  • VPN/proxy/Tor block is VH2 (browsing stays open). Chainalysis on top of OFAC is BS2. Both ship on (each still has a SCREEN_* kill switch).
  • Syria stays on the default geo-block (counsel list).
  • Once screening is live, it runs by default on every Approve & post (and on bidding and Market withdraw) unless explicitly disabled. Mock mode remains previewable. The Coinbase feature flag stays off by default.
  • Note: taskuler/docs 0005 (Nov 9) may still list VH2/BS2 as open options; this PR follows the Nov 10 decisions.

Open questions

  • Arbitrum USDC availability, and zero-fee eligibility on Arbitrum (see above).
  • Previews: /workspace/tw/previews/coinbase-*.png and web-cr2-sketch.png (on the agent box; regenerate coinbase shots with scripts/previews.py).
This reopens the work from [web #2](https://git.taskuler.com/taskuler/web/pulls/2) under Taskuler-bot so George can review it. Head: `feat/coinbase-ramps` @f596353 (merge of #3 @786e1f7 into the screening update @7c5ddd5). **Stacked on #3** (`feat/nov9-tax-notice-cr2-plan` @786e1f7, keeps `TaxNotice` and the CR2 plan/sketch aligned with contracts #5 @1f2e460 / #6 @c988b9c). George's request, relayed by Taskuler on Nov 10, 2026, 10:29 AM CT: "start the coinbase work". **PR only: don't merge, deploy, sign up for Coinbase/CDP, submit an app for approval, or spend.** ## What this adds (Coinbase UI off by default; live escrow screening on unless disabled) - **Funding (Post job, USDC):** "Need USDC? Buy it with Coinbase" shows wallet USDC vs. the total to approve (bounty + fee + deposit) and pre-fills the shortfall. Coinbase Onramp delivers USDC **to the customer's own connected wallet on Arbitrum**, then they click *Approve & post* as usual. Taskuler never holds funds, and `TaskulerMarket` is unchanged. While the wallet is short, *Approve & post* stays disabled (ramps flag only). - **/withdraw (builders):** "Cash out USDC to your bank with Coinbase". This follows Coinbase's Offramp flow: hosted sell page, redirect back, read the transaction (`to_address`, `sell_amount`) from the status API, then the user sends the USDC from their wallet (within Coinbase's 30-minute window), and Coinbase pays the bank. Before sending, the app checks the asset is USDC, the network matches, and the amount isn't more than the wallet holds. - **Screening gate on posting, funding, bidding and Market withdraw (DECIDED 2026-11-10).** VPN/proxy/Tor is blocked (VH2; browsing stays open). Chainalysis runs on top of OFAC (BS2). Syria stays on the default geo-block (counsel list): `CU,IR,KP,SY` plus `UA: Crimea/Sevastopol/Donetsk/Luhansk`. Once screening is live (`COINBASE_RAMPS_MODE=live` and `VITE_SCREENING_ENABLED` unset / `auto`), the escrow gate runs by default on every *Approve & post*, on *Approve deposit & bid*, and on Market *Withdraw*, unless it is explicitly disabled with `VITE_SCREENING_ENABLED=false`. Mock mode stays previewable (`npm run dev:mock` sets the flag to `true`). The overall Coinbase feature flag (`VITE_COINBASE_RAMPS_ENABLED`) stays **off by default**, so nothing Coinbase-related goes live without keys and explicit enablement. Coinbase buy/cash-out are always screened when the ramps UI is on, regardless of the escrow flag. - **USDC shown as dollars** everywhere `amt()` is used (Market, job detail, post, withdraw, history): "$100 (USDC)", "$12.50 (USDC)". Other tokens are unchanged. - **Server (`server/`):** Fetch-style handlers. The same code runs as a standalone Node server (`npm run api`) or inside `npm run dev` through a Vite plugin (mounted in live mode, when ramps or a screening preview is on, or when screening is `auto`, so the client can read the server mode). - `GET /api/ramps/config`, `POST /api/ramps/screen` (`action`: `fund` | `buy` | `cashout` | `bid` | `withdraw`) - `POST /api/ramps/onramp/session` uses CDP **v2 Create Onramp Session** (`POST https://api.cdp.coinbase.com/platform/v2/onramp/sessions`, `purchaseCurrency=USDC`, `destinationNetwork=arbitrum`, `purchaseAmount`, `redirectUrl`, `clientIp`, `partnerUserRef`) and returns `session.onrampUrl`. - `POST /api/ramps/offramp/session` uses the **Session Token API** (`POST https://api.developer.coinbase.com/onramp/v1/token`, `addresses:[{address, blockchains:["arbitrum"]}]`, `assets:["USDC"]`, `clientIp`), then builds `https://pay.coinbase.com/v3/sell/input?sessionToken=…&partnerUserRef=…&redirectUrl=…`. - `GET /api/ramps/offramp/status` uses `GET /onramp/v1/sell/user/{partnerUserRef}/transactions`. Each ref is bound to the wallet that opened it. - Auth is a JWT from a **CDP Secret API Key** via `@coinbase/cdp-sdk/auth` `generateJwt`. The SDK is server-only and is not in the browser bundle. - Security follows Coinbase's [security requirements](https://docs.cdp.coinbase.com/onramp/security-requirements): CORS allowlist (never `*`); live mode needs a fresh wallet signature (≤5 min) before a session is minted; screening runs again server-side before every session; `clientIp` comes from the socket or one explicitly trusted proxy header, never `X-Forwarded-For`. - **Checks** (server-side, **fail closed**: a check that's on but can't run refuses the action and leaves browsing open): 1. OFAC SDN wallet addresses, parsed from OFAC's `SDN.CSV` (`Digital Currency Address - … 0x…`). Refreshed hourly; refuses if the last good refresh is over 2 hours old (0005, Nov 8, provisional). Live smoke test: 94 EVM addresses parsed, and a listed address is blocked. 2. Chainalysis free sanctions API (`GET https://public.chainalysis.com/api/v1/address/{address}`, `X-API-Key`) — **DECIDED** (BS2, Nov 10). 3. Sanctioned country/region block. Default `CU,IR,KP,SY` plus `UA: Crimea/Sevastopol/Donetsk/Luhansk` (**DECIDED** Nov 10; Syria stays on the counsel list). Country comes from a trusted CDN header (e.g. `cf-ipcountry`) or ipapi.is. 4. VPN/proxy/Tor block (**DECIDED**, VH2, Nov 10): ipapi.is (`is_vpn`/`is_proxy`/`is_tor`; the free key allows 1,000 lookups a day) plus the Tor bulk exit list (free). Each check can still be turned off with `SCREEN_*=false`. UI copy makes no compliance claims. No W-9/W-8 collection. The tax notice is unchanged on Withdraw and Work history. ## How to run mock mode ```bash npm install npm run dev:mock # = VITE_COINBASE_RAMPS_ENABLED=true VITE_SCREENING_ENABLED=true vite ; ramps API in mock mode at /api/ramps/* npm test # vitest, 24 tests npm run build # tsc (app + server) + vite build ``` Connect any injected wallet. On **Post job** pick USDC, then *Buy … with Coinbase*. That opens `/ramps/mock-coinbase`, a clearly labelled stand-in, not Coinbase. *Buy now (mock)* credits a mock wallet balance and returns you to the form. On **Withdraw**, *Withdraw (mock)* the USDC row first (it lands in the mock wallet; this button is also screening-gated), then *Cash out*, then *Cash out now (mock)*, then *Send … to Coinbase (mock)*. The yellow **Mock mode** bar has a "Screening result" select for previewing the blocked states: sanctioned wallet, blocked region, VPN/proxy, Tor, and screening outage. Mock mode makes no network calls and needs no keys. ## Real vs. stubbed | Part | Status | | :- | :- | | Coinbase session calls, JWT auth, offramp URL and status parsing | **Real code, untested against Coinbase** (no CDP account yet). Request shapes are covered by unit tests against the documented API. | | Coinbase pages | **Mock** in mock mode; live mode opens real `pay.coinbase.com` in a popup (Coinbase says the widget can't be iframed). | | Wallet USDC balance / send | Mock data source: an in-memory mock wallet. Indexer/live: ERC-20 `balanceOf`/`transfer` on native USDC (Arbitrum One `0xaf88…5831`). | | OFAC list | **Real** (fetched and parsed in a live-mode smoke test). | | Chainalysis, ipapi.is | Real code, **no keys yet**, so live mode currently fails closed ("unavailable"). | | Mock screening toggles | Honored **only** when `COINBASE_RAMPS_MODE=mock`. | | Headless/guest Onramp (Apple Pay, `POST /v2/onramp/orders`) | **Not built**; needs Coinbase approval first (see below). | | Post-job form state | Mock mode navigates away to the mock page, so the form resets; live mode uses a popup and keeps it. | ## Coinbase facts, checked against current docs on Nov 10, 2026 **(a) Hosted guest checkout ending June 30, 2026: matches the date, but the docs still use future tense.** Every Onramp page carries: "**Will be deprecated on June 30, 2026:** Guest Checkout (debit card, Apple Pay) via the Coinbase-hosted Onramp widget is being discontinued. Use the Headless Onramp API instead" ([Onramp overview](https://docs.cdp.coinbase.com/onramp/onramp-overview), [Coinbase-hosted Onramp](https://docs.cdp.coinbase.com/onramp/coinbase-hosted-onramp/overview), [FAQ](https://docs.cdp.coinbase.com/onramp/additional-resources/faq)). I found no page confirming that it actually ended. Assume it's gone: the hosted flow in this PR is for **Coinbase account holders** (card/bank linked to Coinbase, or balance). Offramp never had guest checkout: "A Coinbase account with linked bank details is required for Offramp" ([FAQ](https://docs.cdp.coinbase.com/onramp/additional-resources/faq)). **(b) Guest card buyers need the Headless API, US-only, with app approval: confirmed, with details.** "For Apple Pay or debit card flows, start with the Headless Onramp API — you get access immediately after your app is approved." Headless is "Card payment methods only · Up to $2.5K weekly for cards · US-only" ([overview](https://docs.cdp.coinbase.com/onramp/onramp-overview)). "Available for US users with valid US phone numbers … not a VoIP phone number"; users' email and phone must be OTP-verified (phone re-verified every 60 days); "apply for access" via [support.cdp.coinbase.com/onramp-onboarding](https://support.cdp.coinbase.com/onramp-onboarding) ([Headless Onramp](https://docs.cdp.coinbase.com/onramp/headless-onramp/overview)). On the **web it is Apple Pay in an iframe** (Google Pay is Android only). It also needs domain allowlisting, domain-ownership verification, no other Apple Merchant ID on the domain, and acceptance of Coinbase's Guest Checkout Terms. A "debit card" here means a card inside Apple Pay or Google Pay, not a typed card form. *Embedded orders*, where Coinbase collects the phone, email and OTP, need separate account enablement. Sandbox works by prefixing `partnerUserRef` with `sandbox-`. **(c) Fees (claimed: ~2.5% card, 0.5% bank, 0% USDC if approved): partly matches.** - Card and bank: the [Onramp FAQ](https://docs.cdp.coinbase.com/onramp/additional-resources/faq) says "There is a 2.5% fee for **credit card** transactions, and 0.5% fee for ACH". It also lists a **spread** and **network fees** on top, and says fees "may differ for similar transactions" and are shown before confirming. Note: [Payment methods](https://docs.cdp.coinbase.com/onramp/additional-resources/payment-methods) says "Coinbase does not support credit cards in the US", so the 2.5% presumably applies to debit cards for US users. The docs don't say so explicitly. - 0% USDC: Coinbase's Nov 27, 2024 post [Introducing Zero-Fee Onramping and Offramping for USDC](https://www.coinbase.com/developer-platform/discover/launches/zero-fee-usdc) says zero-fee USDC is offered "to select apps upon request … Our team will be in touch if your app qualifies" and "may not be available to all regions". **Discrepancy:** the current [Onramp product page](https://www.coinbase.com/developer-platform/products/onramp) says "Buying and transferring USDC **on Base** is free. Contact us to get no-fee USDC". Nothing I found says zero-fee applies to USDC delivered on **Arbitrum**. - Offramp: no published percentage found. The status API returns a per-transaction `coinbase_fee`. **Also checked: USDC on Arbitrum isn't confirmed.** The [Layer 2 networks](https://docs.cdp.coinbase.com/onramp/additional-resources/layer-2-networks) table lists USDC on "Ethereum / Base / Polygon / Solana / Optimism / Avalanche C-Chain", **without Arbitrum** (ETH, DAI and wBTC do list Arbitrum). The FAQ says Onramp supports whatever Coinbase.com supports and points to the Buy/Sell Options API. Once keys exist, call `GET /onramp/v1/buy/options?country=US&subdivision=IL` and the sell options before relying on `RAMPS_NETWORK=arbitrum`. If Arbitrum USDC isn't offered, the options are Base delivery plus a bridge, or deferring ramps. Other docs facts used: session tokens are single-use and expire after 5 minutes; Offramp requires `partnerUserRef` and `redirectUrl`; redirect URLs must be on the Onramp & Offramp **domain allowlist** (otherwise "silently ignored"); new integrations start in **trial mode** until the onboarding form is approved ([welcome](https://docs.cdp.coinbase.com/onramp/introduction/welcome)). ## What George would need to do (each needs his OK) 1. Create a CDP account at [portal.cdp.coinbase.com](https://portal.cdp.coinbase.com) (verify email, 2FA) and a project. 2. In **API Keys, Secret API Key**, create a key (a **Secret** key, not a Client key) and set `CDP_API_KEY_ID` and `CDP_API_KEY_SECRET` on the server only. 3. In **Payments, Onramp & Offramp, Domain Allowlist**, add the app origin(s), e.g. `https://app.taskuler.com`. Set `RAMPS_REDIRECT_BASE_URL` and `RAMPS_ALLOWED_ORIGINS` to match. Optionally set a display name. 4. Apply via [Onramp onboarding](https://support.cdp.coinbase.com/onramp-onboarding) for full access beyond trial limits. If guest card buyers are wanted, apply for Headless Onramp (US-only, Apple Pay on web, domain verification) as a separate follow-up PR. Ask about zero-fee USDC, specifically on Arbitrum. 5. Free keys for screening: Chainalysis sanctions API ([sign-up](https://www.chainalysis.com/free-cryptocurrency-sanctions-screening-tools/)) as `CHAINALYSIS_API_KEY`; ipapi.is (free, 1,000/day) as `IPAPI_IS_API_KEY`. Alternatively, behind Cloudflare, set `RAMPS_TRUSTED_IP_HEADER=cf-connecting-ip` and `RAMPS_TRUSTED_COUNTRY_HEADER=cf-ipcountry`; ipapi.is is still needed for VPN/proxy, and the Tor list is free. 6. Then set `COINBASE_RAMPS_MODE=live` and `VITE_COINBASE_RAMPS_ENABLED=true`, and run `npm run api` behind the same origin or set `VITE_RAMPS_API_URL`. Leave `VITE_SCREENING_ENABLED` unset so the escrow gate defaults ON in live; set it to `false` only to disable the gate. ## Decided Nov 10 (removed from open questions) - VPN/proxy/Tor block is VH2 (browsing stays open). Chainalysis on top of OFAC is BS2. Both ship on (each still has a `SCREEN_*` kill switch). - Syria stays on the default geo-block (counsel list). - Once screening is live, it runs by default on every *Approve & post* (and on bidding and Market withdraw) unless explicitly disabled. Mock mode remains previewable. The Coinbase feature flag stays off by default. - Note: taskuler/docs 0005 (Nov 9) may still list VH2/BS2 as open options; this PR follows the Nov 10 decisions. ## Open questions - Arbitrum USDC availability, and zero-fee eligibility on Arbitrum (see above). - Previews: `/workspace/tw/previews/coinbase-*.png` and `web-cr2-sketch.png` (on the agent box; regenerate coinbase shots with `scripts/previews.py`).
- Funding: buy USDC with a Coinbase account, delivered to the customer's own wallet on Arbitrum, then Approve & post as usual. TaskulerMarket unchanged.
- /withdraw: cash out wallet USDC to a bank via Coinbase Offramp (session -> redirect -> status -> wallet send).
- server/: Fetch-style handlers (Node server + Vite dev plugin). CDP JWT via @coinbase/cdp-sdk/auth; v2 onramp sessions, v1 token for offramp.
- Screening (fail closed): OFAC SDN addresses (hourly, 2h max age), Chainalysis free API, country/region block, VPN/proxy/Tor block. Mock toggles.
- Wallet signature + CORS allowlist on session endpoints; clientIp never from X-Forwarded-For.
- .env.example placeholders only. vitest suite (19 tests). Preview script.
Resolved Withdraw.tsx by keeping Coinbase cash-out and adding Credited.reason labels.
Build and tests stay green (npm run build, 19 tests). No force-push.
Once COINBASE_RAMPS_MODE is live, the escrow screening gate applies to
post, bid and Market withdraw unless VITE_SCREENING_ENABLED=false.
Mock mode stays previewable with the flag set to true. The Coinbase
feature flag stays off by default. VPN/proxy/Tor (VH2) and Chainalysis
on top of OFAC (BS2) are decided; Syria stays on the geo-block default.
Bring in the CR2 plan and sketch updates for contracts #5 @1f2e460
and #6 @c988b9c (ruling 0 pays a 50% recommendation; no Safe lapse
duty; ERC-20 filer bears the Kleros prepay).
george approved these changes 2026-11-11 03:38:56 +00:00
Taskuler-bot changed target branch from feat/nov9-tax-notice-cr2-plan to feat/phase1-scaffold 2026-11-11 03:41:08 +00:00
Taskuler-bot merged commit ac0bf29122 into feat/phase1-scaffold 2026-11-11 03:41:52 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
taskuler/web!4
No description provided.