@ -47,7 +47,7 @@ function hash(message: any): bigint {
for ( let k = 0 ; k < 2 ; k ++ ) {
const identityTrapdoor = BigInt ( ethers . utils . hexlify ( ethers . utils . randomBytes ( 32 ) ) )
const identityNullifier = BigInt ( ethers . utils . hexlify ( ethers . utils . randomBytes ( 32 ) ) )
secrets . push ( { identityTrapdoor , identityNullifier } )
secrets . push ( { identityTrapdoor , identityNullifier } )
const secret = poseidon ( [ identityNullifier , identityTrapdoor ] )
const identityCommitment = poseidon ( [ secret ] )
@ -86,7 +86,6 @@ function hash(message: any): bigint {
console . log ( 'check' )
await snarkjs . wtns . check ( r1cs , wtns , logger ) ;
console . log ( 'prove' )
const { proof , publicSignals } = await snarkjs . groth16 . prove ( zkey_final , wtns ) ;
@ -94,8 +93,6 @@ function hash(message: any): bigint {
console . log ( 'zk proof validity' , verified ) ;
proof1 . root . toString ( ) === publicSignals [ 0 ] ? console . log ( 'merkle proof valid' ) : console . log ( 'merkle proof invalid' )
} catch ( e ) {
console . error ( e . message )
}