Replies: 2 comments
-
Forest of treaps won't work, because splitting them back up needs to be done by
|
Beta Was this translation helpful? Give feedback.
-
I think I figured out how to remove the trade-off of increasing compute The header This means that each peer has When compressing proofs of non-inclusion, a user would use |
Beta Was this translation helpful? Give feedback.
-
Proving validity of closing a seal includes proving non-inclusion of it's closing in all previous headers after it's open. It should be possible to reduce the amount of proofs by a constant$K$ multiplier if a single proof of non-inclusion can be created for $K$ consecutive headers.
To achieve that, a new Merkle tree big-PMT is defined that holds in it's leaves pairs of$t - K + 1$ to $t$ for header $t$ where the
(unique_id, header_index)
for eachunique_id
included in the headers fromheader_index
is an index of the header including thatunique_id
. (if for some reason a singleunique_id
is used multiple times, the smallestheader_index
is used). Big-PMT's root and height should also be included in the header.Big-PMT can be used to prove non-inclusion of the seal in the intersection of it's history and big-PMT's headers. A proof of non-inclusion for a seal for all of it's history thus can be proved with any number of big-PMTs (and regular PMTs) that exhaustively cover lifetime of the seal, but may overlap with each other or extend before or after seal's lifetime. A proof of inclusion
(unique_id, header_index)
in the big-PMT actually gives the proof of non-inclusion in[t - K + 1; header_index - 1]
allowing us to use big-PMT that ends after a seal's lifetime for non-inclusion proofs.That big-PMT is quite big indeed and there is one for each header, but there is no need to store full tree explicitly in memory even by miners producing it, but all peers are still required to keep at least all$K$ regular PMTs and an ordered set of $H - log(K)$ layers of the big-PMT which all the peers also keep (where $H$ is the height of the full big-PMT). That amount of layers is chosen such that this top part is no larger than biggest regular PMT that it includes so the data transferred over-the-wire is not impacted too much.
(unique_id, header_index)
pairs. When a miner creates a new header and it's PMT it should not discard and publish topWhen peers receive a header and corresponding PMT and the top part of the big-PMT, the PMT is verified to have the same root as in the header and this also should be done for the big-PMT. To check the big-PMT, first, its checked that the top part is correct assuming valid leaves and then all the leaves are checked. A leaf in that top part of big-PMT is a root in a small subtree. A peer needs to find all
(unique_id, header_index)
pairs included into that subtree. To make it efficient, we can modify example formula for the slot from the paper (slot_id = unique_id % 2^h
) toslot_id = unique_id >> (256 - h)
for 256-bit ids integer type. This formula preserves the order of(unique_id, header_index)
pairs for anyh
allowing for a quick retrieval of all the pairs that are included into the subtree of big-PMT. The subtree is recreated and checked against the leaf of the top part of big-PMT after which it can be discarded again.To generate a proof for big-PMT, the subtree into which the seal would land is recreated the same way as during checking and with the path from the stored top part of that big-PMT it gives us full proof. To efficiently find all elements of that subtree for some old big-PMT if more than$K$ PMTs and big-PMT tops are stored with minimal memory overhead we
can use a forest of treaps as our ordered set storing the$O(K \times log(N))$ , find all the elements with two bin searches and split it all back up for the same time complexity as merge.Fix is in the next comment.(unique_id, header_index)
pairs. A treap for each header. Whenever we need to find the elements in a subtree of some big-PMT we merge all treaps corresponding to headers represented in that big-PMT forIf a big-PMT tree is constructed faultily the proof of that is very short: either a reference to the wrong value of a node in the top part of the tree or just the wrongly constructed subtree. This proof of faulty big-PMT can also be checked quickly be other peers making rejecting a header with faulty big-PMT root value relatively smooth.
This proposal has following trade-offs it makes:
But the benefit is compression of the proofs needed to be stored by users and uploaded on ownership transfer.$T$ consecutive non-use headers would require just $\lceil \frac{T}{K} \rceil$ proofs.
As for the zero-knowledge proofs, my uneducated guess is that it would significantly speed up history compression, just from reducing the size of proofs to compress while preserving the structure of the proofs (big-PMT proofs are the same as PMT proofs, just a bit longer).
Beta Was this translation helpful? Give feedback.
All reactions