All Projects → RainBlock → merkle-patricia-tree

RainBlock / merkle-patricia-tree

Licence: MPL-2.0 license
☔️🌲 A fast, in-memory optimized merkle patricia tree

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to merkle-patricia-tree

gb merkle trees
General balanced binary Merkle trees for Erlang
Stars: ✭ 25 (+13.64%)
Mutual labels:  tree, merkle
ipld-explorer-cli
🔎 Explore the IPLD directed acyclic graph with your keyboard
Stars: ✭ 22 (+0%)
Mutual labels:  tree, merkle
beehive
A flexible, modern, header-only implementation of behavior trees
Stars: ✭ 37 (+68.18%)
Mutual labels:  tree
ztree-for-react
jQuery zTreeV3.x 插件react封装
Stars: ✭ 22 (+0%)
Mutual labels:  tree
merkle
Merkle root algorithms in various languages
Stars: ✭ 40 (+81.82%)
Mutual labels:  merkle
avl array
High performance templated AVL tree using a fixed size array. Extensive test suite passing.
Stars: ✭ 33 (+50%)
Mutual labels:  tree
gtree
Output tree🌳 or Make directories📁 from #Markdown or Programmatically. Provide CLI, Golang library and Web (using #Wasm ).
Stars: ✭ 88 (+300%)
Mutual labels:  tree
JLBoost.jl
A 100%-Julia implementation of Gradient-Boosting Regression Tree algorithms
Stars: ✭ 65 (+195.45%)
Mutual labels:  tree
DrawRacket4Me
DrawRacket4Me draws trees and graphs from your code, making it easier to check if the structure is what you wanted.
Stars: ✭ 43 (+95.45%)
Mutual labels:  tree
vue-virtualised
Blazing fast scrolling and updating for any amount of list and hierarchical data.
Stars: ✭ 18 (-18.18%)
Mutual labels:  tree
LoveTree
🌴爱情树,将相爱的时刻永远珍藏 (微信,QQ可完美查看)https://ajlovechina.github.io/LoveTree/
Stars: ✭ 295 (+1240.91%)
Mutual labels:  tree
mcts
🌳 Domain independent implementation of Monte Carlo Tree Search methods.
Stars: ✭ 15 (-31.82%)
Mutual labels:  tree
un-flatten-tree
A small npm module for converting trees to lists and vice versa.
Stars: ✭ 14 (-36.36%)
Mutual labels:  tree
BBob
⚡️Blazing-fast js-bbcode-parser, bbcode js, that transforms and parses to AST with plugin support in pure javascript, no dependencies
Stars: ✭ 133 (+504.55%)
Mutual labels:  tree
nub
A rendering and interaction Processing library
Stars: ✭ 28 (+27.27%)
Mutual labels:  tree
service-tree
[ABANDONED] A tree that stores services in its node for a given key, and allows traversing them.
Stars: ✭ 33 (+50%)
Mutual labels:  tree
mongodb-tree-structure
Implementing Tree Structure in MongoDB
Stars: ✭ 14 (-36.36%)
Mutual labels:  tree
taxonium
A tool for exploring very large trees in the browser
Stars: ✭ 65 (+195.45%)
Mutual labels:  tree
vscode-gcode-syntax
G Code Language Extension for Visual Studio Code. Turn VSCode into a fully capable G-Code editor, including language support & more.
Stars: ✭ 59 (+168.18%)
Mutual labels:  tree
immutable-gametree
An immutable game tree data type.
Stars: ✭ 18 (-18.18%)
Mutual labels:  tree

☔️🌲 RainBlock's In-Memory Merkle Tree

NPM Package Build Status Coverage Status node

@rainblock/merkle-patricia-tree is an in-memory merkle tree which conforms to the specifications of the modified merkle patricia tree used by Ethereum. It is a fork of the EthereumJS library, and released under the same license, however, the API has changed to be synchronous instead of callback based. The goals of @rainblock/merkle-patricia-tree are to be:

  • In-Memory Optimized. @rainblock/merkle-patricia-tree is optimized for in-memory use and does not support persistence.

  • High performance. By taking advantage of in-memory optimizations, @rainblock/merkle-patricia-tree aims to be high performance - currently, it is 2-8x more performant than EthereumJS's merkle tree on standard benchmarks.

  • Well documented. API documentation is automatically generated from the JSdoc embedded in the typescript source, and the source code aims to be commented and maintainable.

  • Ethereum compatible. The root hashes produced by @rainblock/merkle-patricia-tree should produce the same root hashes as other Ethereum merkle tree libraries given the same input data.

Install

Add @rainblock/merkle-patricia-tree to your project with:

npm install @rainblock/merkle-patricia-tree

Usage

Basic API documentation can be found here, but the following example shows basic use of puts and gets and verification:

import {MerklePatriciaTree, VerifyWitness} from '@rainblock/merkle-patricia-tree';
const tree = new MerklePatriciaTree();

tree.put(Buffer.from('a'), Buffer.from('b'));

// Get returns a witness which contains { value, proof }
const witness = tree.get(Buffer.from('a'));

// VerifyWitness will throw an error if the proof doesn't match the given root
VerifyWitness(witness, tree.root);

Benchmarks

Benchmarks can be run by executing npm run benchmark from the package directory.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].