https://github.com/protolambda/remerkleable
Typed mutable SSZ views over cached and immutable binary merkle trees
https://github.com/protolambda/remerkleable
Last synced: 4 months ago
JSON representation
Typed mutable SSZ views over cached and immutable binary merkle trees
- Host: GitHub
- URL: https://github.com/protolambda/remerkleable
- Owner: protolambda
- License: mit
- Created: 2019-12-01T20:58:39.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-17T12:35:14.000Z (10 months ago)
- Last Synced: 2025-01-08T02:09:40.779Z (4 months ago)
- Language: Python
- Size: 493 KB
- Stars: 23
- Watchers: 4
- Forks: 9
- Open Issues: 7
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://raw.githubusercontent.com/protolambda/remerkleable/master/docs/_static/logo.png
:width: 100 px``remerkleable``
-----------------.. image:: https://img.shields.io/pypi/l/remerkleable.svg
:target: https://pypi.python.org/pypi/remerkleable.. image:: https://img.shields.io/pypi/pyversions/remerkleable.svg
:target: https://pypi.python.org/pypi/remerkleable.. image:: https://img.shields.io/pypi/status/remerkleable.svg
:target: https://pypi.python.org/pypi/remerkleable.. image:: https://img.shields.io/pypi/implementation/remerkleable.svg
:target: https://pypi.python.org/pypi/remerkleable.. image:: https://github.com/protolambda/remerkleable/workflows/Remerkleable%20Python%20CI/badge.svg
:target: https://github.com/protolambda/remerkleable/actions**Re-merkle-able**: Typed mutable SSZ views over cached and immutable binary Merkle trees.
Features
---------- Types:
- custom byte-vector and byte-list view for Python bytes-like behavior
- bitfields: bitlist, bitvector
- list, container, vector
- union
- basic types
- Functionality:
- **Serialize** all types. Into output stream (returning the written count) and as ``bytes``
- **Deserialize** all types. From input stream (and scope) and from ``bytes``
- **Hash-tree-root** all types
- Merkle-based **data-sharing**:
- every view can be initialized/backed by a binary Merkle tree
- complex views have backings, and can share data.
- complex views provide a nice mutable interface, and replace their backing.
And this also works for child-views through view-hooks.
- *SSZ-Partials*: if a *partial* proof is loaded as backing, a view can be overlaid,
and the partial backing works as long as no excluded branches are accessed.
- **Calculate byte lengths**:
- Type min/max byte length
- Byte length for fixed-length types
- Output byte length for a value, without serializing
- **Navigation**: construct paths from types, and convert to generalized indices.
- **History**: traverse a sequence of nodes, and get the changelog for a given subtree location.Project Links
--------------- Docs: https://remerkleable.readthedocs.io/
- Changelog: https://remerkleable.readthedocs.io/en/latest/changelog.html
- PyPI: https://pypi.python.org/pypi/remerkleable
- Issues: https://github.com/protolambda/remerkleable/issuesAlso see
---------- `SSZ: "SimpleSerialize", part of Ethereum Proof of Stake spec `_
- `SSZ draft spec `_
- `Ethereum Merkle trees information aggregate `_Contact
--------Author: `@protolambda `_
License
--------MIT, see `LICENSE <./LICENSE>`_ file.