npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@btc-vision/rust-merkle-tree

v1.0.2

Published

Merkle Tree implementation in Rust using sha256

Readme

Merkle Tree Library

Rust Bitcoin TypeScript NodeJS NPM

SHA-256

Package: @btc-vision/rust-merkle-tree

Overview

This project aims to develop a high-performance, secure Merkle tree library in Rust, with seamless integration for both Rust and Node.js applications. The library leverages SHA-256 as its cryptographic hash function and is designed to be secure against known vulnerabilities, ensuring robust state proof validations. Optimized for both performance and security, this library is intended for use in applications that require strong data integrity and validation mechanisms.

Security Audit

This library has been professionally audited by Verichains, a leading blockchain security firm. The audit confirms that the codebase is secure and ready for production use.

For audit reports and details, see the AUDIT directory.

Key Features

  • SHA-256 Hashing: Utilizes the SHA-256 hashing algorithm to ensure cryptographic security.
  • Cross-Platform: Designed for both Rust and Node.js environments, providing bindings for easy integration.
  • Secure Against Exploits: Implements protections against known vulnerabilities like hash collisions and tree manipulation.
  • Optimized Performance: Significantly improved speed and efficiency compared to existing Merkle tree implementations like merkle-tree-sha256.
  • Comprehensive Testing: Includes a suite of tests to ensure the library performs securely and accurately.

Getting Started

Prerequisites

  • Node.js: Version 24/25+ or higher is required.
  • Rust: You must have Rust installed to compile and develop this project.

Installation

  1. Clone the repository:

    git clone git://github.com/btc-vision/rust-merkle-tree.git
    cd rust-merkle-tree
  2. Install dependencies:

    npm install
  3. Build the project:

    For production build:

    npm run build

    For debug build:

    npm run build:debug
  4. Run tests:

    npm test

Usage

Node.js Usage

For Node.js integration, the library provides bindings via N-API.

  1. Install the package:

    npm install @btc-vision/rust-merkle-tree
  2. Example of creating a Merkle tree:

    import { MerkleTree } from '@btc-vision/rust-merkle-tree';
    
    const leaves: Uint8Array[] = [
        Uint8Array.from([100, 97, 116, 97, 49]),
        Uint8Array.from([100, 97, 116, 97, 50]),
        Uint8Array.from([100, 97, 116, 97, 51]),
    ];
    const tree = new MerkleTree(leaves);
    console.log('Merkle Root:', tree.root());

Scripts

  • npm run build: Compiles the Rust code into a release binary.
  • npm run build:debug: Compiles the Rust code with debug information.
  • npm test: Runs the test suite.
  • npm run coverage: Generates Rust code coverage report.

References

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvement, feel free to open an issue or submit a pull request. Signed commits are required, and please adhere to the project's code of conduct.

License

This project is licensed under the MIT License. For more details, please see the LICENSE file.

Contact

For more information, visit the OP_NET homepage or reach out via the repository's GitHub page.