Stop blind signing.
Read the transaction on a second screen before you sign it.
A command-line tool for people who run agents and sign with a hardware wallet. The agent stages the transaction in the terminal. Your phone decodes the raw bytes on its own. You approve on the device when the two hashes match.
npm install -g csign
Open the verifier
agent csign stage tx --to 0x8617…070D --sig 'transferOwnership(address)' -- 0x5290…9EE7 staged 9c41d2a07b3e. Nothing signed. you csign sign 9c41d2a07b3e
raw fields, nothing else
- Call
- transferOwnership
- On contract
- 0x8617E340B3D01FA5F11F306F4090FD50E238070D
- newOwner
- 0x52908400098527886E0F7030069857D2E4169EE7
- Hash to match
- 40defafb76a02fa1cb679e5bbf3dfb2313fa31827830479b39839e0f6cf39964
Your phone reads the call
the same bytes
Your hardware wallet shows a hash
The same hash on both screens: what you read on the phone is what gets signed. Any difference: reject on the device.
Why
Let the agent prepare. Keep the signature.
The agent stages the transaction and never holds a key:
csignrefuses keys and seed phrases on the command line. What you approve is what your phone decoded, whatever the agent said it built.Skip the front end.
No site, no wallet connection, no browser extension. The transaction is built in the terminal and checked on the phone, so no web app sits between you and what you sign.
Read what the wallet cannot.
Safe batches, deployments, admin calls. The phone unpacks every call and shows every address in full, next to the hash the wallet shows.
How it works
Stage
csign stage tx …Run by the agent. Fixes every field: nonce, gas limit, fees. Simulates the transaction, signs nothing, prints an id.
Sign
csign sign <id>Run by you. The raw transaction appears as an animated QR code while the wallet waits with exactly the staged bytes.
Read
on the phoneThe verifier recomputes the hash with its own code and decodes the call and any batch inside it. A bundle carrying a label or description is refused.
Approve
on the deviceWhen the hashes match. The signed result is kept only if it equals the staged transaction field by field, then published.
Plain transactions, contract deployments, Safe owner signatures and Safe executions, on Ethereum, Base, BNB Chain, X Layer and GenLayer. For an agent, the whole brief is one file: AGENTS.md.
Threat model
Relied on
- The hardware wallet: its key, and what its own screen shows.
- The phone and the verifier page on it. The page computes the hash with code that shares nothing with the computer's.
- Your own eyes on two screens.
Not relied on
- The computer.
- The agent or person who prepared the transaction.
- csign itself, and anything it prints.
- Any app front end. None is in the path.
Why it holds
The wallet signs exactly the bytes whose hash it displays. The phone shows what those bytes do and what their hash is. If the two hashes match, what you read on the phone is what gets signed, whatever the computer did. To cheat, an attacker has to control the computer and the phone at once.
It always takes two
To get a bad transaction signed, an attacker needs the side that prepares it and the side that reads it, at the same moment. Then you still have to hold the button.
| If this is compromised | What happens | Also needed |
|---|---|---|
| The computer, the agent, csign or its npm package | The phone decodes what was really staged. The wrong call or address is there on its screen. | The phone |
| An app front end | Nothing. None is in the path. | Not applicable |
| The verifier's server or domain | A new version of the page shows both hashes and waits for you. Assume the worst, a swapped page: it still cannot change what the wallet signs. | The computer |
| The phone | It can show you a false reading. The wallet still signs only the transaction the computer staged. | The computer |
| A name lookup service | Argument names may be wrong, and each decode says where its names came from. The hash cannot change. | The computer and the phone |
The verifier keeps its own copy
- It is one file with no outside code. Your phone saves it on first use and runs that copy from then on, offline too.
- The copy is saved only if it matches its published hash. The hash is at the bottom of the page and in the repository, and npm run build reproduces it.
- A new version shows both hashes and waits until you accept it.
- Or host it yourself. It is a single HTML file.
It needs a wallet with its own screen that shows a hash. Signing on a Ledger has been run by hand; a Trezor goes through Foundry's cast and has not been run yet. The first load of the verifier on a phone trusts the server. The security model in the repository lists where it stops.
Install
# needs Node 20 or later and Foundry npm install -g csign # on the phone: add to the home screen, open only from that icon https://countersign.genlayer.foundation/verify/ # on a Ledger: Ethereum app, Settings, always show the transaction hash