EIP-712 Signing for Cosmos Transactions
Overview
This chain implements a novel approach to transaction signing that enables Cosmos transactions to be signed using the Ethereum Ledger app via EIP-712 typed data. This provides unified key management for chains that support both EVM and Cosmos transaction types.The Problem
Traditional Cosmos chains use:- Key Type:
secp256k1 - Ledger App: Cosmos app
- Address Format: Bech32 (derived from SHA256 + RIPEMD160)
- Key Type:
eth_secp256k1 - Address Format: Ethereum hex (derived from Keccak256)
The Solution: EIP-712
EIP-712 is a standard for typed structured data hashing and signing. Originally designed for Ethereum dApps, it can be used to sign any structured data, including Cosmos transactions.How It Works
EIP-712 Structure
A Cosmos transaction is converted to:Implementation
CLI Usage (evmd)
Key Generation
Open the Ethereum app on your Ledger device and run:eth_secp256k1 by default.
Transaction Signing
Browser Wallet Integration (Keplr)
Wallet developers can integrate EIP-712 signing using the@evmos/transactions library:
Why This Approach?
Cosmos Leger App Limitations
- Cosmos app cannot derive
eth_secp256k1addresses - Cosmos app uses different hashing (SHA256+RIPEMD160 vs Keccak256)
- Ethereum app supports uncompressed public keys needed for EVM
Technical Details
Key Derivation
- Algorithm:
eth_secp256k1 - HD Path:
m/44'/60'/0'/0/0(Ethereum standard, BIP-44) - Public Key Format: Uncompressed 65-byte ECDSA public key
- Address Derivation: Keccak256(pubkey)[12:] → Bech32
Signature Format
- Input: EIP-712 typed data (structured Cosmos transaction)
- Output: ECDSA signature (65 bytes: r + s + v)
- Verification: Standard ECDSA verification against
eth_secp256k1pubkey
EIP-712 Domain Separator
Reference Implementation
- CLI Tool: See
scripts/test_ledger_manual.shin the evm repo - Web App: See test-webapp in the evm repository for browser integration