
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
eip712
Advanced tools
Message classes for typed structured data hashing and signing in Ethereum. See EIP-712 for details.
pipYou can install the latest release via pip:
pip install eip712
uvYou can clone the repository and use uv for the most up-to-date version:
git clone https://github.com/ApeWorX/eip712.git
cd eip712
uv sync --group dev
Define EIP-712 models:
from eip712.messages import EIP712Message
# NOTE: It is **highly** recommended to use ABI types from this library
from eth_pydantic_types import abi
from pydantic import BaseModel
# You can define your inner nested types using normal Pydantic models
class Person(EIP712Type):
# Define fields using types from the `abi` module
name: abi.string
wallet: abi.address
# All valid EIP712 Message Structs **must** subclass `EIP712Message`
class Mail(EIP712Message):
# to define your EIP712 domain configuration
eip712_domain = EIP712Domain(
name="Ether Mail",
version="1",
verifyingContract="0xDDdDddDdDdddDDddDDddDDDDdDdDDdDDdDDDDDDd",
chainId=1,
)
# Struct fields (can be "basic" types, `BaseModel` types, or arrays of either)
sender: Person
# Dynamic array support is as easy as using `list` with the corresponding type
receivers: list[Person]
ttl: abi.uint256
Then initialize these models:
sender = Person(name="Alice", wallet="0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa")
receivers = [
Person(name="Bob", wallet="0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"),
Person(name="Charlie", wallet="0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"),
]
mail = Mail(sender=sender, receiver=receiver)
Finally, you can sign these messages using eth-account:
from eth_account import Account
acct = Account.from_key(private_key)
sig = acct.sign_message(mail.signable_message)
or natively in Ape:
# `ape console`
me = accounts.load(me)
sig = me.sign_message(mail)
FAQs
eip712: Message classes for typed structured data hashing and signing in Ethereum
We found that eip712 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.