EXERCISE · WALLET SECURITY

MetaMask: disconnect, revoke, what should you check?

Go to the interactive exercise ↓

After this lesson: Separate connection, signature, permission and actual spending.

Choose your explanation

01 / BEGINNER

First, what is it?

A permission is a right granted to another party. With some tokens you can allow a program to spend an amount on your behalf. That right can exist before any spending occurs. Connecting a website to a wallet is yet another action.

Words to know

Connection
Linking a website with an account under the tool’s permissions.
Spender
The party or contract authorised to use a token.
Allowance limit
The maximum quantity allowed by that permission.

The idea to understand

Before signing, identify the exact action, network, token, spender, amount and duration where applicable. Apparent zero cost says nothing about the scope of the right granted.

SEE IT IN PRACTICE

Now, a concrete example

ERC-20 distinguishes approve, which grants a right, from transferFrom, which can use it. An exchange may request approval before a swap. Approving and swapping are therefore not synonyms.

YOUR TURN

Does “Sign” without a visible fee mean “no possible financial effect”?

Form an answer before opening the explanation. You can also discuss it aloud.

Compare with the explanation

No. Some messages authorise later operations. Their content and the protocol using the signature determine the effect.

READ · REASON · APPLY

4 situations to investigate

For each case: compare the documents, explain your reasoning, make a decision, then solve a variation. The correction explains its assumptions and limits. No timer.

Situations worked through · two answers each0 / 4

FICTIONAL DOCUMENTS · NO REAL TRANSACTION

Receive a gift… or approve spending?

In this made-up situation, a message directs you to cadeau.example to receive a bonus. You did not request anything. Yet the window asks for permission over your USDC.

Simulated request — no wallet
What you expected to do
Receive a gift
What is requested
Approve USDC spending
Spending limit
Unlimited
Immediate signing fee
€0

Compare the intended action (receive) with the requested right (spend). Explain why “no fee to sign” does not answer the risk question.

This text is not automatically marked or sent. It is kept only in this page’s memory and disappears when you leave or reload. Use fictional information only.
A hint for my decision

Receiving something does not normally require unlimited spending permission over your own tokens. Look at the action, not just the fee.

2. My decision

Which decision matches the information shown?
All documents, questions and worked solutions

Receive a gift… or approve spending?

In this made-up situation, a message directs you to cadeau.example to receive a bonus. You did not request anything. Yet the window asks for permission over your USDC.

Simulated request — no wallet
What you expected to do
Receive a gift
What is requested
Approve USDC spending
Spending limit
Unlimited
Immediate signing fee
€0

Which decision matches the information shown?

Compare the intended action (receive) with the requested right (spend). Explain why “no fee to sign” does not answer the risk question.

Reasoning: The promised action and requested permission do not match. Some mechanisms can later use a signed message to grant spending rights. Stop here. The domain and bonus are made up; USDC and the approval mechanism are real.

Zero fees do not prove that a signature has no effect.

Variation

Going further: an ERC-2612 permit was already used on-chain before its 10:05 deadline. It set an allowance of 100 tokens that remains unused. At 10:06, is that allowance automatically zero?

In ERC-2612, the contract checks the deadline when it receives the permit. If accepted, it changes the ERC-20 allowance. These two standards do not specify automatic expiry for that allowance. Other permission systems can have their own rules: do not generalise to all signatures.

Sign in to a forum

You intentionally opened forum.example, a site made up for this exercise. The message uses the real Sign-In with Ethereum format to sign in. You have not yet compared the account and network with your intention.

Simplified excerpt from a sign-in message
Requested domain
forum.example
Action
Sign in to the forum
Network
Ethereum
Expected account
Not yet compared
Message expiration
In 5 minutes (fictional)

What can you conclude at this point?

List what must match your intention: domain, action, account and network. Which item still needs checking here?

Reasoning: Sign-In with Ethereum is a documented format for authenticating with an Ethereum account. Domain, account, network and time information need to match the context. This exercise has not yet supplied all those checks, and guessing cannot replace them.

An unchecked detail is a missing detail.

Variation

A genuine SIWE sign-in message expires at 10:05. You used it at 10:03. Can you conclude that the website will automatically log you out at 10:05?

ERC-4361 defines an expiration after which the message is no longer valid for authentication. That alone does not prove when an already opened session will end. Check the service’s session management. This simplified message is not a real signing request.

You intended 25 USDC; the program asks for 250

You are preparing a fictional swap of 25 USDC, meaning 25 units of the token. You decided to limit approval to that quantity. Yet the next summary displays a different limit.

Simulated approval
Quantity to swap
25 USDC
Requested spending limit
250 USDC
Authorised program
Exercise swap contract
Swap already executed
No

Which reasoning is correct?

Calculate the ratio between 250 and 25. Distinguish “limit too high” from “funds already stolen”.

Reasoning: A 250 USDC limit authorises ten times the intended 25 USDC. This does not assert that theft has already occurred; it shows that the request exceeds your intention. Return to the permission setting and check the remaining context.

Read the field’s unit and scope, not just its number.

Variation

You reduce the limit to 25 USDC. The displayed contract name resembles the site’s name, but its address has not been verified. Is that enough to accept?

An ERC-20 allowance relates an owner, token and spender on a network. Fixing the amount does not fix the other elements. Use the intended service’s official information; a display name is not enough.

The approval matches: is the swap complete?

For this final fictional situation, the scenario states that the intended site, network and program have been checked. You want to approve exactly 25 USDC. The displayed request is an approval only.

What the summary says
Action
Approve spending
Quantity
25 USDC
Context
Matches in this scenario
Swap
Not requested yet

What does this match let you conclude?

Separate granting spending permission from executing the swap. Which action appears in the documents?

Reasoning: The request matches the stated intention without proving contract safety. Uniswap documents separate approval and swap steps, with details varying by flow. Here you are learning to recognise the stage, not to sign a real operation.

An approval is neither an executed swap nor a safety guarantee.

Variation

Explicit model: a finite allowance of 25 tokens decreases by the amount spent each time it is used. The contract successfully spends 10 tokens. No other changes occur. What allowance remains? This asks for the remaining permission, not the wallet balance.

25 − 10 = 15 tokens still allowed in this model. The wallet balance is a different, missing value. Disconnecting the site does not set this allowance to zero: revocation is separate. Some implementations handle unlimited allowances differently; that is not our case.

3 explanation levels

A useful companion: Crypto wallets: keys, custody and recovery

THE SHORT ANSWER

A wallet window can request a sign-in, permission to use your tokens or an operation. These are different actions. Start with documented examples, then use four made-up situations to compare your intention with what a request actually permits.

The questions that remain

Is a signature without gas risk-free?

No. The absence of an immediate fee says nothing about the rights granted by a message. Read what it authorises, not just what it costs.

Does a correct answer validate my wallet?

No. The exercise uses fictional situations and analyses no real wallet, site or contract. It teaches reading habits, not a security certification.

Sources and further reading

Page updated on
Documentation checked on · WhyTheBlockchain · Editorial approach