git clone https://github.com/Sindri-Labs/sindri-resources.git
cd sindri-resources/circuit_database/circom/multiplier2
sindri.json
{
"$schema": "https://sindri.app/api/v1/sindri-manifest-schema.json",
"name": "EDIT-NAME",
"circuitPath": "./circuit.circom",
"circuitType": "circom",
"curve": "bn254",
"provingScheme": "groth16",
"witnessCompiler": "c++"
}
#nvm use 20 # I tested with this npm version
npx sindri@latest deploy
npx sindri@latest proof create --input input.json
Create a python script file.
script.python
from sindri import Sindri
sindri = Sindri("sindri_YOUR_SINDRI_API_KEY", verbose_level=2)
x = sindri.get_proof(
"YOUR-PROOF-ID",
True,
True,
True,
False
)
Now we can get the proof.
pip install sindri
python3 script.py
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
interface IVerifier {
function verifyProof(
uint[2] memory a,
uint[2][2] memory b,
uint[2] memory c,
uint[1] memory input
) external view returns (bool r);
}
contract CustomLogic {
uint public verifyCount;
address verifierAddress;
constructor(address verifierAddress_) {
verifierAddress = verifierAddress_;
}
function verifyProof(
uint[2] memory a,
uint[2][2] memory b,
uint[2] memory c,
uint[1] memory input
) public
{
require(IVerifier(verifierAddress).verifyProof(a, b, c, input), "Invalid proof");
verifyCount += 1;
}
}
Learn more on the official docs: https://sindri.app/docs/quick-start/