Install & Compatibility
Where this runs
tested against v0.3.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.292s · 58.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 6.5s · import 1.230s · 62MB
60MB installed
● package 60MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
EIP712Message
✓ from eip712 import EIP712Message
Correct import for the main message class.
EIP712Type
✓ from eip712 import EIP712Type
✗ from eip712.messages import EIP712Type
EIP712Type is exported from top-level eip712 since v0.3.0.
EIP712Domain
✓ from eip712 import EIP712Domain
✗ from eip712.domain import EIP712Domain
EIP712Domain is now directly available from eip712.
Define EIP-712 message structures using pydantic-based classes and generate the structured data for signing.
from eip712 import EIP712Message, EIP712Domain
class Person(EIP712Message):
name: str
wallet: str
class Mail(EIP712Message):
from_: Person = Person(name='Alice', wallet='0x...') # field alias
to: Person
contents: str
message = Mail(
from_=Person(name='Alice', wallet='0x...'),
to=Person(name='Bob', wallet='0x...'),
contents='Hello!'
)
print(message.to_message())
print(message.encode_712())
print(message.signable_message())
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'eip712'
Library not installed.
fixRun 'pip install eip712'
ImportError: cannot import name 'EIP712Type' from 'eip712'
EIP712Type was removed in version 0.3.0.
fixUse pydantic models instead; or upgrade to a version <0.3.0 if you must use EIP712Type.
ValidationError: 1 validation error for Mail
from_
field required
Field name 'from_' is used but pydantic treats it as a field name; likely missing alias.
fixDefine the field with an alias: from_: Person = Field(alias='from')
AttributeError: 'EIP712Message' object has no attribute 'to_message'
Method 'to_message' may not exist in older versions.
fixUse 'encode_712()' or 'signable_message()' depending on needs. Check docstrings.
Upgrade
Version history
0.3.3latest on PyPI · released Dec 23, 2025
Audit
Dependencies
pydanticoptionalEIP712Message subclasses pydantic.BaseModel.
eth-accountoptionalUsed for signing and hash computation.