You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unused public key parameter in stateless code #2448
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.
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:
Yes, let's remove it since it isn't strictly required.
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!
@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?
@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.
Activity
jsign commentedon Mar 9, 2026
Sharing a bit more thoughts about this since it might be useful for people without enough context.
The
public_keysfield in theStatelessInputisn'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:
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 specStatelessInputinterface -- 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!
github-actions commentedon May 10, 2026
This issue has had no recent activity and has been marked as stale.
jsign commentedon May 10, 2026
Not stale, currently addressed in #2825
jsign commentedon May 11, 2026
Done in #2825
DavePearce commentedon Oct 15, 2026
@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?
jsign commentedon Oct 15, 2026
@DavePearce, hey!, for now, we don't expect guests to keep applying it. Once done correctly, it just isn't worth having.
y_parity, since a plain verify accepts two keys per signature. With the currentzkvm_secp256k1_verify, the only compliant option is recover-and-compare, which costs the same as having no hint.So we dropped
pub_keys. More details in this Discord thread.