Skip to main content

Recursive-length prefix (RLP) serialization as used by the Ethereum Specification.

Project description

Ethereum RLP

Recursive-length prefix (RLP) serialization as used by the Ethereum Execution Layer Specification (EELS).

Usage

Here's a very basic example demonstrating how to define a schema, then encode/decode it:

from dataclasses import dataclass
from ethereum_rlp import encode, decode_to
from ethereum_types.numeric import Uint
from typing import List

@dataclass
class Stuff:
    toggle: bool
    number: Uint
    sequence: List["Stuff"]

encoded = encode(Stuff(toggle=True, number=Uint(3), sequence=[]))
decoded = decode_to(Stuff, encoded)
assert decoded.number == Uint(3)

See the tests/ directory for more examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ethereum_rlp-0.1.4.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ethereum_rlp-0.1.4-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file ethereum_rlp-0.1.4.tar.gz.

File metadata

  • Download URL: ethereum_rlp-0.1.4.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for ethereum_rlp-0.1.4.tar.gz
Algorithm Hash digest
SHA256 979f2161cfde39ecf6aecca765735124ca4cf57d2a43a74f353fa08f0d52557e
MD5 2d2d64f5016a6ad121b34615761e9a64
BLAKE2b-256 fcaf91de6fc397f4b4e201c64b5bf0a7838e2d990bc2aa1451a118b01ab99c8e

See more details on using hashes here.

File details

Details for the file ethereum_rlp-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: ethereum_rlp-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for ethereum_rlp-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a1612e382081bf08d7b0a6b08a89f8718dba3ca19536eec893795afa214f4f41
MD5 83584dcf0e1f709e11459a4c2888699c
BLAKE2b-256 3c67cef084060dfb2ec912a245fca5c7e282a282bd0d7cb741eaeabc4764500d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page