Integration
For the beta version of the protocol the access to Quantum is permissioned. Every permissioned protocol is give an AUTH_KEY and a npm package to communicate with quantum layer rpc endpoint. To get whitelisted and get your key reach out to @garvit_electron on Telegram.
Initialise Connection:
After installing the npm package, quantum
client helps you interact with the quantum server seamlessly.
Primarily before interacting with server you will need to establish connection.
Check if quantum instance is able to talk with the server. If rpcLive
is True
that means connection is established.
Circuit Registration
Quantum layer right now supports Groth16, Gnark-groth16, Plonky2 and Halo2-KZG proofs. Only thing required to register a circuit from user is verification_key
If the circuit_id
is successfully returned that means circuit was registered successfully. circuit_id
is hash of verification_key and is used to send proofs to the server for aggregation.
Proof Submission
To submit a proof for cheap verification on Ethereum, user sends proof corresponding public_inputs and circuit_id
. If proof is successfully submitted proof_id
is returned from rpc server.
proof_id
is used to track the progress or get details of the aggregation request.
status
contains of various fields explained below:
Proof Not Found | Proof Submitted | Proof Aggregated | Superproof Verified | |
---|---|---|---|---|
state | 0 | 1 | 2 | 3 |
eta (estimated time until verification on ethereum in milliseconds) | 0 | time in ms | time in ms | 0 |
superproof_id | 0 | id | id | id |
transaction_hash | 0x | 0x | 0x | hash |
verification_contract | 0x | eth_address | eth_address | eth_address |
On-Chain Verification
For protocols to integrate quantum
they would have to make some changes to their verification smart contract. The changes required are described below:
Before Quantum Integration (>250K Gas):
The above contract is a standard zk proof verification contract, where a verifier takes in a proof and public inputs and return True
or False
.
Since quantum contract stores the keccak-hash of last verified publicInputs corresponding to a circuit_id
, all you need to send is publicInputs and match the keccak-hash from quantum verifier contract state.
After Quantum Integration (~30K Gas):
Last updated