Skip to content

Latest commit

 

History

History
33 lines (16 loc) · 615 Bytes

README.md

File metadata and controls

33 lines (16 loc) · 615 Bytes

Implementing Merkel and Patricia Tree in Node.js

Node.js implementation of Merkel tree and Patricia Tree used in Ethereum blockchain

MerkelTree

This class has the following methods:

  1. createTree(transactionList)

    Adds layers to the tree for the passed transaction list

  2. verify(transaction)

    Checks if the transaction is valid or not

PatriciaTrie

This class has the following methods:

  1. add(transaction)

    Add transaction to the trie

  2. get(hash)

    Get transaction from the trie for the passed trie

  3. remove(hash)

    Remove the trnasaction with the hash if found