every signed message starts here
A signature is not a login. It is an order that anybody can deliver, and the wallet only shows you the part it has decided you are able to read.
A friend called me at one in the morning with a sentence I have now heard in four different accents: I clicked sign, nothing happened, and then my wallet was empty.
No transaction from him. No approval in his history. Nothing to revoke on the usual dashboard, because the thing that took the tokens was not a transaction he sent — it was a message he signed. The attacker waited eighteen seconds, submitted that message to the token contract himself, and paid the gas. My friend’s entire balance was authorized by a prompt that said, roughly, “Sign this message to continue”.
I have written before about how a wallet holds no coins, only keys (what a crypto wallet actually is). This piece is about the moment after that: what happens when the key signs something that is not a transaction, and why the standards that made that prompt legible also made it more useful to an attacker than to its owner.

The Machine, In One Line
Ethereum has two kinds of signed object, and they are not interchangeable. A transaction is signed over an RLP-encoded structure. A message is signed over a hash with a reserved prefix, and the prefix exists to make the two kinds structurally impossible to confuse:
// EIP-191, version 0x45 — personal_sign
"\x19Ethereum Signed Message:\n" ‖ len(message) ‖ message
// EIP-712 — typed structured data
"\x19\x01" ‖ domainSeparator ‖ hashStruct(message)
That leading 0x19 is the interesting byte. Legacy Ethereum transactions are RLP-encoded lists, and a valid RLP list never begins with a byte below 0xc0. By claiming 0x19, EIP-191 reserved a value that a legacy transaction can never start with, so a signed message cannot be mistaken for one. The 0x01 that follows is a version number: 1 means “the next 32 bytes are a domain separator, and the 32 bytes after that are the message hash”.
From there the structure unfolds:
hashStruct(s) = keccak256(typeHash ‖ encodeData(s))
typeHash = keccak256(encodeType(typeOf(s)))
domainSeparator = hashStruct(eip712Domain)
encodeType is just the struct written out as a string, with one rule that trips people up: if the struct references other structs, those referenced types are appended at the end, sorted alphabetically by name. So a Permit is hashed against the literal string:
Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)
You can check that string by hand, which is the entire aesthetic of EIP-712: everything you sign is supposed to be something a human could have written. The standard was created on 12 September 2017 by Remco Bloemen, Leonid Logvinov and Jacob Evans, and it depends explicitly on EIP-155 (chain IDs) and EIP-191 (the prefix).
The Domain Is the Part That Does the Real Work
Everyone looks at the message. The security lives in the five fields that come before the message:
| Field | Type | What it prevents |
|---|---|---|
name | string | two apps with identical structs signing colliding payloads |
version | string | a v1 signature being accepted by v2 of the same protocol |
chainId | uint256 | replay on another chain, including a future fork |
verifyingContract | address | the same signature being spent at a different contract |
salt | bytes32 | last-resort disambiguation between two domains |
Any subset can be used, in that order, skipping the ones you omit; new fields must be appended alphabetically. The verifyingContract field is the one wallets could use for real phishing defence — the spec says a user agent may use it to check the contract you are actually talking to — and it is also the field most often left out of hand-rolled implementations.
Here is the uncomfortable part, stated by the standard itself in its abstract: “It does not include replay protection.” EIP-712 defines how to hash and how to encode a domain. It does not define a nonce, an expiry, or a one-time-use rule. Those are the application’s problem, and when an application forgets, the signature becomes a reusable bearer instrument.

What Legibility Buys, and What It Does Not
The reason EIP-712 exists is banal and worth remembering: before it, signing a message in a wallet meant approving 32 bytes of hex you could not read. There is no way to display that safely, so the industry’s entire defence was a warning label.
EIP-712 replaced the hex with a rendered form: Approve 1,000 USDC to 0x7a25…f3c1 until 12 March. That is a genuine improvement, and it is also where the trouble starts, because legibility is not safety. A perfectly rendered field can read:
value: 115792089237316195423570985008687907853269984665640564039457584007913129639935
which is 2²⁵⁶ − 1, which is “unlimited”, and which no human reads as a number. The prompt got prettier; the thing being authorized did not get smaller. What actually changed is the shape of the phishing: it moved from “sign this blob, trust me” to “sign this tidy permission you can almost understand”.
The dangerous signature is not the ugly one. It is the tidy one you understood at a glance.
BBVN Markets
The Permit: An Approval With No Transaction
EIP-2612 is where all of this becomes a wallet-draining primitive, and it is worth reading as a design rather than a bug.
Normally, letting a contract spend your tokens takes two on-chain actions: approve(spender, amount) from you, then transferFrom(...) from the spender. The permit extension collapses the first one into a signature:
permit(owner, spender, value, deadline, v, r, s)
// verifies an EIP-712 "Permit" message, checks owner != address(0),
// checks block.timestamp <= deadline, checks nonces[owner],
// then writes allowance[owner][spender] = value and bumps the nonce
Four properties follow, and each one is a gift to somebody:
- Anybody can submit it. The EIP is explicit that the caller need not be the signer, and that a front-runner submitting your permit first is harmless — the allowance ends up the same. Convenient for relayers; also convenient for the person who tricked you into signing.
- Nothing appears in your history until it is used. There is no pending approval to notice, because a signature is not a transaction.
- The nonce is the only thing making it single-use. Not the deadline, not the domain. If a contract forgets to increment it, the signature is a permanent key.
deadlinecan be set touint(-1). The EIP says so directly, describing it as a way to create permits that effectively never expire. Great UX. No expiry.
There are two failure modes that are pure implementation sloppiness rather than design. ecrecover returns the zero address on malformed input instead of reverting — so a permit that does not check owner != address(0) can be tricked into granting an allowance over funds belonging to nobody, which the EIP calls “zombie funds”. And if the DOMAIN_SEPARATOR is computed once at deployment and cached, a future chain split can make the same signature valid on both chains.
The variants are worth knowing because they change the hash: DAI shipped an earlier design that takes a bool allowed and calls the deadline expiry, so the signed struct is different from EIP-2612’s. USDT does not implement permit at all. Uniswap’s Permit2 exists to paper over exactly that gap, at the cost of one more contract you have to trust — the same trade documented in the account-abstraction writeup on how ERC-4337 moved validation into contracts.
EIP-155 adds chain IDs, the field every domain separator later depends on
EIP-191 reserves the 0x19 prefix so a message can never be a transaction
EIP-712 is created: typed data, a domain separator, a 0x1901 prefix
EIP-2612 turns the same signature into a token allowance with no transaction
Pectra ships EIP-7702: a signature can now install code at your address
The Escalation Nobody Priced In
For eight years the worst case of a bad signature was bounded. A permit gives away an allowance over one token at one contract. Painful, recoverable if you notice in time, and revocable.
EIP-7702 changed the ceiling. It shipped with Pectra on 7 May 2025, and it lets an externally-owned account set its own code by signing an authorization. The authorization is a list of six fields — chain_id, address, nonce, y_parity, r, s — and the resulting account behaves as if it had delegated to that address. Set chain_id to zero and the authorization is valid on every chain.
Read that again in the context of the last six sections: a signature that used to hand over an allowance can now hand over the account. The prompt is still a prompt. The wallet still renders fields. The difference is that the worst outcome moved from “one token, one spender, revocable” to “everything this address will ever hold, until you can send a transaction to undo it, using an address that may already be emptied”.

Discharge Summary
If you sign for a living — or sign for a hobby, which is the same thing now — here is the note I would want handed to me at the door.
Diagnosis. You were not hacked. You authorized. Every incident in this piece is a valid signature over a valid message that a valid contract executed exactly as written.
What the record shows. A message hash, a domain, and 65 bytes of signature. No transaction from your address, no gas paid by you, and often a gap of seconds to days between the signature and the drain.
Prescription.
- Read the spender address, not the token name. The name is decoration the site controls; the address is the thing that will be allowed to move your balance. If it is not the address shown in the app’s own documentation, stop.
- Check whether
valueis a number you could say out loud. If it renders as a 78-digit integer, it is “unlimited”, and the honest translation of “unlimited” is “everything, forever”. - Treat Sign with the same suspicion as Send. That is the entire lesson of the last decade compressed into one sentence, and it is the one nobody internalizes until they have a 1 a.m. phone call of their own.
The standard did its job. EIP-712 made the payload legible, bound it to a chain and a contract, and gave wallets everything they need to warn you properly. What it could not do is make a legible permission harmless — and the industry spent the following years optimizing the legibility while leaving the permission exactly as large as it was.
(The End)


