risc0
risc0 copied to clipboard
Is it necessary to execute before generating proof
Is there an existing issue?
- [X] I have searched the existing issues
Experiencing problems? Have you tried our Discord first?
- [x] This is not a support question.
Motivation
The images in the blog show the results that need to be executed in the process of generating proof. But I don't think the specific program is like that.
fn main() {
tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::filter::EnvFilter::from_default_env())
.init();
let input: u32 = 15 * u32::pow(2, 27) + 1;
let env = ExecutorEnv::builder()
.write(&input)
.unwrap()
.build()
.unwrap();
let prover = default_prover();
let prove_info = prover
.prove(env, HELLO_GUEST_ELF)
.unwrap();
let receipt = prove_info.receipt;
let _output: u32 = receipt.journal.decode().unwrap();
receipt
.verify(HELLO_GUEST_ID)
.unwrap();
}
In this case program, there is no need to execute the program before generating the proof. So how to ensure that the proof meets the execution results
Request
None
Solution
None
Are you willing to help with this request?
Maybe... (I have elaborated on how above)
The prover takes an ExecutorEnv and uses it to execute the program bring proving it.