Repository navigation
wallet.evm.sign_transfer: send USDC on chain, paying gas from the wallet's own ETH (0.4.3) - #54
Merged
Merged
Conversation
…let's own ETH (0.4.3) The wallet signs a plain ERC-20 transfer of its own USDC token as an EIP-1559 transaction and returns the raw transaction for its host to broadcast: it never dials the chain, it signs nothing but a transfer of its token, and every transfer counts against the same rolling spend cap as Pay and satisfy. The host supplies the nonce, gas and fees; gas above 200,000 and fees above 100 gwei are refused, so a caller cannot burn the wallet's ETH. pkg/evm/tx.go is the EIP-1559 transaction (RLP, signing hash, yParity from the signer's V), checked byte for byte against eth-account 0.13.4: TX_REFERENCE=$(uv run -q --with eth-account==0.13.4 python tools/txref.py) go test ./pkg/evm/ Ported from hosted's research/tx.go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
Pilot Cloud's owner chose that each person pays their own withdrawal fee, so a hosted node's wallet must send USDC itself. Until now the wallet could only sign EIP-3009 authorizations, which someone else has to submit.
New method
wallet.evm.sign_transfer{to, amount, nonce, gas, max_fee_per_gas, max_priority_fee_per_gas, chain_id?}returns{raw_tx, hash, from, to, amount, chain_id}:transfer(to, amount)of the wallet's own USDC token as an EIP-1559 transaction. Gas comes from the wallet's own ETH.payandsatisfy.pkg/evm/tx.goholds the EIP-1559 transaction: RLP, the signing hash, and yParity from the signer's V.TestTx1559MatchesReferencechecks it byte for byte against eth-account 0.13.4:(passes locally). It was ported from hosted's
research/tx.go, which has the same check.The manifest exposes the method, and the version goes to 0.4.3. Caps are unchanged (10,000 USDC a day ceiling). Hosted nodes refuse this method to agents; only the owner's Wallet page reaches it, behind two-step verification.
🤖 Generated with Claude Code