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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ethereum_rlp-0.1.5.tar.gz.
File metadata
- Download URL: ethereum_rlp-0.1.5.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
679d4fa1163e32bc8c288680f29077980aa2f6b5321d71e8e2bff55c5233b7bd
|
|
| MD5 |
9f5ee271a6112977e9d6cb9dbf0c720e
|
|
| BLAKE2b-256 |
272b22ec601ed0924f8a54f9e91381e20bb8e98ad1afc8f23799826bb2c313e6
|
File details
Details for the file ethereum_rlp-0.1.5-py3-none-any.whl.
File metadata
- Download URL: ethereum_rlp-0.1.5-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.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cbb84ec4d4e65e4af3b49757ecd623e04520cbae521ac5386151149ad0a1b7a
|
|
| MD5 |
f25d937fe31b3b97c756f526a5a1b42f
|
|
| BLAKE2b-256 |
cebcc6006debf372615af7c911e815c79f63395099defed3c8308db37d31511a
|