skillfed

poly-eip712-structs

A python library for EIP712 objects

poly-eip712-structs v0.0.1 1.3M downloads/30d#4,159 on PyPI5
Permissive license DORMANT released

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-structs

uv

uv add poly-eip712-structs

poetry

poetry add poly-eip712-structs

Installing 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

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

EIP-712 struct constructionEthereum message signingtyped data encodingsolidity struct pythondomain separatorcryptographic message hashingblockchain struct serialization
ethereumeip-712cryptography

More Cryptography packages