In this track: Cryptography with intuition
advanced · 4 MIN READ

Personal message signing prefixes

Personal-message hashing prefixes the exact message length and bytes.

LET’S PICTURE IT

A document envelope can say this is a message rather than an ordinary transaction.

SEE IT FOR YOURSELF
From a public address to a verified signatureStep 1 / 4
From a public address to a verified signaturePublic address0x0000…0001Share to receiveAnother personCan read the addressCannot sign for youPublic identifier ≠ secret authorizationLocal signerPrivate key stays hereSign the chosen requestSigned requestMessage + signatureSecret key not includedThe moving packet represents a signature, not a keySignatureCheck the exact messageCheck the signing contextVerificationAuthorization checkedIntent still mattersValidity and safety are different questionsWallet interfaceReads public dataRequests authorizationNetwork stateBalances and recordsIndependent verificationNo wallet is connected in this local illustration

An address is public receiving information. It is not the private key that authorizes actions.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

Use the message convention

The common Ethereum personal-message scheme includes a defined prefix and decimal byte length before the message bytes are hashed. It is not simply Keccak-256 of the text.

Count encoded bytes

For hello the length is five UTF-8 bytes. For non-ASCII text, visible character count and JavaScript string length are not reliable general byte counts.

Avoid a text-versus-hex mismatch

Signing the text 0x1234 differs from signing two raw bytes 12 34. The API input convention must agree between the signer and verifier.

Do not infer harmlessness

A personal-message signature can still authorize actions when a protocol accepts it. Read the actual message and application rules before signing.

Inspect the distinction

message: hello
UTF-8 length: 5
personal-message digest: 0x50b2c43fd39106bafbba0da34fc430e1f91e3c96ea2acee2bc34119f92b37750
raw Keccak digest: 0x1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8

These are local teaching values, not a signature request or a live-chain lookup.

TURN UNDERSTANDING INTO PRACTICEOpen the Keccak-256 →
QUICK CHECK · NO PRESSURE

Is a personal-message digest always plain Keccak-256(message)?

Your progress stays in this browser.
Keep exploring the original referenceEthereum Improvement Proposals ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.