Skip to main content

Local Merkle DAG store with content-addressable block storage

Project description

Merkle DAG Store

A local Merkle DAG store with content-addressable block storage in Python. Provides immutable, deterministic, block-addressed object storage with DAG linking, snapshotting, and garbage collection.

Features

  • Content Addressing: Multiple hash algorithms (SHA256, SHA512, BLAKE2b)
  • DAG Linking: Create parent-child relationships between blocks
  • Snapshotting: Tag and version DAG states for time-travel
  • Garbage Collection: Remove unreachable blocks from storage
  • Integrity Verification: Recursive DAG verification
  • DAG Traversal: BFS traversal to discover reachable blocks
  • SQLite Index: Efficient metadata indexing and access statistics
  • Sharded Storage: Filesystem sharding for performance at scale

Installation

pip install merkle-dag-store

Usage

from merkle_dag_store import MerkleDAGStore

store = MerkleDAGStore("./my_dag")

# Store blocks
cid1 = store.put(b"Hello, World!")
cid2 = store.put(b"Linked data")

# Create linked block
cid3 = store.put(b"Parent", links=[str(cid1), str(cid2)])

# Create snapshot
store.snapshot(str(cid3), tag="v1.0")

# Verify integrity
assert store.verify(str(cid3), recursive=True)

License

MIT

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

merkle_dag_store-1.0.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

merkle_dag_store-1.0.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file merkle_dag_store-1.0.0.tar.gz.

File metadata

  • Download URL: merkle_dag_store-1.0.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for merkle_dag_store-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7e51ad4086b0444c807a8e6e13c21c7d088897064cbe297b8bdd1223071cab97
MD5 cc639cf60e163acff2c6a6140b723131
BLAKE2b-256 2d5424619622c2657d65da616508a951c9d3ad9e42450774a36ce54d303e170e

See more details on using hashes here.

File details

Details for the file merkle_dag_store-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for merkle_dag_store-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64ccb0da26996c1c3cbdeed6410dd12c6b316b16615e26bc01c33d4ce733601f
MD5 e2ef4a362fb589f03e4c7e1026df8d42
BLAKE2b-256 d52ac4625631cead8271d03b96336ddad03b300bcfb8c5c5437f17055d147686

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