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

Modify the Groth16 light client to accept different public values #119

Open
rootulp opened this issue Jan 30, 2025 · 0 comments
Open

Modify the Groth16 light client to accept different public values #119

rootulp opened this issue Jan 30, 2025 · 0 comments

Comments

@rootulp
Copy link
Collaborator

rootulp commented Jan 30, 2025

Context

Currently the public values output by blevm differ from the public values expected by the Groth16 light client.

#[derive(Serialize, Deserialize)]
pub struct BlevmAggOutput {
// newest_header_hash is the last block's hash on the EVM roll-up.
// TODO: this may be removable.
pub newest_header_hash: [u8; 32],
// oldest_header_hash is the earliest block's hash on the EVM roll-up.
// TODO: this may be removable.
pub oldest_header_hash: [u8; 32],
// celestia_header_hashes is the range of Celestia blocks that include all
// of the blob data the EVM roll-up has posted from oldest_header_hash to
// newest_header_hash.
pub celestia_header_hashes: Vec<[u8; 32]>, // provided by Celestia state machine (eventually x/header)
// newest_state_root is the computed state root of the EVM roll-up after
// processing blocks from oldest_header_hash to newest_header_hash.
pub newest_state_root: [u8; 32],
// newest_height is the most recent block number of the EVM roll-up.
// TODO: this may be removable.
pub newest_height: u64,
}

// PublicWitness should match the public outputs of the SP1 program.
type PublicWitness struct {
TrustedHeight int64 // Provided by the relayer/user
TrustedCelestiaHeaderHash []byte // Provided by the ZK IBC Client
TrustedRollupStateRoot []byte // Provided by the ZK IBC Client
NewHeight int64 // Provided by the relayer/user
NewRollupStateRoot []byte // Provided by the relayer/user
NewCelestiaHeaderHash []byte // Provided by Celestia State Machine
CodeCommitment []byte // Provided during initialization of the IBC Client
GenesisStateRoot []byte // Provided during initialization of the IBC Client
}

Proposal

Modify the Groth16 light client to accept different public values. This implies multiple SP1 programs, multiple mock SP1 programs, etc.

  • One for RollKit (matches current blevm’s BlevmAggOutput), we need to add support for this
  • One for Sovereign (matches current groth16 PublicWitness)

Note: we may eventually consolidate the two types so that there is one standardized public value struct suitable for both RollKit and Sovereign.

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

No branches or pull requests

1 participant