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.6.tar.gz (14.0 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.6-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ethereum_rlp-0.1.6.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for ethereum_rlp-0.1.6.tar.gz
Algorithm Hash digest
SHA256 ede36f53b53c8da21f19259a676eed8790950d47f0b42cb928ac8a3c562282f3
MD5 ab49507c0640f433ac15460a959faa7b
BLAKE2b-256 54551fab3dea8f912459751cb39ad4500e165344963af2dbd5fa699befe3e8d4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ethereum_rlp-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f4144caa96b975720c62b967bbfd6c98601e95ee3c36457ece11ef4ce0cffa04
MD5 ac0b7060b8ff8d4441397014d4c8e0bf
BLAKE2b-256 37abb9b2ff2d37b7feabe3dcdee7d5170cf0e71b849a073bda8857c0afb54962

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