This commit is contained in:
Sergio Chouhy 2025-09-24 12:08:04 -03:00
parent ec55e00049
commit 87115cf755
2 changed files with 11 additions and 2 deletions

View File

@ -1,10 +1,12 @@
use std::time::Instant;
use nssa_core::{
MembershipProof, NullifierPublicKey, NullifierSecretKey, PrivacyPreservingCircuitInput,
PrivacyPreservingCircuitOutput, SharedSecretKey,
account::AccountWithMetadata,
program::{InstructionData, ProgramOutput},
};
use risc0_zkvm::{ExecutorEnv, InnerReceipt, Receipt, default_prover};
use risc0_zkvm::{default_prover, ExecutorEnv, InnerReceipt, ProverOpts, Receipt};
use crate::{error::NssaError, program::Program};
@ -47,11 +49,16 @@ pub fn execute_and_prove(
env_builder.write(&circuit_input).unwrap();
let env = env_builder.build().unwrap();
let prover = default_prover();
let now = Instant::now();
let opts = ProverOpts::groth16();
let prove_info = prover
.prove(env, PRIVACY_PRESERVING_CIRCUIT_ELF)
.prove_with_opts(env, PRIVACY_PRESERVING_CIRCUIT_ELF, &opts)
.map_err(|e| NssaError::CircuitProvingError(e.to_string()))?;
println!("Proving time (groth16 wrapped): {:?}", now.elapsed());
let proof = Proof(borsh::to_vec(&prove_info.receipt.inner)?);
println!("Proof size (groth16 wrapped): {:?}", proof.0.len());
let circuit_output: PrivacyPreservingCircuitOutput = prove_info
.receipt

View File

@ -99,9 +99,11 @@ impl WalletCore {
let Ok(nonces) = self.get_accounts_nonces(vec![from]).await else {
return Err(ExecutionFailureKind::SequencerError);
};
println!("nonces: {:?}", nonces);
let addresses = vec![from, to];
let program_id = nssa::program::Program::authenticated_transfer_program().id();
println!("program id: {:?}", program_id);
let message = nssa::public_transaction::Message::try_new(
program_id,
addresses,