How to use the snarkjs.generateVerifier function in snarkjs

To help you get started, we’ve selected a few snarkjs examples, based on popular ways it is used in public projects.

github LimeChain / etherlime / packages / etherlime / cli-commands / zk-proof / generate-verify.js View on Github external
const run = async (vk) => {
	console.log('===== Creating Smart Contract for OnChain verification =====');
	const verifierKey = zkSnark.unstringifyBigInts(require(`${process.cwd()}/${trustedSetupPath}/${vk}`));
	const template = zkSnark.generateVerifier(verifierKey);
	fs.writeFileSync(`${contractsPath}/Verifier.sol`, template);
	console.log('===== Smart Contract Created Successfully. Please check your contracts folder =====');
};