Skip to content

Add SP1 proof public_values to typed interop proof model #223

@Freyskeyd

Description

@Freyskeyd

Summary

agglayer_interop_types::aggchain_proof::Proof should carry SP1 proof public_values in addition to proof bytes, verifying key, and version.

Agglayer is moving toward proto::Proof as the canonical persisted proof envelope. That envelope already includes a public_values field, but the current typed proof model in interop has nowhere to store it. As a result, conversions that go through the typed proof boundary can silently drop SP1 public_values on a store/load roundtrip.

Why It Matters

Agglayer runtime code uses SP1 proof public_values after loading persisted proofs. For example:

  • agglayer-rpc derives settled_pp_root from sp1_proof.public_values
  • settlement / notifier code deserializes proof output from proof.public_values

If the canonical storage representation preserves public_values but the typed interop proof does not, then:

  1. a proof can be persisted through the canonical envelope
  2. converted into the interop typed proof
  3. converted back later
  4. and lose its public_values

That makes the proof conversion boundary lossy and can break consumers that expect SP1 proof outputs to remain available after reload.

Current Gap

Today the typed aggchain proof model carries aggchain-level public_values in higher-level structures, but the lower-level typed proof (agglayer_interop_types::aggchain_proof::Proof) does not appear to carry proof-level SP1 public_values.

Proposed Change

Extend the interop typed proof model so an SP1 proof includes its public_values as first-class data, alongside:

  • proof bytes
  • verifying key
  • version

This should be reflected in:

  • the typed proof structure(s)
  • conversions to/from any canonical wire or storage envelopes
  • regression tests that prove SP1 proof public_values survive roundtrips

Acceptance Criteria

  • agglayer_interop_types::aggchain_proof::Proof can represent SP1 public_values
  • roundtrip conversions preserve public_values without loss
  • tests cover store/load or wire roundtrips with non-empty SP1 public_values
  • downstream consumers can rely on reloaded SP1 proofs exposing the same public_values they had before persistence

Related Context

This was identified while reviewing Agglayer storage proof conversion, where proto::Proof already includes public_values and is intended to become the base proof representation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions