Skip to main content

Python bindings for rustreexo

Project description

Pytreexo

Introduction

Pytreexo is a collection of bindings over the rustreexo library. It provides all the functionality of rustreexo in python, with the speed of Rust.

Installation

Requirements

  • Python 3.6+
  • Rust 1.41+ (if you build from source)
  • librustreexo (if you don't build from source)

From PyPI

pip install pytreexo

From source

Clone the repository and build librustreexo

git clone https://github.com/mit-dci/utreexo
cd utreexo/c-rustreexo
make install

Install the python lib

pip install ./pytreexo/

Usage

from pytreexo import Proof, Stump

# Create a new stump
s = Stump()

# Create a new proof
p = Proof()

# Add some elements
i = [bytes.fromhex("37cb3336f40b13170f5eb17b056adbee825c5287e9f1440ab63482aea51e85da")] * 100
update_data = s.modify(i, [], p)

# Update the proof to reflect the changes
proof.update(update_data, [], i, [], [0, 1, 2, 3])

# See if serialization rtt
assert Proof.parse(i) == proof

Documentation

Documentation is available at https://pytreexo.readthedocs.io/en/latest/

License

Pytreexo is licensed under the MIT license. See LICENSE for more information.

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

pytreexo-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

pytreexo-0.1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file pytreexo-0.1.1.tar.gz.

File metadata

  • Download URL: pytreexo-0.1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for pytreexo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1f40900d362e27472a4e99bac13dd936b2ab44d7f048e08704268d4a98f1fedb
MD5 8f18b30120902d9701f38ba5be97e14a
BLAKE2b-256 745d508017b420a767fa97404ef0e478ea05066a0cf745550df63b5c9ba337bd

See more details on using hashes here.

File details

Details for the file pytreexo-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pytreexo-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for pytreexo-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b3e4a3d6e841cfe0e6ea98c8aa565fa58074ca754a189b3298938b685a847677
MD5 8ff6f2dbe7f6a3d65383883507d09292
BLAKE2b-256 385335ff9f52c89bc506250a0db7492ca9ca3981e20453948f676f46bd774281

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