Skip to content

RaymondAbiola/MerkleTree-Implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MerkleTree-Implementation

This is a merkle tree implementation using the merkletreejs library with support for root generation and leaf verification. It can be applied for checking eligible participants in an airdrop.

Dependencies

  • merkletreejs library
  • keccak256 Hash function

Example output

Console Output

How it works

  • Leaves (names of eligible users) are stored in the array => "eligibleAirdropParticipants".
  • Leaves are hashed using keccak256 hash function and each hash is mapped to its corresponding leaf.
  • The tree and its root are generated with the MerkleTree() class constructor and the getHexRoot() function.
  • The checkIfNameIsValid() function verifies if a name is a valid leaf and part of the tree through steps and returns an output for true and false scenario.

Developer guide

  • Clone repo
$ gh repo clone raymondabiola/MerkleTree-Implementation
  • Edit array to customize array index values.
  • Install dependencies
$ npm install
$ npm start

Author

Built with 🤍 by Raymond Abiola
Feel free to follow my Github account or fork this repo for learning and testing.

About

This is a merkle tree implementation using the merkletreejs library with support for root generation and leaf verification.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors