risc0 icon indicating copy to clipboard operation
risc0 copied to clipboard

Is it necessary to execute before generating proof

Open Subway2023 opened this issue 11 months ago • 2 comments

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

1734607401384 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)

Subway2023 avatar Dec 19 '24 11:12 Subway2023

The prover takes an ExecutorEnv and uses it to execute the program bring proving it.

saurik avatar Dec 24 '24 19:12 saurik