Last updated: v0.0.1
Find instructions on how to operate a network here
This document serves as a temporary documentation sheet for the zk-node and api.
Overview of proof datastructures for noir
and circom
.
Proof | |
---|---|
CircomProof | NoirProof |
CircomProof | NoirProof |
---|---|
hash | hash |
vk | verifier |
inputs | |
proof | proof |
circuit | circuit |
hash
: The hash identifier of a proof (used by eventstream/logger)
vk
: verifying key
inputs
/ verifier
: public inputs to the circuit
proof
: the snark proof to be verifier
circuit
: the identifier of the associated circuit
Supported circuits as of v0.0.1
multiplier
multiplier
signature
test
Every proof is stored using the Storage
module in the associated database (e.g. circom.db
, noir.db
, ...):
impl UniversalStorage for Storage {
fn create(&self) -> Result<()> {
let conn = Connection::open(&self.path)?;
conn.execute(
"CREATE TABLE IF NOT EXISTS data (
id INTEGER PRIMARY KEY,
hash TEXT NOT NULL,
proof TEXT NOT NULL
)",
[],
)?;
Ok(())
}
}
The asynchronous receiver handles proofs for any supported backend in a tokio runtime:
#[async_trait]
impl NoirThread for Thread{
tokio::spawn(async move {
... // backend specific verifier construction
thread.store_blocking(storer.clone(), proof.clone()).await;
thread.gossip_blocking().await;
...
});
}
#[async_trait]
impl CircomThread for Thread{
async fn spawn(&self, storer: Storage){
tokio::spawn(async move {
... // backend specific verifier construction
thread.store_blocking(storer.clone(), proof.clone()).await;
thread.gossip_blocking().await;
...
});
}
}
Proofs are submitted and retrieved via the rocket v0.5.0
API.
See mock_client
for examples.
Using the ProverCli:
let response: reqwest::blocking::Response = ProverCli::submit(&cli, proof_message_serialized).unwrap();
assert!(response.status().is_success());
all proofs are serialized using serde_json
and matched by the receiver to identify the backend they were created for and verify them accordingly.
List of routes:
/qcircom?<id>
/qnoir?<id>
# Supported Backends
- noir (binary)
tested with nargo `v0.15.0`
- circom (arkworks / Rust)