Verifying a proof

We can verify whether a solution is valid for an already defined bqTest in solve mode (solveModeTest) by doing:

await solveModeTest.verifySolutionProof( solutionProof )

Which will return true if the proof is valid, and false otherwise.

WARNING: Note that this only means that the verifier (that is, the smart contract) will accept this proof. This does not necessarily grant the credential if, for example, the grade is below the minimum required. The smart contract will always revert if the proof is not valid, that is, if this method returns false.

When we call on the deployed contract on testnet, with the already generated proof:

> const verified = await solve.verifySolutionProof( solutionProof )
> console.log(verified)
> true

This method is only provided for verification purposes and is not really needed in production. You can assume the proofs generated by the bqSDK to be valid.

Last updated