Skip to content

Unused public key parameter in stateless code #2448

Closed

Description

@kevaundray

Problem

Stateless verification includes the public key as a parameter in StatelessInput, however this is not used anywhere. The idea here is that the guest program would do a signature verification and avoid doing ecrecover, if the public key has been supplied.

Suggestion

Explore ways to allow this to be specced out in a non-invasive way. perhaps the stf separates signature verification from exeution and we do it our own way in the stateless code.

Activity

  1. jsign commented on Mar 9, 2026

    @jsign
    Contributor

    Sharing a bit more thoughts about this since it might be useful for people without enough context.

    The public_keys field in the StatelessInput isn't strictly required for a minimal guest program. It is an optimisation that offloads work from the guest program, which helps with proof times. So, this field is somewhat special in that it is "optimization" related.

    The most natural question is: why not remove this from the spec?

    I think there could be two potential answers:

    1. Yes, let's remove it since it isn't strictly required.
    2. This optimization is a low-hanging fruit optimization that probably 100% of guest program will apply even if not formally specified. If that's the case, if we don't include it in the spec then we might have blindspots in the testing area.

    I think both Kev and I lean more towards opinion 2, which is why we already added it to StatelessInput (despite not being used yet). Our thinking process is that we want guest programs to comply with the spec StatelessInput interface -- if we go "too naive" not including at least low-hanging fruit optimisations, then we might increase the risk of guest programs having parallel designs that transform from the canonical one (our specs) to the "real one" which might created testing blindspots.

    Just sharing a bit more the rationale about this topic here!

  2. added
    zkEVM
    on Mar 9, 2026
  3. github-actions commented on May 10, 2026

    @github-actions
    Contributor

    This issue has had no recent activity and has been marked as stale.

  4. added
    stale
    on May 10, 2026
  5. jsign commented on May 10, 2026

    @jsign
    Contributor

    Not stale, currently addressed in #2825

  6. removed
    stale
    on May 10, 2026
  7. jsign commented on May 11, 2026

    @jsign
    Contributor

    Done in #2825

  8. DavePearce commented on Oct 15, 2026

    @DavePearce

    @jsign Can I ask why you ended up reversing this decision in #3652? Is the expectation that guests can still apply this optimisation, but that its just not specified?

  9. jsign commented on Oct 15, 2026

    @jsign
    Contributor

    @DavePearce, hey!, for now, we don't expect guests to keep applying it. Once done correctly, it just isn't worth having.

    • Using the hinted key soundly requires checking it against y_parity, since a plain verify accepts two keys per signature. With the current zkvm_secp256k1_verify, the only compliant option is recover-and-compare, which costs the same as having no hint.
    • A proper verify-with-recovery-id primitive would save <1% of ecrecover. Ecrecover itself is only ~1.4–1.6% of block proving cost, and the hint adds ~65 bytes of input per tx.

    So we dropped pub_keys. More details in this Discord thread.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    zkEVM

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions