Skip to main content

Typed mutable SSZ views over cached and immutable binary merkle trees

Project description

https://raw.githubusercontent.com/protolambda/remerkleable/master/docs/_static/logo.png

remerkleable

https://img.shields.io/pypi/l/remerkleable.svg https://img.shields.io/pypi/pyversions/remerkleable.svg https://img.shields.io/pypi/status/remerkleable.svg https://img.shields.io/pypi/implementation/remerkleable.svg https://github.com/protolambda/remerkleable/workflows/Remerkleable%20Python%20CI/badge.svg

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.

Contact

Author: @protolambda

License

MIT, see LICENSE file.

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

remerkleable-0.1.24.tar.gz (37.9 kB view hashes)

Uploaded source

Built Distribution

remerkleable-0.1.24-py3-none-any.whl (43.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page