From 580589e8208645a0b30de8c4a092d148b8b772f9 Mon Sep 17 00:00:00 2001 From: holgerd77 Date: Thu, 30 Nov 2017 15:57:55 +0100 Subject: [PATCH] Release commit for v2.3.0 --- CHANGELOG.md | 4 ++++ README.md | 16 ++++++++++++++++ package.json | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index afcbe40..4327cdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [2.3.0] - 2017-11-30 +- Methods for merkle proof generation ``Trie.prove()`` and verification ``Trie.verifyProof()`` (see [./proof.js](./proof.js)) + +[2.3.0]: https://github.com/ethereumjs/merkle-patricia-tree/compare/v2.2.0...v2.3.0 ## [2.2.0] - 2017-08-03 - Renamed ``root`` functions argument to ``nodeRef`` for passing a node reference diff --git a/README.md b/README.md index cc7191f..b2648e1 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,9 @@ The only backing store supported is LevelDB through the ```levelup``` module. `npm install merkle-patricia-tree` # USAGE + +## Initialization and Basic Usage + ```javascript var Trie = require('merkle-patricia-tree'), levelup = require('levelup'), @@ -30,6 +33,19 @@ trie.put('test', 'one', function () { }); ``` +## Merkle Proofs + +```javascript +Trie.prove(trie, 'test', function (err, prove) { + if (err) return cb(err) + Trie.verifyProof(trie.root, 'test', prove, function (err, value) { + if (err) return cb(err) + console.log(value.toString()) + cb() + }) +}) +``` + # API [./docs/](./docs/index.md) diff --git a/package.json b/package.json index 96c6e15..033342d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "merkle-patricia-tree", - "version": "2.2.0", + "version": "2.3.0", "description": "This is an implementation of the modified merkle patricia tree as speficed in the Ethereum's yellow paper.", "main": "index.js", "scripts": {