feat: add CDP (Coinbase Developer Platform) MPC wallet support#58
Open
skingem1 wants to merge 1 commit intoBlockRunAI:mainfrom
Open
feat: add CDP (Coinbase Developer Platform) MPC wallet support#58skingem1 wants to merge 1 commit intoBlockRunAI:mainfrom
skingem1 wants to merge 1 commit intoBlockRunAI:mainfrom
Conversation
- Add WalletSigner interface abstraction (wallet-signer.ts)
Decouples x402 payment signing from key management strategy
- Add CdpWalletSigner (wallet-cdp.ts)
Uses @coinbase/coinbase-sdk for MPC wallet creation/loading
Signs EIP-712 typed data via CDP's signHash
Persists wallet to ~/.openclaw/blockrun/cdp/wallet.json
- Add PrivateKeyWalletSigner (wallet-pk.ts)
Wraps existing viem signTypedData — no behavior change
- Refactor x402.ts to use WalletSigner interface
createPaymentFetch() now accepts WalletSigner | `0x${string}`
Fully backward compatible — raw private key still works
- Refactor proxy.ts to accept optional walletSigner in ProxyOptions
Falls back to raw key if no signer provided
- Update index.ts to detect CDP credentials at startup
Env vars: BLOCKRUN_CDP_API_KEY_NAME + BLOCKRUN_CDP_PRIVATE_KEY
CDP takes precedence over raw key; graceful fallback on error
- Add CDP auth methods to auth.ts (cdpWalletAuth + cdpEnvAuth)
- Add docs/cdp-wallet.md
Build: ESM + DTS clean
Member
|
Thank you for your suggestion. let me think about it. |
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.
CDP Wallet Support for ClawRouter
Adds Coinbase Developer Platform (CDP) MPC wallets as an alternative to raw private keys for x402 payments.
Why?
Changes
New files
src/wallet-signer.ts—WalletSignerinterface (abstract signing layer)src/wallet-cdp.ts— CDP MPC wallet implementation using@coinbase/coinbase-sdksrc/wallet-pk.ts— Raw private key wrapper (satisfiesWalletSigner)docs/cdp-wallet.md— Full setup documentationUpdated files
src/x402.ts—createPaymentFetch()now acceptsWalletSigner |0x${string}``src/proxy.ts—ProxyOptionsaccepts optionalwalletSignersrc/index.ts— Auto-detects CDP env vars at startup, falls back to raw keysrc/auth.ts— NewcdpWalletAuth(wizard) +cdpEnvAuth(env vars) methodsUsage
Build