Skip to content

wallet.evm.sign_transfer: send USDC on chain, paying gas from the wallet's own ETH (0.4.3) - #54

Merged
TeoSlayer merged 1 commit into
mainfrom
evm-sign-transfer
Oct 15, 2026
Merged

TeoSlayer merged 1 commit into
mainfrom
evm-sign-transfer

Conversation

@TeoSlayer

Copy link
Copy Markdown
Contributor

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}:

  • It signs a plain ERC-20 transfer(to, amount) of the wallet's own USDC token as an EIP-1559 transaction. Gas comes from the wallet's own ETH.
  • The wallet never dials the chain: the host fills in nonce, gas and fees, then broadcasts the raw transaction.
  • It is counted against the same rolling spend cap as pay and satisfy.
  • It refuses a missing recipient, the wallet's own address, a zero amount, gas over 200,000, and fees over 100 gwei or a priority fee above the max fee, so a caller can't burn the wallet's ETH.

pkg/evm/tx.go holds the EIP-1559 transaction: RLP, the signing hash, and yParity from the signer's V. TestTx1559MatchesReference checks it 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/

(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

…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

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.67677% with 32 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/walletipc/dispatcher_evm.go 7.40% 24 Missing and 1 partial ⚠️
pkg/evm/tx.go 88.09% 3 Missing and 2 partials ⚠️
pkg/wallet/sendevm.go 93.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@TeoSlayer
TeoSlayer merged commit 4895355 into main Oct 15, 2026
3 checks passed
@TeoSlayer
TeoSlayer deleted the evm-sign-transfer branch October 15, 2026 22:43
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.

1 participant