feat(agent): OWS-secured x402 USDC deposit agent for Arbitrum One#296
Merged
Conversation
Release: Arbitrum One x402 deposits via CDP (checksummed v2 payload)
Standalone tool (outside the yarn workspace) that funds a PolyPay multisig with USDC on Arbitrum One via the gasless x402 flow. Signs the EIP-3009 authorization inside an OWS policy-gated vault, so the agent process only ever holds a scoped token — never the private key. - src/: discover -> sign (via OWS subprocess) -> submit x402 deposit - policy/: executable policy restricting signing to a USDC TransferWith- Authorization, to one multisig, capped, on Arbitrum One (eip155:42161) - test/policy-gate.mjs: proves the gate (allows correct, denies others) - setup.sh + README: provisioning runbook Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A standalone agent (
usdc-deposit-agent/, outside the yarn workspace) that funds a PolyPay multisig with USDC on Arbitrum One via the gasless x402 deposit flow — with the signing key kept entirely out of the agent process.Verified end-to-end with a live 1 USDC deposit: tx
0x488ac7…3f451.How it works
GET /api/x402/deposit/:multisig→ 402 with payment requirements.TransferWithAuthorizationtyped data and signs it inside an OWS policy-gated vault (Open Wallet Standard). The agent only ever holds a scopedows_key_token, never the private key.X-PAYMENTPOST withnetwork: "arbitrum"; PolyPay settles via the CDP facilitator (gasless).Why this design
awal/agentic wallet — it supports Base/Polygon/Solana only, not Arbitrum.PRIVATE_KEYin.env— that key would sit in the agent's heap, reachable by any tool it runs and one prompt-injection away from signing an attacker's transfer.Security guarantee (enforced by
policy/check-deposit.mjs)Even if the agent is fully compromised, the scoped token can only produce an EIP-3009 USDC
TransferWithAuthorization, on Arbitrum One, to one multisig, ≤ a configured cap, until it expires. It cannot drain the wallet or redirect funds. Proven bynpm run test:policy(allows the correct deposit; denies wrong recipient / over-cap / wrong chain).CI / deploy impact
None. The folder lives at repo root, outside
packages/**(so no path-filtered workflow fires) and is not a yarn workspace member (workspaces: packages/*), soyarn install/build/formatdon't touch it. Purely additive tooling.Not committed (gitignored, reconstructed via
npm install+./setup.sh).env(holds the live scoped token),node_modules/, and the renderedpolicy/*.policy.json(holds the multisig + cap).Test plan
npm run typecheck— passes.npm run test:policy— isolated temp vault; correct deposit signs, wrong recipient / over-cap / wrong-chain denied.🤖 Generated with Claude Code