Skip to content

feat: stealth payments via Umbra on Base mainnet#251

Open
Huygon764 wants to merge 5 commits into
developfrom
feat/stealth-payments-umbra
Open

feat: stealth payments via Umbra on Base mainnet#251
Huygon764 wants to merge 5 commits into
developfrom
feat/stealth-payments-umbra

Conversation

@Huygon764

Copy link
Copy Markdown
Contributor

No description provided.

@Huygon764 Huygon764 force-pushed the develop branch 2 times, most recently from 76deaeb to 7f59eb5 Compare May 18, 2026 09:30
gianalarcon and others added 2 commits May 20, 2026 09:51
* docs: add llms.txt intro page for AI agents (#256)

Add a GitBook-friendly page introducing PolyPay's llms.txt support so
non-technical readers can discover the feature and link AI agents to
the live playbook.

- New page docs/llms-txt-for-agents.md covering what llms.txt is, the
  live endpoint, the five integration flows it documents, two ways to
  wire an agent up, and compatibility notes.
- Add the page to docs/SUMMARY.md between x402 and Architecture.
- Fix stale api.polypay.xyz references in docs/x402-deposits.md to the
  real api.polypay.pro host.

* feat(x402): add Coinbase CDP bazaar deposit route for agentic.market listing (#260)

Adds a second x402 deposit endpoint /x402/bazaar/deposit/:multisig that
routes through Coinbase CDP facilitator instead of PayAI, so the resource
gets indexed in CDP discovery and surfaces on agentic.market.

The default /x402/deposit/:multisig path keeps using PayAI (better rate
limits, simpler auth) — no UI change. CDP path activates implicitly when
CDP_API_KEY_ID is set; otherwise it returns a clear config error.

CDP requires Ed25519 JWT signed per-request (2-min TTL), so the service
now lazy-imports @coinbase/x402 createAuthHeader to produce the
Authorization header. Payment requirements for the CDP path also embed a
declareDiscoveryExtension-shaped extensions.bazaar block (strict JSON
Schema), without which CDP would settle but not index.

Includes scripts/bazaar-bootstrap.ts to produce the first real settlement
that triggers CDP indexing — bootstrap must run against a deployed
backend (the resource URL ends up in the catalog).

Refs #259

---------

Co-authored-by: BoHsuu <[email protected]>
…272)

Two independent reasons the deposit endpoint was never cataloged in the
CDP x402 Bazaar, both confirmed against @x402/extensions/bazaar source:

- processDeposit threw 400 when X-PAYMENT was missing. The CDP Bazaar
  crawls the endpoint with the bazaar-extension input (no payment) and
  only indexes resources that answer 402. Now returns 402 + the
  PaymentRequired body (canonical x402 unpaid response).

- extractDiscoveryInfo reads the bazaar extension from
  paymentPayload.extensions["bazaar"] for v2; the CDP settle payload
  sent extensions:{}. Attach the discovery extension (and resource
  description/mimeType) to the v2 payload so settlement catalogs it.

Also add routeTemplate so the multisig-address path segment normalizes
to /:multisigAddress, and align schema.required with the SDK
(createBodyDiscoveryExtension) so info validates under Ajv 2020.
Huygon764 and others added 3 commits May 21, 2026 10:23
* chore(backend): horizen testnet wipe script + e2e fixes after chainId require

- Add scripts/wipe-horizen-testnet.ts (yarn wipe:horizen-testnet) to drop
  all chainId 2651420 accounts + their transactions/votes/signers/contacts
  /reserved-nonces. Used after the Horizen testnet zkVerify address swap
  to clear stale state on staging. Safety: refuses when APP_NETWORK=mainnet,
  unlinks batch_items.contactId before cascading account deletes,
  --dry-run prints counts without touching data.

- Pass chainId in e2e + staging-e2e test utilities for reserveNonce and
  createTransaction calls. The endpoints started requiring chainId after
  the (address, chainId) account key rollout; the tests still sent the
  legacy shape and got 400.

- stagingExecuteTransaction: fall back to polling GET /transactions/:txId
  when the initial POST hangs up (socket reset by edge / proxy idle
  timeout) instead of bubbling a cryptic ECONNRESET. Server already
  persists txHash right after on-chain submission so the poll is safe.

* chore(docker): include backend scripts/ in runner image for Cloud Run Jobs
Send ETH privately from a PolyPay multisig on Base mainnet through the
Umbra stealth payment protocol. Recipients register their meta-address
once on app.umbra.cash; PolyPay observes the StealthKeyRegistry on
chain to know who can receive. Each send derives a one-time stealth
address client-side and routes through UmbraBatchSend so the on-chain
Announcement event lets the recipient withdraw later via app.umbra.cash.

Sender flow
- StealthToggle in Transfer: gates by chain (Base mainnet), token (ETH
  only) and recipient registration. Shows the live umbra.toll() so
  cosigners see the total cost before approving. Disables "Add to batch"
  when stealth is on — batch flow can't combine with UmbraBatchSend.
- Stealth payload (verbatim to/value/data) lands on the transactions row
  as stealthData. The executor submits it as-is and other voters use it
  to recompute the same txHash for their own ZK approval proof.
- Private badge + tooltip on the transaction row so cosigners understand
  the on-chain call routes through UmbraBatchSend rather than directly
  to the recipient.

Recipient
- No PolyPay backend involvement: app.umbra.cash handles registration.
- Sidebar CTA + ReceivePrivatelyModal: always visible on a Base-mainnet
  account context, switches between violet "Receive privately" and green
  "Private receive ready" depending on the wallet's registry status.
- When the connected wallet matches the recipient of an executed stealth
  tx, the tx row shows a green dot on the recipient pill and an Open
  Umbra button in the expanded detail.

Docs
- New docs/stealth-payments.md covering scope, flows, costs, and what
  PolyPay intentionally does not handle.
- Network support matrix in docs/zkverify-horizen-integration.md so
  per-chain feature differences live in one place.

Schema
- stealth_data TEXT column on transactions (migration
  20260521083753_add_stealth_data).
@Huygon764 Huygon764 force-pushed the feat/stealth-payments-umbra branch from 9ae7123 to d680272 Compare May 21, 2026 09:37
@Huygon764 Huygon764 marked this pull request as ready for review May 21, 2026 09:38
@Huygon764 Huygon764 force-pushed the develop branch 2 times, most recently from 19d0a8b to 00b4811 Compare May 25, 2026 07:09
@Huygon764 Huygon764 force-pushed the develop branch 2 times, most recently from e4415ee to a795dbd Compare June 10, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants