A command-line tool for working with EIP-712 typed structured data — hash, sign, and verify messages offline.
- Hash — compute the EIP-712 signing hash from a JSON file or stdin
- Sign — sign typed data with a private key or mnemonic phrase
- Verify — verify a 65-byte signature against an Ethereum address or public key
- Pretty-printed table output with
--pretty - JSON schema validation of input data
brew tap MaximFischuk/eip712-cli
brew install eip712-cliDownload the latest release for your platform from the Releases page.
Available targets:
aarch64-apple-darwin(macOS Apple Silicon)x86_64-apple-darwin(macOS Intel)x86_64-unknown-linux-gnu(Linux x86_64)aarch64-unknown-linux-gnu(Linux ARM64)
Requires Rust (edition 2024).
git clone https://github.com/MaximFischuk/eip712-cli.git
cd eip712-cli
cargo build --release
# binary at target/release/eip712The tool accepts EIP-712 typed data as a JSON file following the standard schema:
{
"types": {
"EIP712Domain": [
{ "name": "name", "type": "string" },
{ "name": "version", "type": "string" },
{ "name": "chainId", "type": "uint256" },
{ "name": "verifyingContract", "type": "address" }
],
"Person": [
{ "name": "wallet", "type": "address" },
{ "name": "age", "type": "uint8" }
]
},
"primaryType": "Person",
"domain": {
"name": "My DApp",
"version": "1",
"chainId": 1,
"verifyingContract": "0x0000000000000000000000000000000000000000"
},
"message": {
"wallet": "0x0000000000000000000000000000000000000000",
"age": 42
}
}Compute the EIP-712 signing hash:
# from a file
eip712 hash message.json
# from stdin
cat message.json | eip712 hash
# pretty output
eip712 hash --pretty message.jsonSign typed data with a private key:
eip712 sign --private-key 0x... message.jsonSign with a mnemonic phrase:
eip712 sign --mnemonic "word1 word2 ... word12" message.json
# use a specific derivation index (default: 0)
# derivation path: m/44'/60'/0'/0/{index}
eip712 sign --mnemonic "word1 word2 ... word12" --index 2 message.jsonPretty output:
eip712 sign --private-key 0x... --pretty message.jsonVerify a signature against an Ethereum address:
eip712 verify --address 0x... --signature 0x... message.jsonVerify against an uncompressed public key (64 or 65 bytes, hex):
eip712 verify --public-key 04abcd... --signature 0x... message.jsonThe command exits with code 0 on success and non-zero on failure with a descriptive error message.
Pretty output:
eip712 verify --address 0x... --signature 0x... --pretty message.json