Created
June 14, 2021 05:15
-
-
Save johnson86tw/771b4609962047fc8c0c9e96978eebfd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// prover | |
const levels = 2; | |
const leaves = [10, 20 ,30 ,40]; | |
const tree = new MerkleTree(levels, leaves); | |
const index = 2; | |
const proof = tree.proof(index); | |
// verifier | |
const root = "117086588437903260255921638146322982" | |
console.log(verify(proof, root)); // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment