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

[Feature]: Verify public accounts' details #306

Open
polydez opened this issue Apr 8, 2024 · 1 comment
Open

[Feature]: Verify public accounts' details #306

polydez opened this issue Apr 8, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@polydez
Copy link
Contributor

polydez commented Apr 8, 2024

To whom is this feature for?

End user

Why is is this feature needed?

From @bobbinth:

The main open question is how to verify that the account details included with a public account are valid. The most problematic part of this is to verify account delta for existing accounts. Ideally, this should be happening in the RPC so that a proven transaction with malformed account delta would not make it into the block producer. But I'm not seeing an efficient way of doing this. So, the current approach is fine, but let's create an issue to figure out how to validate account delta more holistically.

How is this feature used?

Verify in RPC (in SubmitProvenTransaction endpoint).

Anything else?

No response

@polydez polydez added the enhancement New feature or request label Apr 8, 2024
@bobbinth
Copy link
Contributor

bobbinth commented Apr 9, 2024

The ideal solution for this would be to output hash of the delta from transaction proof. This way, the only thing the RPC endpoint would need to do is hash the delta and make sure that the hash matches the expected delta hash.

To support this, we'll need to modify the transaction kernel in miden-base. Specifically, we need 2 things:

  1. As account is updated, we need to record the updates in some region of the kernel's memory. This may get tricky as we'd want to avoid recording duplicate updates (i.e., setting value of some storage slot twice, or even updating a storage slot and then reseting it to the original value).
  2. In the epilogue of the transaction runtime, we'd need to compute the hash of the delta (only for public accounts). This should be pretty easy to do once the first point is implemented.

Let's create an issue in miden-base for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants