Skip to content

Allow simulating unsigned transactions #4279

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

Open
kristovatlas opened this issue May 14, 2025 · 6 comments
Open

Allow simulating unsigned transactions #4279

kristovatlas opened this issue May 14, 2025 · 6 comments

Comments

@kristovatlas
Copy link
Contributor

Description

We have a UX challenge currently in which a user must sign a transaction using a key with funds in order to estimate gas for the transaction.

The proposed solution from today's Contributor call was to modify gnokey logic as follows:

  • If the user signed -> verify with their address / sig
  • If the user didn't sign -> use real simulate mode, no real verifications
@kristovatlas
Copy link
Contributor Author

@zivkovicmilos

@kristovatlas
Copy link
Contributor Author

@jefft0

@zivkovicmilos zivkovicmilos changed the title Allow gnokey to simulate unsigned transactions Allow simulating unsigned transactions May 14, 2025
@moul
Copy link
Member

moul commented May 14, 2025

Is that really what we said? I think we said we just want to expect a valid signature, nope?

@jefft0
Copy link
Contributor

jefft0 commented May 14, 2025

Is that really what we said? I think we said we just want to expect a valid signature, nope?

I thought we said that the Signature should have the correct PubKey (to simulate as the correct user) but that the signature bytes won't be checked.

@jefft0
Copy link
Contributor

jefft0 commented May 16, 2025

Good news. It's already the case that the GnoVM only verifies the transaction signature if not simulating. To estimate gas, the transaction only needs the public key, not the signature bytes. No need to get permission unlock the private key and sign. We did a PR to take advantage of this in Gno Native Kit (used by Gnokey Mobile).

If this makes sense, I think we can close this issue as resolved.

@zivkovicmilos
Copy link
Member

@jefft0
Let's keep this issue open 🙏

This is not really the UX we want, or expect.

The ideal flow is, when simulating:

  • user signed a transaction -> use the signature and the user's account (for funds)
  • user didn't sign a transaction -> consider execution is funded, skip signature verification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

4 participants