Skill — Copyable reference implementation. Use as-is or customize. See Skills Philosophy.
EIP-191 Personal Sign
EIP-191 defines a standard format for signed data that prevents signed messages from being valid transactions. The format prepends\x19Ethereum Signed Message:\n{length} to your message before hashing.
Hash Prefixing Convention
The EIP-191 personal message format:- Signed messages cannot be valid transactions
- Users know they are signing a message, not a transaction
- Cross-application signature reuse is prevented
Verifying Signatures
Verify that a signature was created by a specific address:Recovering the Signer Address
Recover the signer’s address from a signature without knowing it beforehand:Complete Example
Full sign-and-verify flow:EIP-191 Version Bytes
EIP-191 defines three version bytes for different use cases:Security Considerations
- Use EIP-191 prefix: Raw message signing allows transaction replay attacks
- Include context: Add domain, timestamp, or nonce to prevent cross-site signature reuse
- Verify v value: Must be 27 or 28 (or 0/1 in some libraries)
- Check address format: Recovered addresses are checksummed differently per library
- Time-bound signatures: Include expiration timestamps in signed messages
Related
- Secp256k1 Signing - Low-level ECDSA signing
- Secp256k1 Recovery - Public key recovery
- EIP-712 - Typed structured data signing
- Keccak256 - Hash function used for Ethereum

