Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SP1PublicValues handling for the aggregation proof #727

Open
shriphani opened this issue May 13, 2024 · 0 comments
Open

SP1PublicValues handling for the aggregation proof #727

shriphani opened this issue May 13, 2024 · 0 comments
Labels
other An issue that doesn't fall into a common category rust Pull requests that update Rust code showcase A program to showcase SP1's capabilities stale This PR or issue has been stale for some time.

Comments

@shriphani
Copy link

The aggregation proof serializes the buffer of an SP1PublicValues as a Vec<u8> and sends it over to the guest. If the guest wants to read the actual program output, it needs to use bincode::read on this value. Ideally the user shouldn't have to explicitly reference both values. Can we expose SP1PublicValues or some other object where we can do the following:

Host:

let proof1 = ...; // an existing proof

// write proof1 public values to guest
aggregation_guest_stdin.write(proof1.public_values);
// also write the vk value

Guest:

let proof: SP1PublicValues = sp1_zkvm::io::read();
sp1_zkvm::precompiles::verify::verify_sp1_proof(program_identifier, proof.digest());
let program_output: OutputStruct = proof.output();

basically, pub use SP1PublicValues so it isn't hidden in sp1_core, and implement a digest and output method for it so guests don't have to clone bincode.

@nhtyy nhtyy added showcase A program to showcase SP1's capabilities rust Pull requests that update Rust code other An issue that doesn't fall into a common category labels Nov 20, 2024
@nhtyy nhtyy added the stale This PR or issue has been stale for some time. label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other An issue that doesn't fall into a common category rust Pull requests that update Rust code showcase A program to showcase SP1's capabilities stale This PR or issue has been stale for some time.
Projects
None yet
Development

No branches or pull requests

2 participants