Simulate and verify before you sign
Two layers: SwapChan simulates an EVM transaction online; blocktools decodes and checks any transaction offline against what you expect.
Two layers: SwapChan simulates an EVM transaction online; blocktools decodes and checks any transaction offline against what you expect.
Simulate on SwapChan. Open Simulate or have your agent call the MCP tool
simulate_swap: a dry run of a quote or raw tx showing balance changes, approvals and the revert reason. Before every signature,verify_txadds a guard and a plain-English summary for the human.Decode it with blocktools.
tx-decodereads one transaction on stdin (hex/base64 raw tx, PSBT, EVM RLP):tx-decode --text < signed.jsonCheck it against what you expect.
tx-verifychecks a transaction against an expected destination and maximum fee (example from recipes/goal-verify-and-offline.md):./blocktools run 'tx-verify --expect-to 1Q2TWHE3GMdB6BZKafqwxXtWAWgFt5Jvm3 --max-fee 10000 < /in/block170.hex'In that example the check correctly fails (
input_amounts_unknown): a raw transaction has no input amounts, so the fee is unknown. A PSBT fromtx-buildcarries them, so the check can pass. An optional policy file caps fees and destinations before signing.A human signs.
tx-signsigns ONE transaction after a human reads its summary and types a code on /dev/tty;tx-broadcastasks for a second code. On SwapChan your own wallet signs; SwapChan never holds keys.
Sources: blocktools recipes/goal-verify-and-offline.md, recipes/decode-a-transaction.md, docs/getting-started.md, man pages for tx-decode / tx-verify / tx-sign; SwapChan /simulate and the agent tool list.