The proof source code is stored in this repository, and all the necessary utilities are bundled in an npm package. To install the package, follow these steps:
npm i idmask-zk-programs
To verify user provided JSON proof:
import { verify } from 'o1js'
import { proofOfAge } from 'idmask-zk-programs'
// this is a user supplied JSON proof
const proof = {
publicInput: ["21"],
publicOutput: ["1"],
maxProofsVerified: 0,
proof: "KChzdGF...KSkpKSkp"
}
const { verificationKey } = proofOfAge.compile()
const isProofValid = await verify(proof, verificationKey)
console.log(
`Is proof valid? ${isProofValid}`,
`Proof of age of at least ${proof.publicInput[0]} years`
)
Check if provided public address has an associated proof