Skip to content

Conversation

@fl0rek
Copy link

@fl0rek fl0rek commented Jan 23, 2025

Needs more robust testing and cleanup. Program part should be mostly done, wanted to share and get early comments.

// https://docs.rs/sp1-prover/3.0.0-rc1/src/sp1_prover/types.rs.html#56
let vkey_digest_bn254 = babybears_to_bn254(&proof_vkey_hash);
let vkey_digest_bytes32 = format!("0x{:0>64}", vkey_digest_bn254.as_canonical_biguint().to_str_radix(16));
Groth16Verifier::verify(&proof, &recursive_input.public_values, &vkey_digest_bytes32, &sp1_key).expect("groth16 verification failed");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SP1 key is read from the input, but the program vkey is either hardcoded one of the v1 ELF, or current one; so this seems safe?

flake.nix Outdated

RUSTC_VERSION = overrides.toolchain.channel;

# https://github.com/rust-lang/rust-bindgen#environment-variables
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this and further magic you do to make bindgen work nice can be achieved by just adding pkgs.rustPlatform.bindgenHook to build inputs

flake.nix Outdated
buildInputs = with pkgs; [
clang
llvmPackages.bintools
rustup
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should just use Fenix instead, it has fromRustToolchainFile or similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants