-
Notifications
You must be signed in to change notification settings - Fork 56
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
Define batch kernel inputs/outputs #919
Comments
The purpose of the batch kernel is to generate a single proof that we've verified some number of proven transactions. This would involve recursively verifying individual transaction proofs, which in turn, would require access to public inputs/outputs of the transaction kernel. As a reminder, these look like:
Where:
Batch kernel inputsProbably the simplest approach is to set batch kernel inputs to a commitment of transactions included in the batch. This could be computed as a sequential hash of Batch kernel outputsPublic outputs of the batch kernel need to include the following:
Account updates commitmentFor each modified account, we need to capture the following information at the minimum:
However, it may be beneficial for forward-lookin purposes, keep track of which transaction resulted in which state. In this case, we could compute the commitment as follows:
If we were to lay this out in terms of words, it would look something like this:
This arrangement also allows us to always hash double words which will be pretty efficient. Input notes commitmentThe simplest way to track input note commitments is to basically use the same scheme as used in the transaction kernel (i.e., hash of
For authenticated notes Output notes commentCommitment to the output notes must be a root of the batch note SMT - so, there isn't much flexibility here. However, if we wanted to track which transaction produce which output note, we'd also need a separate commitment to that. This could be a sequential hash of note data where each note is defined as:
Open questions
|
A potentially simpler option is to rely on the transaction ID commitments to link transactions to accounts, input notes, and output notes. Then, batch kernel inputs/outputs would look roughly like so:
Where:
Conceptually, inputs into the batch kernel would be a set of ordered pub struct VerifiedTransaction {
id: TransactionId,
account_update: TxAccountUpdate,
input_notes: InputNotes<InputNoteCommitment>,
output_notes: OutputNotes,
} A couple of general notes:
|
Is this missing Edit: Ah, this is covered implicitly through the inital and final account hash that goes into each transaction ID within the transactions commitment. That would cover the init/final account state before/after the tx, as well as a commitment to the input and output notes. It's only missing a direct commitment to the account ID, but the ID is committed to by the account hash, so it may be fine? |
Note ErasureI want to make sure I understood the need for TX A: Consumes unauthenticated note X. The And whether we want to have the same "note erasure" mechanism for the block kernel is a question left for when we implement that one. |
You suggested to have pub struct VerifiedTransaction {
id: TransactionId,
account_update: TxAccountUpdate,
input_notes: InputNotes<InputNoteCommitment>,
output_notes: OutputNotes,
} In the
So having If so, I guess |
Yes, this was my thinking - though, there may also be reasons to still include
Yes, correct!
Ideally, we want to have this at the block level as well - but this may have some additional complexities. So, we can evaluate this later.
I'm thinking this is something we may need in the longer term. Basically, right now, a block does not contain enough info to figure out what happened in a given transaction. This is not something that is critical for building blocks, but it would be nice to have this info to show to the user. For example, currently, a transaction in the block explorer looks something like this: But it would be great to show which nullifiers were consumed in the transaction and which output notes were created. We will also probably care about this info anyway in the future when batches may contain duplicate or conflicting transactions and we'd need to manage this conflict resolution in the block kernel (this is not something that'll happen while we are running in a centralized setting - so, not an immediate problem). |
Thanks for explaining the reasoning of Note and Block AuthenticationTo "authenticate" an unauthenticated note in the current transaction batch implementation in the node, we basically only check if a Authenticating a note should work similar as in miden-base/crates/miden-objects/src/transaction/inputs.rs Lines 61 to 76 in 9930c36
I'm wondering how this should work in the batch kernel without a public I'm wondering if we should add a |
Good point! Yes, let's add In the future, we'll also probably need this info for fee purposes. |
What should be done?
Define the kernel inputs and outputs for the batch of transactions.
How should it be done?
To be clarified
When is this task done?
To be clarified
Additional context
No response
The text was updated successfully, but these errors were encountered: