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

Add ZK accounts overview. #169

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

adlerjohn
Copy link
Member

No description provided.

Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so so so helpful, thank you!


A sketch of a ZK account protocol is actually surpisingly simple. A ZK account is a special account type in the Celestia state machine that is associated with a _verification key_, which uniquely represents a program whose execution over inputs can be verified. The program is entirely determined by the user, and does not require specific enshrinement in the Celestia state machine.

Spending from the ZK account (equivalently, advancing the state of the ZK account) is done through a transaction that provides a proof against the current ZK account state. If the proof is correctly verified, the funds of the account are unlocked and spendable as defined in the transaction. Inputs to the proof verifier depend on the specific application of the ZK account (detailed in the following section), which can be defined at account creation time or at transaction sending time. In the simplest form, inputs could be a public key and a nonce—sufficiency of TIA balance would have to be enforced by the Celestia state machine.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[no change needed][question for curiosity]

Spending from the ZK account (equivalently, advancing the state of the ZK account) is done through a transaction that provides a proof against the current ZK account state.

Do ZK accounts have the notion of a nonce (a.k.a sequence number)? If not, how do consensus nodes determine which transaction to include if they observe two distinct transactions with valid proofs against the current ZK account state.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They could, or they could not. This begs the question of who pays the gas for the transaction. It would presumably be from an EOA, sending a message to the ZK account. Should that be clarified here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO doesn't need to be clarified here b/c this reads well without those details.

@adlerjohn adlerjohn marked this pull request as ready for review July 17, 2024 15:28
@rootulp rootulp merged commit 33749aa into celestiaorg:main Jul 17, 2024
8 checks passed
@adlerjohn adlerjohn deleted the adlerjohn/zk_accounts_overview branch July 17, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants