dfinity-radix-tree
This implements a binary merkle radix tree
Last updated 10 months ago by floorlamp .
MPL-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install dfinity-radix-tree 
SYNC missed versions from official npm registry.

NPM Package Build Status Coverage Status

js-standard-style

Synopsis

:evergreen_tree: This implements a binary merkle radix tree. The point of using a binary radix tree is that it generates smaller proof size then trees with larger radixes. This tree is well suited for storing large dictionaries of fairly random keys. And is optimized for storing keys of the same length. If the keys are not random better performance can be archived by hashing them first. It builds on top of ipld-graph-builder and the resulting state and proofs are generated using it.

Install

npm install dfinity-radix-tree

Usage

const RadixTree = require('js-dfinity-radix-tree')
const level = require('level')
const db = level('./tempdb')

async function main () {
  const prover = new RadixTree({
    db: db
  })

  await prover.set('test', Buffer.from('value'))
  await prover.set('doge', Buffer.from('coin'))
  await prover.set('cat', Buffer.from('dog'))
  await prover.set('monkey', Buffer.from('wrench'))

  // create a merkle root and save the tree
  const merkleroot = await prover.flush()

  // start a new Instance with the root
  const verifier = new RadixTree({
    db: db,
    root: merkleroot
  })

  const result = await verifier.get('monkey')
  console.log(result.value.toString())
}

main()

API

'./docs/'

Specification

'./docs/spec.md'

Benchmarks

The result of the benchmarks show that the binary radix tree produces proofs on average 67% small then the Ethereum Trie with 100000 keys stored.

'./benchmarks/benchmarks.md'

License

(C) 2018 DFINITY STIFTUNG

All code and designs are open sourced under GPL V3.

image

Current Tags

  • 0.2.7                                ...           latest (10 months ago)

23 Versions

  • 0.2.7                                ...           10 months ago
  • 0.2.6                                ...           a year ago
  • 0.2.5                                ...           a year ago
  • 0.2.4                                ...           a year ago
  • 0.2.3                                ...           a year ago
  • 0.2.2                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.5                                ...           a year ago
  • 0.1.4                                ...           a year ago
  • 0.1.3                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
  • 0.0.9                                ...           2 years ago
  • 0.0.8                                ...           2 years ago
  • 0.0.7                                ...           2 years ago
  • 0.0.6                                ...           2 years ago
  • 0.0.5                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
  • 0.0.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 1
Dependencies (3)
Dev Dependencies (7)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |