Last updated
Last updated
In the following page, we detail all the steps required for a protocol to integrate with Quantum. We use the circuit as an example throughout the demo.
Firstly, install quantum-sdk
in your project:
Now, assuming that the circuit's proving key, and verification key files have been generated following the steps detailed in , the next step is to register the verification key file.
The circuit_hash
received above is basically an identifier for this circuit, and here onward any interactions for this circuit will be done using this circuit_hash
.
Next, we check if the circuit registration is complete.
The proof_hash
received above will be used to check the status of the proof.
To check if a proof has been aggregated and submitted on chain:
When an aggregated proof is submitted on chain, all the individual proofs’ public inputs are arranged in a merkle tree and it's root is stored on chain. The merkle proof for the same is used to verify validity of public inputs on-chain. It can be retrieved as follows:
With this, we have completed the integration of Quantum with this protocol. If you are still facing any problems in integrating Quantum with your protocol, please reach out to us.
Next, we will submit a proof to Quantum for aggregation. After the protocol has generated proof.json
and public.json
files through either or , they can submit the proof to quantum as follows:
To verify public inputs on chain, the protocol needs to make slight changes to their contract, which are summarised below. We demonstrate by making changes to contract.