βœ…How to consume proofs?

β˜‘οΈ Easiest & Most Reliable Way: Use the ID-Mask App

The recommended way to consume proofs is through the ID-Mask apparrow-up-right:

  1. Open idmask.xyzarrow-up-right on your device. Go to 'Verify' > 'QR Code'.

  2. Optionally precompile the proofs you're about to consume in the settings.

  3. Use the built-in scanner to scan the user’s pass QR code from their wallet.

  4. The app handles all cryptographic verification and ensures the pass actually belongs to the user by checking their passkey signature.

This is the only method that guarantees:

  • The proof is cryptographically valid.

  • The pass is truly owned by the person presenting it.

πŸ§‘β€πŸ’» Advanced: Programmatic Proof Verification

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: [...],
  maxProofsVerified: 0,
  proof: "KChzdGF...KSkpKSkp"
}
const { verificationKey } = await proofOfAge.compile()
const isProofValid = await verify(proof, verificationKey)

console.log(
  `Is proof valid? ${isProofValid}`,
  `Proof of age of at least ${proof.publicInput[0]} years`
)

πŸ§‘β€πŸ’» Advanced: Check if provided public address has an associated proof

Last updated