use verity_client::client::{VerityClient, VerityClientConfig};
use verity_verify_remote::{
config::Config,
ic::{Verifier, DEFAULT_IC_GATEWAY_LOCAL},
};
use verity_verify_tls::verify_proof;
// use verity_dp_zk_host::generate_groth16_proof;
pub const DEFAULT_PROVER_URL: &str = "http://127.0.0.1:8080";
pub const DEFAULT_VERITY_VERIFIER_ID: &str = "bkyz2-fmaaa-aaaaa-qaaaq-cai";
/// The input parameters for the zk_circuit
///
/// Contains the details needed for proof verification
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ZkInputParam {
/// Session header information
pub tls_proof: String,
/// Proof of substrings
pub remote_verifier_proof: String,
/// Remote verifier's ECDSA public key
pub remote_verifier_public_key: String,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct RemoteVerificationProof {
pub results: Vec<String>,
pub root: String,
pub signature: String,
}
#[tokio::main()]
async fn main() -> anyhow::Result<()> {
env::set_var("RISC0_DEV_MODE", "1"); // Included to ensure the zkVM prover is fast for demo purposes.
// Initialize tracing. In order to view logs, run `RUST_LOG=info cargo run`
tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::filter::EnvFilter::from_default_env())
.init();
// Entry point of the program
println!("Hello Verity zkTLS Demo!");
// -------------------- // THE PLAN // ------------------------
// Generate a TLS attestation using Verity Client
// Pepare the TLS proof for the guest
// Call the zkVM guest for zkSNARK
// Verify the SNARK
// -------------------- // THE PLAN // ------------------------
println!("Proving a GET request using VerityClient...");
let config = VerityClientConfig {
prover_url: String::from(DEFAULT_PROVER_URL),
};
let client = VerityClient::new(config);