Registry / auth-security / eip712

eip712

JSON →
library0.3.3pypypi✓ verified 34d ago

Message classes for typed structured data hashing and signing in Ethereum, based on EIP-712. Current version 0.3.3, requires Python >=3.10, <4. Maintained actively by ApeWorX.

auth-securityserialization
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.292s · 58.8MB
glibc
py 3.103.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.

Correct import for the main message class.

from eip712 import EIP712Message

EIP712Type is exported from top-level eip712 since v0.3.0.

from eip712 import EIP712Type

EIP712Domain is now directly available from eip712.

from eip712 import EIP712Domain

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())
Debug
Known footguns
breakingv0.3.0 replaced dataclassy with pydantic. If you subclasses EIP712Message directly, you need to adapt to pydantic behavior (e.g., field aliases, validation).
breakingIn v0.3.0, EIP712Type was removed as a separate class. Inner types should be plain pydantic models or Python types.
gotchaField names that conflict with Python keywords (e.g., 'from') must use pydantic aliasing with Field(alias=...).
deprecatedString type annotations like 'uint256' are deprecated; use pydantic numeric types (e.g., int, float) or custom validators.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
30 hits · last 30 days
bytedance
5
gptbot
4
amazonbot
4
ahrefsbot
3
claudebot
3
script
1
Resources