Skip to content

Surface estimated gas/fee cost before pre-sign checks #636

Description

@szhygulin

Problem

When prepare_* tools return their CHECKS PERFORMED block, the user has no visibility into transaction cost until they review the tx on the Ledger device. The agent walks through 5–10 invariants (#1 abi-decode, #2 hash-recompute, #11 unlimited-spender, etc.) before the user can decide whether the cost is even acceptable. A user who was going to abort because gas spiked to $40 has now spent attention on every check first.

Proposal

Surface estimated cost at the top of every prepare_* response, ahead of CHECKS PERFORMED. Shape:

Estimated cost: ~$3.42 (0.0011 ETH gas, base fee 18 gwei, priority 1.5 gwei)

For non-EVM chains, the equivalent: BTC sat/vB × vsize, Solana lamports + priority fee, TRON energy/bandwidth burn or TRX.

Questions to resolve

  • Source for fiat conversion (Coingecko already wired in get_coin_price).
  • Whether to refuse / warn when estimated cost exceeds some fraction of the tx value (separate gate, possibly per-chain configurable).
  • Where this fits relative to the payloadFingerprint block — probably immediately before, since it's the first thing the user reads.

Scope

Cost preview only. Not a new gate, not a new refusal path. The agent already has a place to render this — we just need the MCP to compute and emit it consistently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions