Skip to main content
All CollectionsSecurityTransaction Validation
How to verify Safe{Wallet} transactions trustlessly on a hardware wallet
How to verify Safe{Wallet} transactions trustlessly on a hardware wallet
Safe avatar
Written by Safe
Updated today

You are a Safe Wallet user.

You created your transaction via Safe{Wallet}.

You are about to hit “sign” and confirm on your hardware wallet.

This is a guide on how to perform a complete check of the transaction on your hardware wallet.

For a basic guide on how to verify transaction data on e.g. Metamask or Rabby, refer to this guide.

If you can’t verify it, don’t sign it.

Step 1: Verify transaction data in Safe{Wallet}

Before you hit sign, from the Safe{Wallet} interface, get the following and verify that this is what you expect:

  • to - set to the recipient for Ether transfers, the ERC20 token contract for token transfers, or the smart contract to interact with for contract interactions.

  • value - usually 0 for contract interactions and > 0 for Ether transfers.

  • data (“Raw data”) - Use a call data decoder such as this one from Etherscan, this one from @rimeissner, or this one from @dethtools to actually check the entire call data.

  • call_type - Usually you should see a simple “call”. You should only see something else such as “create”, or “delegate_call” if you actually know what you are doing.

  • nonce - index of the next transaction you want to execute

Now you hit “sign” which sends the transaction data to your hardware wallet. (Depending on how you are connected, you first confirm via Rabby, Metamask, or the wallet you connected via WalletConnect.)

Step 2a: Verify hashed transaction data on hardware wallet

If your hardware wallet supports signing typed data via EIP712, skip to step 2b below.

  1. Get the safe-tx-hashes command line tool by Patrick Collins which builds on safe-tx-hashes-util from @pcaversaccio. Note that the tool requires a few pre-requisites to be installed on your computer.

  2. Use the offline mode via --offline to calculate:

    • Safe transaction hash

    • Domain hash

    • Message hash

  3. Ensure that the Safe transaction hash is the same like safeTxHash from above.

  4. Verify Domain and Message hash on your hardware wallet.

  5. ONLY when ALL of the above checks out, confirm on your hardware wallet.

Step 2b: Verify typed data on hardware wallet

Some of the newer hardware wallets from Trezor, Ledger, GridPlus, and others display typed structured data via EIP712, or support some form of clear signing. In that case you can directly verify the transaction data on your hardware wallet:

  1. to

    • Does this match to from step 1?

    • Is it set to an address you recognize?

  2. value

    • Does this match value from step 1?

    • Is it 0 for contract interactions and the correct amount for Ether transfers?

  3. data (“Raw data”)

    • Does this match data from step 1?

  4. operation

    • Is this set to 0? This means a simple call

    • 1 would mean delegatecall which is dangerous and you should check with a technical person.

  5. nonce

    • Does this match nonce from step 1?

    • Is this the index of the next transaction you want to execute?

  6. safeTxGas, baseGas

    • Are both 0 for your Safe with version 1.3.0 or higher? Otherwise this can be higher.

  7. baseGas, gasPrice

    • Are both 0?

  8. gasToken, refundReceiver

    • Are both 0x0000000000000000000000000000000000000000?

  9. ONLY when ALL of the above checks out, confirm on your wallet.

Attachment icon
Attachment icon
Did this answer your question?