2024-07-15 16:51:21 +04:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
2024-07-16 14:54:34 +04:00
|
|
|
/// for public inputs `nf` (nullifier), `root_cm` (root of merkle tree over commitment set) and `death_cm` (commitment to death constraint).
|
2024-07-15 16:51:21 +04:00
|
|
|
/// the prover has knowledge of `output = (note, nf_pk, nonce)`, `nf` and `path` s.t. that the following constraints hold
|
|
|
|
|
/// 0. nf_pk = hash(nf_sk)
|
|
|
|
|
/// 1. nf = hash(nonce||nf_sk)
|
|
|
|
|
/// 2. note_cm = output_commitment(output)
|
|
|
|
|
/// 3. verify_merkle_path(note_cm, root, path)
|
2024-07-16 14:54:34 +04:00
|
|
|
/// 4. death_cm = death_commitment(note.death_constraint)
|
2024-07-15 16:51:21 +04:00
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
2024-07-16 14:54:34 +04:00
|
|
|
pub struct InputPublic {
|
2024-07-15 16:51:21 +04:00
|
|
|
pub cm_root: [u8; 32],
|
|
|
|
|
pub nf: cl::Nullifier,
|
2024-07-16 14:54:34 +04:00
|
|
|
pub death_cm: cl::DeathCommitment,
|
2024-07-15 16:51:21 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
2024-07-16 14:54:34 +04:00
|
|
|
pub struct InputPrivate {
|
2024-07-15 16:51:21 +04:00
|
|
|
pub nf_sk: cl::NullifierSecret,
|
|
|
|
|
pub output: cl::OutputWitness,
|
|
|
|
|
pub cm_path: Vec<cl::merkle::PathNode>,
|
|
|
|
|
}
|