poly-eip712-structs
A python library for EIP712 objects
What it is and what it does
poly-eip712-structs provides a Python interface for building EIP-712 structured data objects that can be signed for Ethereum transactions. It maps Solidity-like types (Address, Boolean, Bytes, Int, String, Uint, and nested structs) to Python class definitions, then serializes them into signable message bytes with domain separation. The library handles type encoding, message serialization to JSON, and dictionary-style access to struct fields.
Typical use is defining a struct class with typed fields, instantiating it with values, optionally setting a default domain, then converting to signable bytes or a message dict for cryptographic signing. It supports nested structs and arrays, dynamic attribute assignment for reserved keywords, and both static and dynamic array lengths.
Use it for:
- Sign typed Ethereum messages for wallet interactions or contract function calls requiring EIP-712 compliance.
- Build structured data objects that map to Solidity struct definitions for off-chain signing before on-chain submission.
- Encode domain-separated messages to prevent replay attacks across different Ethereum chains or contracts.
- Construct complex nested struct hierarchies with arrays and multiple field types for multi-signature workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Constructs and serializes EIP-712 structured data for Ethereum signing, mapping Solidity-like types to Python objects with domain separation and message encoding.
Yes, if you need EIP-712 struct construction for Ethereum signing and can tolerate dormant maintenance. The library is stable with no known vulnerabilities, but expect no active updates or bug fixes. Suitable for production use in mature workflows; less suitable if you need ongoing support.
Install
poly-eip712-structs on PyPI
pip
pip install poly-eip712-structsuv
uv add poly-eip712-structspoetry
poetry add poly-eip712-structsInstalling poly-eip712-structs
Before you install
Low friction install with a pure-Python wheel. Dormant maintenance status (last commit 2024-07-18) means no active bug fixes or security updates, though the codebase is stable.
License in practice
MIT license (permissive) allows commercial and private use with minimal restrictions.
Quickstart
pip install poly-eip712-structs
from poly_eip712_structs import EIP712Struct, String, Uint, make_domain
class MyStruct(EIP712Struct):
some_string = String()
some_number = Uint(256)
domain = make_domain(name='Example', version='1.0.0')
mine = MyStruct(some_string='hello', some_number=1234)
my_bytes = mine.signable_bytes(domain)
Requires Python >=3.9.10; runtime dependencies are eth-utils, pycryptodome, and pytest.
Verify before relying
- Whether this is a maintained fork or a distinct implementation with active development plans.
- Compatibility with current Ethereum tooling and whether EIP-712 spec changes since 2024-07-18 affect usage.
- Whether pytest is a runtime dependency or a development-only artifact.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — eth-utils, pycryptodome, pytest |
| Maintenance | dormant — 757 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,252,427/month — #4,159 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: poly_eip712_structs-0.0.1-py3-none-any.whl
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
canoserCanoser implements canonical serialization for…
permissive · top 15,000 on PyPI
eip712Provides Python message classes for EIP-712…
permissive · top 15,000 on PyPI
pycstructConverts binary data to and from Python…
permissive · top 15,000 on PyPI
siweImplements EIP-4361 Sign-In with Ethereum for…
permissive · top 15,000 on PyPI
eth-rlpProvides RLP (Recursive Length Prefix) encoding…
permissive · top 5,000 on PyPI
rlpEncodes and decodes data using Recursive Length…
permissive · top 5,000 on PyPI
construct-classesParses binary data into Python dataclasses and…
permissive · top 15,000 on PyPI
faster-eth-abiEncodes and decodes Ethereum ABI data…
permissive · top 15,000 on PyPI
eth-brownieBrownie is a Python framework for developing,…
permissive · top 15,000 on PyPI