mirror of https://github.com/vacp2p/zerokit.git
docs(rln): comments and notes
This commit is contained in:
parent
6b3be4438e
commit
cb38360311
|
@ -77,6 +77,11 @@ fn ark_to_bigint(n: Field) -> BigInt {
|
|||
n.to_bigint().expect("conversion always succeeds for uint")
|
||||
}
|
||||
|
||||
// XXX This is different from zk-kit API:
|
||||
// const witness = RLN.genWitness(secretHash, merkleProof, epoch, signal, rlnIdentifier)
|
||||
// const fullProof = await RLN.genProof(witness, wasmFilePath, finalZkeyPath)
|
||||
//
|
||||
|
||||
/// Generates a semaphore proof
|
||||
///
|
||||
/// # Errors
|
||||
|
@ -90,6 +95,15 @@ pub fn generate_proof(
|
|||
) -> Result<Proof<Bn<Parameters>>, ProofError> {
|
||||
let external_nullifier = hash_external_nullifier(external_nullifier);
|
||||
let signal = hash_signal(signal);
|
||||
// TODO Fix inputs
|
||||
// Semaphore genWitness corresponds to these
|
||||
// RLN different, should be:
|
||||
// identity_secret
|
||||
// path_elements (merkleProof.siblings))
|
||||
// identity_path_index (merkleProof.pathIndices)
|
||||
// x (RLN.genSignalHash(signal), assuming shouldHash is true)
|
||||
// epoch
|
||||
// rln_identifier
|
||||
let inputs = [
|
||||
("identityNullifier", vec![identity.nullifier]),
|
||||
("identityTrapdoor", vec![identity.trapdoor]),
|
||||
|
|
|
@ -25,17 +25,17 @@ use num_bigint::BigInt;
|
|||
use serde::Deserialize;
|
||||
use serde_json;
|
||||
|
||||
// XXX
|
||||
use bellman::pairing::ff::{Field, PrimeField, PrimeFieldRepr, ScalarEngine};
|
||||
use sapling_crypto::bellman::pairing::bn256::Bn256;
|
||||
// For RLN Rust version
|
||||
//use bellman::pairing::ff::{Field, PrimeField, PrimeFieldRepr, ScalarEngine};
|
||||
//use sapling_crypto::bellman::pairing::bn256::Bn256;
|
||||
|
||||
// TODO Add Engine here? i.e. <E: Engine> not <Bn254>
|
||||
// NOTE Bn254 vs Bn256 mismatch! Tree is originally Bn256
|
||||
// TODO Figure out Bn254 vs Bn256 mismatch
|
||||
// TODO Assuming we want to use IncrementalMerkleTree, figure out type/trait conversions
|
||||
// TODO Adopt to new protocol structure
|
||||
pub struct RLN {
|
||||
circom: CircomCircuit<Bn254>,
|
||||
params: ProvingKey<Bn254>,
|
||||
// TODO Replace Bn256 with Bn254 here
|
||||
// RLN Rust version
|
||||
//tree: IncrementalMerkleTree<Bn256>,
|
||||
tree: PoseidonTree,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue