0xMiden / 0xMiden/protocol

Merkelize the transactions in a block

オープン
#1,257 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
kernels
主要言語
Rust
スター
132
フォーク
167
平均マージ
1日 23時間
マージ済み PR(30日)
110

説明

As mentioned in #1069, it may be useful to have the block header commit to transactions in a merkle tree to allow for simple inclusion proofs of transactions in a block. Currently the block header commits to transactions as a sequential hash, which makes proving inclusion possible but requires providing the complete list of `(TransactionId, AccountId)` tuples. Using a tree makes this easier, but I'm not sure yet whether it's worth the cost.

This is generally useful to, for example, enable revealing a private transaction to some third party and prove that it was included in some block.

- The use case I had in mind initially was that it would allow proving that some note was created by an account, but that fact is already established as part of `NoteMetadata::sender` and could be proven that way (i.e. with an inclusion proof in a block's note tree).
- Another use case may be proving that some note was consumed by an account by proving the inclusion of the transaction that consumed it.
- Another use case could be to help establish the duration of holding funds by proving which transactions (and when) moved them.
- Another use case could be chained transactions. For example, if TX `A` produces a note `X` and TX `B` consumes note `X` in the same batch, then the overall batch won't have `X` as an output note. It would still be useful for someone to be able to prove that their transaction produced note `X`.

One question is how this tree is built and by whom (as mentioned in https://github.com/0xPolygonMiden/miden-base/issues/1069#issuecomment-2727042849). One idea is that the batch kernel could build a tree of its transactions and the block kernel could aggregate those trees into a larger one, similar to how batch note tree and block note tree interact.

> I think one question we'll need to answer here is whether the tree should be of fixed size, and if so, what should the size be. For notes, the tree at the batch level is 10 levels deep - and so this naturally imposes a limit of 1024 notes per batch. We could probably impose a similar limit on transactions.
> https://github.com/0xPolygonMiden/miden-base/issues/1121#issuecomment-2735038375

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。