Created
June 14, 2021 05:20
-
-
Save johnson86tw/0d8bc152b3865403581e5e8aa10e01a6 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
const circomlib = require("circomlib"); | |
const mimcsponge = circomlib.mimcsponge; | |
export function MiMCSponge(left: string, right: string): string { | |
return mimcsponge.multiHash([BigInt(left), BigInt(right)]).toString(); | |
} | |
export interface IMerkleTree { | |
root: () => string; | |
proof: (index: number) => { | |
root: string; | |
pathElements: string[]; | |
pathIndices: number[]; | |
leaf: string; | |
}; | |
insert: (leaf: string) => void; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment