Foundations · Wallets & Security

Signing Transactions

Signing uses a private key to authorise a transaction or message. The signature is the consent, so a malicious request that gets signed can hand over assets without the seed phrase ever being revealed.

  • Intermediate
  • 5 min read
  • Updated

Why it matters

A private key is never typed in or sent anywhere in normal use. What leaves the wallet is a signature: proof that the holder of the key approved one specific piece of data. On a blockchain, a valid signature is consent. Nothing else is checked.

Most people know that a seed phrase must stay secret. Fewer realise that a thief does not need it. A single signature on the wrong request can give away assets while every secret stays exactly where it was.

How it works

From request to result
  1. RequestA wallet action or a website asks for a signature.
  2. PromptThe wallet shows what it can decode of the request.
  3. DecisionThe holder approves or rejects.
  4. SignatureThe private key signs. The key is not revealed.
  5. ExecutionThe network carries out exactly what was signed.
The decision step is the only point of control. Everything after it is automatic.

When a wallet signs, it combines the private key with the exact contents of a request and produces a signature. Anyone can check that signature against the public key. Changing a single character of the request makes the signature invalid, so a signature cannot be reused for a different transaction.

The network then does precisely what the signed data says. It has no idea what the website’s button said, what the holder believed or what was promised.

In plain words

Signing is like signing a paper contract that takes effect the instant the pen lifts, with no court to hear that the page was misread. The salesperson’s description of the contract counts for nothing. Only the text above the signature counts.

What you may be asked to sign

Four things a wallet may ask you to sign
TransferSend coins or tokens to an address, now.
Contract callRun a function of a smart contract, such as a swap.
ApprovalLet a contract spend a token later, up to a limit.
MessageSign data off the chain: a login, or an order or permit that someone can use later.
The first two act immediately. The last two create permissions that can be used afterwards.

A transaction changes the blockchain and costs a network fee. It may be a plain transfer or a call to a smart contract.

A message is data signed off the chain. It costs nothing and nothing visible happens afterwards, which makes it feel harmless. Many messages are harmless, such as a sign-in that proves control of an address. Others are instructions in their own right: an order on a marketplace, or a permit that grants a token approval. Whoever receives such a signed message can submit it to the blockchain later.

Connecting a wallet to a site is a separate step from both. Connecting shares the address and lets the site send requests. It gives the site no power to move anything.

Reading a request

Reading a signature request

NORMAL

The request matches the action you started.

  • You opened the site and chose the action
  • The wallet shows readable details
  • Amounts and addresses are the ones you expect

RED FLAG

The request does not match the story.

  • A prompt you did not start
  • An approval for all of a token when the page spoke of a claim or a login
  • Unreadable data and pressure to hurry
  • Repeated prompts after you reject
What the prompt shows What to understand
Send an amount to an address A transfer of that amount, final once confirmed
Approve or “set approval for all” with a spender Standing permission for that spender over a token or a whole collection
A structured message with named fields Readable data. Fields such as spender, amount and deadline describe a permission
A long string of characters The wallet could not decode it. Approving is blind signing

Some wallets simulate a transaction and preview the expected changes in balances. A preview is a useful extra check. It is produced by software and can be incomplete.

Going deeper

Hardware wallets. A hardware wallet moves the signing step onto a separate device. That protects the key from malware. It does not change what a signature means: the device signs whatever its owner confirms.

Why sites ask for signatures at all. Decentralised applications have no accounts or passwords. Every action a user takes, from a swap to a vote, is authorised by a signature. Requests are therefore normal, and attackers rely on that familiarity.

Rejecting is free. Declining a request costs nothing and has no effect on the wallet. A site that responds to a rejection by sending the same prompt again and again is showing a warning sign.

Limits of the display. What a wallet can show depends on whether it can decode the contract. New or obscure contracts are often shown as raw data.

A hypothetical signature that cost no feeHypothetical illustration

Kai follows a link to a site offering early access to a new project. The page says: “Sign to verify you are human. No fee.”

His wallet opens a message prompt, not a transaction. It lists several fields, among them a spender address, a value that is an enormous number and a deadline several months away. Kai sees that no fee is charged, assumes it is a login and signs.

Nothing appears to happen. An hour later, a transaction that Kai did not send moves all of one token out of his wallet. The message was a permit: an approval in the form of a signature. The site’s operator submitted it to the blockchain and then used the permission.

Kai’s seed phrase was never typed, shown or stolen. The wallet did what it was built to do with a signed request.

What it does NOT mean

  • A signature is not a login. Sometimes it only proves control of an address. Sometimes it authorises a transfer or a permission.
  • “No fee” does not mean “no risk”. Some of the most damaging requests are free messages.
  • Connecting a wallet is not signing. Connection alone moves nothing. The requests that follow are what matter.
  • A signature cannot be withdrawn. A signed transaction that confirms is final. A signed permission can stay valid until it expires, is used or is cancelled.
  • Keeping the seed phrase secret is not enough. A signed malicious request can grant control of assets while the phrase stays safe.

Common mistakes

  1. Approving by habit. After a hundred routine prompts, the dangerous one looks the same.
  2. Trusting the website’s wording over the wallet’s. The page says “claim”. The wallet says “approve”. The wallet is describing what will be signed.
  3. Treating messages as harmless. Off-chain signatures can carry permits and orders.
  4. Signing what cannot be read. Blind signing replaces understanding with hope.
  5. Giving in to a countdown. Urgency is added to stop people reading.

Risks and limitations

  • Wallet prompts are improving and are still imperfect. Malicious requests are designed to look routine.
  • A careful reader can still be deceived by a contract that behaves differently from its description.
  • Signature formats and prompts differ between chains and wallets, so habits learned on one may not carry over.
  • Losses from signed requests are generally permanent. See fake airdrops and wallet drainers for how this is exploited.

Key takeaway

A signature is the holder’s consent, and the network executes exactly what was signed. Reading the wallet prompt, not the website, is the only check, because a malicious signature can give away assets without the seed phrase being revealed.

Sources and further reading

  • Mastering Ethereum, Andreas M. Antonopoulos and Gavin Wood (2018). Chapters on transactions, digital signatures and smart contracts
  • Mastering Bitcoin, Andreas M. Antonopoulos. Chapters on transactions and digital signatures
  • Transactions (opens in a new tab), ethereum.org. A transaction must be signed with the sender's private key, which proves it came from the sender