--- id: eip712 version: "0.3.3" license: Apache-2.0 license_treatment: permissive maintenance: aging --- # eip712 — eip712: Message classes for typed structured data hashing and signing in Ethereum License: permissive · Maintenance: aging · Downloads: 113.9K/mo ## What it is and what it does eip712 is a Python library that wraps EIP-712 message specification into Pydantic-based classes, letting you define strongly-typed Ethereum messages and sign them cryptographically. You define message structures by subclassing EIP712Message and EIP712Type, specify your domain configuration (name, version, contract address, chain ID), and then instantiate and sign messages using eth-account or Ape. The library handles the encoding and hashing required by the EIP-712 standard, so you work with plain Python objects rather than raw bytes. It's built on pydantic for validation and eth-pydantic-types for ABI-compliant field types (address, uint256, string, etc.), making it natural to define domain-specific message schemas. The typical workflow is: define your message class, create instances with your data, and pass them to Account.sign_message() to get a signature. It's most useful in DeFi protocols, governance systems, or any Ethereum application that needs to sign structured data off-chain and verify it on-chain. Use it for: - Define and sign EIP-712 messages for DeFi permit() functions, governance votes, or off-chain orders that will be verified on-chain. - Build typed message schemas for multi-signature wallets or threshold signing schemes where structured data must be cryptographically committed. - Create domain-specific signing protocols in Ape scripts or Python automation that interact with Ethereum smart contracts. - Validate and sign complex nested message structures with arrays and custom types without manually encoding bytes. - Integrate EIP-712 signing into Python-based wallet or key management tools that need to sign Ethereum messages. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Python message classes for EIP-712 typed structured data hashing and signing in Ethereum, enabling you to define domain-specific message types and sign them with eth-account. Yes, if you need to sign EIP-712 messages in Python. The library is production-stable, has low install friction, and integrates cleanly with eth-account. Maintenance is aging (last release 234 days ago), but the repo is active and there are no known vulnerabilities. It's a focused, well-scoped tool for a specific cryptographic task in the Ethereum ecosystem. ## Install pip install eip712 uv add eip712 poetry add eip712 ## Installing eip712 Before you install: Low install friction; pure Python wheel with four runtime dependencies (pydantic, eth-account, eth-pydantic-types, eth-utils). Maintenance is aging—last release 234 days ago—but the repo is active and not archived. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for most projects. Quickstart: pip install eip712 from eip712.messages import EIP712Message from eth_pydantic_types import abi from eth_account import Account class Mail(EIP712Message): eip712_domain = EIP712Domain(name="Ether Mail", version="1", chainId=1) sender: abi.address mail = Mail(sender="0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa") acct = Account.from_key(private_key) sig = acct.sign_message(mail.signable_message) Requires Python 3.10 or later (up to 3.14); eth-account and eth-pydantic-types must be installed. Verify before relying: - Whether the library handles all EIP-712 domain configurations (chainId, verifyingContract, salt) beyond the examples shown. - Performance characteristics when signing large nested message structures or arrays. - Compatibility with hardware wallets or other signing backends beyond eth-account. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 113.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags EIP-712 message signing, Ethereum structured data hashing, typed message signing, eth-account integration, Pydantic Ethereum messages, domain-specific message types, cryptographic message signing, ethereum, cryptography, eip-712 [View on SkillFed](https://skillfed.io/packages/eip712) · [View on PyPI](https://pypi.org/project/eip712/)