<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Analyzing the Rationality of using Different Merkle Tree Constructions in Blockchain-based Accounting Systems⋆</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Volodymyr Dubinin</string-name>
          <email>dubinin@distributedlab.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Yaroslav Panasenko</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Serhii Volynets</string-name>
          <email>serhii023@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Viktoriia Zhebka</string-name>
          <email>viktoria_zhebka@ukr.net</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dmytro Nishchemenko</string-name>
          <email>dima.nishchemenko@gmail.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Distributed Lab</institution>
          ,
          <addr-line>Kharkiv</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>State University of Information and Communication Technologies</institution>
          ,
          <addr-line>7 Solomyanska str., 03110 Kyiv</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
      </contrib-group>
      <fpage>76</fpage>
      <lpage>95</lpage>
      <abstract>
        <p>This paper provides a comprehensive overview of Merkle trees and their numerous extensions, which are fundamental data structures for ensuring data integrity and authenticity. Beginning with the foundational principles of k-ary Merkle trees, including their construction, membership proof generation, and verification processes, the article systematically explores a wide range of advanced variants. Key extensions such as Sparse Merkle Trees (SMT), Indexed Merkle Trees (IMT), Verkle Trees (VT), and Radix Merkle Trees (RMT) are detailed, alongside specialized implementations like the Merkle Patricia Trie (MPT) and Jellyfish Merkle Tree (JMT). The survey also investigates various optimization techniques aimed at improving storage efficiency, reducing membership proof size, and modifying the underlying logic. The paper concludes with a comparative analysis of these structures, evaluating their algorithmic complexities, trade-offs, and suitability for different applications, thereby serving as a guide for selecting the optimal Merkle-based construction for specific use cases like blockchain, cloud storage, and digital signatures.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Merkle tree</kwd>
        <kwd>data integrity</kwd>
        <kwd>cryptographic hash function</kwd>
        <kwd>blockchain</kwd>
        <kwd>data auditing</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        A Merkle tree was first proposed in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] by Ralph Merkle for Digital Signatures. However, now it is
used in a wide range of applications, allowing the creation of data authenticity proofs. A Merkle
tree is a data structure constructed from hashes of various data blocks arranged in layers in a tree.
The first layer consists of leaves, which are the blocks containing the direct hash of the data blocks.
Then to get the next layer of the tree, those blocks are concatenated and hashed in pairs. The
procedure repeats with the obtained hashes, till a single hash is yielded. Merkle tree can be used for
efficient proofs of data inclusion in the following cases:
      </p>
      <p>
        One can aggregate the quorum of public keys into one root value with the ability to prove
the membership of the particular public key later [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        One can check whether a blockchain transaction is included in the block or not [
        <xref ref-type="bibr" rid="ref3 ref4">3, 4</xref>
        ] (if the
appropriate accounting system presumes building transaction trees).
      </p>
      <p>
        One can confirm the authenticity and the integrity of outsourced data or data block without
the local copy of data files [
        <xref ref-type="bibr" rid="ref3 ref5 ref6 ref7">3, 5–7</xref>
        ].
      </p>
      <p>
        Users can be identified and verified on the IoT in the blockchain network 8[
        <xref ref-type="bibr" rid="ref9">, 9</xref>
        ].
      </p>
      <p>
        One can check whether the data is properly stored in a cloud drive [
        <xref ref-type="bibr" rid="ref10 ref11 ref6">6, 10, 11</xref>
        ].
      </p>
      <p>
        0009-0006-3648-9057 (V. Dubinin); 0009-0004-3588-8617 (Y. Panasenko); 0009-0004-9373-0519 (S. Volynets);
0000-0003-4051-1190 (V. Zhebka); 0009-0006-1781-4109 (D. Nishchemenko)
For the most of the mentioned usages, security is necessary. The tree’s digest computation function
must be irreversible and collision-resistant to make the forging of a tree node by the owner or
third-party adversary improbable, preventing money and/or privacy loss [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
      </p>
      <p>This paper aims to give a comprehensive overview of existing constructions of a Merkle tree
and its modifications for different usages.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Preliminaries</title>
      <p>2.1. Trees
The structure of a Merkle tree is based on the structure of a regular tree, so it is better to start with
general definitions and properties of a tree to feel confident before going to a Merkle tree.</p>
      <p>Definition 2.1 (Graph). A graph G is a tuple G = (V, E), where V is a set whose elements are
called nodes, and E = V × V is a set of pairs (v1, v2) of nodes, whose elements are called edges. The
graph G is unordered, if all the edges have no direction, i.e. the existence of edge (v1, v2) implies
the existence of edge (v2, v1), otherwise, the graph G is called an ordered graph. For the node, v1
the directed edge (v1, v2) is called the outgoing edge, and for a node v2, the edge is called the
ingoing edge. The graph has an order annotated as |G|, which is the number of nodes in a graph, i.e.
|G| = |V|. For the node v in an undirected tree, the order of the node v is a number of edges (v, u),
where u ∈ V. If the tree is ordered, then the order of a node is a number of all edges (v, u) and (w, v),
where u, w ∈ V.</p>
      <p>Definition 2.2 (Tree). A tree T is a connected and acyclic graph, i.e. there is an undirected path
between any pair of vertices and there is no non-empty path from any node to itself without
repeated edges. The leaf in a tree is a node with only one edge, i.e. node of order 1.</p>
      <p>Definition 2.3 (Perfect k-ary tree). A perfect k-ary tree is a tree of some height h with kh
leaves, with non-leaf nodes, which have exactly k child nodes each.</p>
      <p>If we have an ordered graph G, we can define the source node v as a node with only outgoing
edges, and the sink node as a node with only ingoing nodes. For a directed tree T, a sink node is a
leaf node, and the source node is a root node. There exists only one root in a directed tree. The
height of the tree T is the maximum length of a path, i.e. the maximum number of edges, from the
root to any leaf.</p>
      <p>The next thing worth mentioning is that there is a hierarchy, sometimes described in levels. We
will say that the root is located on the 0-th level. Then, we have inner nodes and at the end of each
branch, we have leaves. If the tree is perfect, then leaves are located on the last layer. One can use
definitions of the parent node and child node to describe hierarchical relationships between two
adjacent nodes u and v. Let the node u be located on a n-th level. If the node v is located on level
(n + 1), then the node v is a child node of u and u is a parent node of v. It is well known that the
root has no parents, and leaves have no children.</p>
      <sec id="sec-2-1">
        <title>2.2. Digest functions</title>
        <p>A Merkle tree is constructed from data digests. These digests must be small enough to be stored
efficiently while also providing security for the tree's construction. Cryptographic hash functions
are excellent candidates for this purpose.</p>
        <p>Definition 2.4 (Cryptographic Hash Function). For a function to be considered a cryptographic
hash function H : 0 , 1∗ →0 , 1 n , it must satisfy three fundamental security properties that are critical
to the integrity of data structures such as Merkle trees.</p>
        <p></p>
        <p>Preimage Resistance: This property guarantees that the function is one-sided. For any given
hash output y, it must be computationally infeasible to find any input messagex' for which
H(x′) = y.</p>
        <p>Second-Preimage Resistance: For a given input value x, it must be computationally
infeasible to find another, different input value x' where x≠ x ′ that generates the same
hash, i.e. H(x) = H(x′).</p>
        <p>Collision Resistance: This is the strongest property that makes it computationally infeasible
to find any pair of distinct inputs x and x' that result in an identical hash output H(x) =
= H(x′).</p>
        <p>
          In the context of Merkle trees, collision resistance is of paramount importance [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. Although
resistance to finding a second intro is also an important aspect of security, it is known that collision
resistance formally implies second intro resistance for hash functions [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]. The robustness of these
properties is critical because they serve as the primary defense mechanism against attackers
attempting to falsify nodes and compromise the integrity of the tree.
        </p>
        <p>The hash function can be applied for any string. However, to compute the hash of a set of
strings si, i= 1 , k we compute the hash of the concatenation of that strings, i.e. hash = H(s1||s2||...||
sk) or simply hash = H(s1, s2, ..., sk) or even hash = H(si| i= 1 , k). It is important not to forget that
the order of concatenation affects the final result.</p>
        <p>
          Hash functions aren't the only method for computing digests. An alternative approach involves
using vector commitment schemes [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. Informally, vector commitment schemes [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ] can be
thought of as a digital sealed envelope. When a party (S) wants to commit to a message m, she
places it in the “envelope”. Later, S can open the envelope to publicly reveal the message she
committed to. In their most basic form, commitment schemes must satisfy two key properties. A
commitment must be:
        </p>
        <p>Hiding: The commitment should not reveal any information about the message it contains.
Specifically, an observer should not be able to distinguish whether a commitment was
created for a message m or a different message m', where m≠ m′.</p>
        <p>Binding: The commitment mechanism must prevent the sender (S) from changing her mind
about the committed message m after the fact.</p>
        <p>More precisely, the binding property requires an efficiently verifiable opening procedure. This
allows anyone to quickly check that the opened message is the one S originally committed to.
Thus, a commitment scheme typically involves two phases:</p>
        <p>Commit Phase: A sender (S) creates a commitment (C) for a message (m) using a specific
algorithm.</p>
        <p>Decommit Phase: The sender (S) reveals m and “convinces” a receiver (R) that C is the valid
commitment to m.</p>
        <p>A single commitment can be created for a vector m that contains several messages. Then,
during the decommit phase, S can open just one element of the vector m at a time. A commitment
scheme is considered non-interactive if each phase requires only a single message from S to R.</p>
        <sec id="sec-2-1-1">
          <title>3. Merkle tree</title>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>3.1. Definitions and examples</title>
        <p>
          In general, the structure of the Merkle tree (sometimes named the Merkle hash tree) is similar to an
ordinary tree. Authors and researchers define a Merkle tree differently. That is why the definition
of the Merkle tree varies from article to article. Moreover, some Merkle tree definitions were
different enough to have separate names.
Here, we define a simple and general Merkle tree using [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ] as a reference.
        </p>
        <p>Definition 3.1 (k-ary Merkle tree). An k-ary Merkle tree T = ⟨V, E⟩ is a construction that has
leaf nodes, internal nodes and a root, which are as follows:
1. Leaf nodes contain the direct hash value of data blocks.
2. Internal nodes contain concatenation of k hash values of its k children.
3. Root node is an internal node that has no parents.</p>
        <p>The k-ary Merkle tree T = ⟨V, E⟩ is a tree with the next properties:
1. It is a rooted tree.
2. All the leaves are located on the same level.
3. Each inner node has exactly k children.
4. Duplicated vertices are allowed to meet restrictions.
5. The set of children nodes is ordered set, so digest can be calculated correctly.</p>
        <p>Fig. 1 provides an example of a perfect binary Merkle tree. In contrast, Fig. 2 displays a
nonperfect Merkle tree, illustrating how duplicated nodes are used to calculate the final root hash.
In the Figs. 1 and 2, we can see the main idea of the Merkle tree. Let’s assume that we compute the
digest in a root. Because the digest in the root node depends on all the digest in leaves, any
slightest change in any leaf digest changes the digest in a root. So, if we have the digest in a root,
then we can check if any change is done. One can use it to prove that the element is in a tree, i.e.
there is a leaf node with the element digest in it.</p>
        <p>Here is an example of proving data block 2 membership for the tree in Fig. 1. As the hash of the
searched data block is stored in node 2, we can give the proof consisting of two hash values:
h1= H(D 1) from node 1 and h6 = H(h3||h4) from node 6. To check the proof, we first calculate the
hash in node 2 as h2 = H(D 2) using data D 2 that we know. It is also an option to store the hash h2
and not have the data D 2. Then we calculate h5 = H(h1||h2), the hash value of the concatenation of
node 1 and node 2 hashes, which gives us the hash of node 5, and then calculate h7 = H(h5||h6), the
hash of the concatenation of node 5 and node 6, which provides us with the hash value in a root.
To decide if the data is in the tree, we compare the computed hash in the root node h7 with the real
hash in the root hroot (hroot is the hash we computed previously or get from the trusted source). If
the computed hash in the root matches the real hash in the root, i.e. h7 = hroot, the hash of the data
is in the tree, otherwise, it is not. However, with negligible probability, it can match without the
data inclusion, and the verification procedure will give a false positive result.</p>
        <p>If a malicious Prover wants to prove data block 2 inclusion if it is not in the tree, then the
Prover must find such hashes of block 1 and block 6, that H(H(h1||h2)||h6) = hroot. So the Prover
needs to find a preimage ofhroot or H(h1||h2) of the hash function H, but we assumed before that the
H is preimage-resistant. Another way for a malicious Prover to forge the node is to find a second
preimage D 2 ′ for D 2, such that H(D 2 ′) = H(D 2). Then the Prover can claim that the data D 2 ′ is in
the tree, however it is not. The malicious creator of a Merkle tree can forge the node from the start
by searching any collision D 2 ′ and D 2 ′ ′ with the same hash, and then claim different statements:
the data D 2 ′ is in a tree and the data D 2 ′ ′ is in a tree. Such manipulation of an adversary is a
reason of using the cryptographic hash functions that have appropriate security properties.</p>
        <p>
          The Binary Merkle Tree (BMT) is one of the most commonly used structures among k-ary
Merkle trees. There are other named k-ary trees. For example, Ethereum’s blockchain utilizes a
Patricia-Merkle tree with up to 16 child nodes [
          <xref ref-type="bibr" rid="ref19 ref20">19, 20</xref>
          ]. The next example is the Jellyfish Merkle
Tree proposed in article [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ], which is also a tree of order 16.
        </p>
        <p>The node of a Merkle tree contains references to its children and the digest. The main part of a
Merkle tree that we need to remember is the hash in the root. However, sometimes it’s also
important to store hashes of leaves. If the memory isn’t strictly limited, and it is possible to store all
the nodes, it might be reasonable to append other fields. For example, nodes can have an additional
field parent, which is undefined for the root node. For even more convenience, every node can have
a boolean flag that states whether the node is the left child. For the root, the flag is undefined.
Those fields can aid in constructing algorithms to make them more readable and fast. In our
approach, we assume that all the fields are present unless otherwise specified.</p>
        <p>
          Using notation in [
          <xref ref-type="bibr" rid="ref2 ref22">2, 22</xref>
          ], we can differentiate a node by its level in a tree and its index in a level.
Let N ij denote the node on level j, with index i. Then the tree will be similar to a triangular matrix,
where the next level has twice as many elements as the previous level. This notation is useful
because, in an k-ary tree, we can easily locate descendants of a node N ij. For example, all children
of the node are nodes N kji+1, N kji++11, ... N ki+ k− 1. For a binary tree, two children of N ij are N 2j +i1 and
j+1
N 2j +i+11. can also use the notation with hashed, i.e. hash hj is a hash on jth level on ith place.
        </p>
        <p>
          Author of [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ] introduces us with “Flat Coordinates”. It is a way to identify every node in a tree
by a unique number s ∈ N. The author also gives us algorithms for transforming node coordinates
from N ij to the flat index N s and backward. This approach makes storing the tree in an array
possible. Unfortunately, there is a problem with updating the tree because the appending algorithm
needs to shift the array. However, it can be useful for trees that have fixed sizes. We will N ijuse
notation because it is easier and more human-friendly. The author of [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ] uses “Flat Coordinates”
to implement his Flat Trees. They are like ordinary Merkle trees but use “Flat Coordinates”.
        </p>
      </sec>
      <sec id="sec-2-3">
        <title>3.2. Merkle tree creation</title>
        <p>Algorithm (alg. 1) is a pseudocode that creates a k-ary Merkle tree from an array of values. It will
store the whole tree in the memory. It uses an additional function pad_list(nodes, k) which, for the
given set of nodes with cardinality divisible by k, returns the given set of nodes, or else, returns the
given set with a duplicated last node at the end to make the cardinality of the set divisible by k. If
k= 2, function pad_list(nodes, 2), ensures that the set nodes cardinality is even. It isn’t necessary to
duplicate all the node’s descendants in the pad list function. We need a divisible by k amount of
hashes, so we can duplicate only a hash instead of a node.</p>
        <p>The most resource-consuming operation in the tree creation is hashing. For a perfect binary tree
with n leaves to compute the first layer of nodes, we will compute n hashes, for the next n , and
so on.</p>
        <p>Therefore, the time complexity of Merkle tree creation is
For the perfect k-ary Merkle tree, the claim is similar.</p>
        <p>T ( n) ≈ n+ n + n2 + ...+ 2log(n)&lt; 2 n</p>
        <p>2 2
T ( n) ≈ n+ n + n2 + ...+ klog k(n)&lt; 2 n
k k
(1)
(2)
Algorithm (alg. 1) is inefficient in terms of memory complexity. To be precise, it stores n leaf nodes,
which contain one hash each, and O(n) inner nodes, which contain one hash and k + 1 pointers.
It is useful to know that the height of an k-ary Merkle tree is logk(n). For a binary Merkle tree, the
height is log2(n). It is quite obvious that trees with a bigger arity are shorter and have fewer nodes.
Unfortunately, it doesn’t affect the algorithms a lot. The main effects are implementational.</p>
        <p>Appending of a new element, i.e. appending of a leaf, can be accomplished by a complete rebuild
of the tree. Then, the complexity of appending a new element to the tree equals a new tree
creation. In other words, complexity is O(n) hashing. However, there is a solution to the problem.
We can mark duplicated nodes. If we have a marked leaf, swap it with the new element. If we have
a duplicated inner node, we must swap it with a new node with the new leaf in its descendants;
that is more complicated. If the tree is full and no duplicate nodes are left, then we increase the
tree’s height by changing the root. The root becomes an internal node. In theory, the appending of
a new element leads to the recalculation of the root. The appended element affects only one node
on each level, so it should require O(logk(n)) hashing operations.</p>
      </sec>
      <sec id="sec-2-4">
        <title>3.3. Membership proofs</title>
        <p>As was said before, it is possible to create a proof of element membership for the Merkle tree.
There are different ways to prove data inclusion. The first is through some equality verification
(let’s name it “verifiable proof”), and the second is through the direct search of the element in the
memory (let’s name it “searching proof”).</p>
        <p>
          The first type of proof that was already mentioned (“verifiable proof”) is a membership proof,
which is a set of pairs of hash (hashes) and direction ({(hi, di)|i= 1 , k}). It might be helpful to
append node parameters or other information to the proof to see what we are proving in more
detail. For example, it is possible to append a version of a tree to the proof [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ] or provide the node
with a number of currently appended leaves [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ], instead of the version. We might need the
version of a tree to know what hash version in a root we need to compare our computed hash in
root with.
        </p>
        <p>
          The “verifiable proof” is a membership proof for one data block. However, if we combine several
proofs for some nodes, we will get proof of membership for a set of nodes named ranged existence.
In [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ], we can see a lot of different types of proof derived from the “verifiable proof”. The main
types worth mentioning are the already mentioned ranged existence, delete proof, proper removal
proof, update and ranged update proofs, which prove that a single node or a set of nodes was
updated within a tree, etc. The main idea of the derived types is to prove the existence of the node
and its neighbor nodes.
        </p>
        <p>
          Authors of [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ] use “searching proofs”. Instead of giving you the set of hashes, it provides you
with path from the root to the node. Their path is a concatenation of a version of a tree and a
concatenation of direction, named the radix path [
          <xref ref-type="bibr" rid="ref20">20</xref>
          ]. In a binary tree, we can associate 0 with the
left child and 1 with the right child, so the radix path is a sequence of bits that help you locate the
node. In [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ], trees are 16-ary trees, so every inner node has 16 children. One child is marked as a
hexadecimal number, i.e., a symbol in {0, 1, ..., 9, A, B, ..., F }. To verify the proof, you need to store
the whole tree. Fortunately, it makes the proofs smaller and verification faster because all the
hashes are computed, and you only need to find the node in a tree using comparisons instead of
hashing. It is possible to use “searching proofs” along with the “verifiable proofs” if needed.
        </p>
        <p>Algorithm (alg. 2) is a pseudocode for “verifiable membership proof” generation for a binary
Merkle tree. Firstly, it searches for the required element by searching over the set of leaves, which,
unfortunately, is unsorted. The search requires O(n) comparison operations. When the node is
found, the algorithm (alg. 2) searches for the corresponding hash values in O(log2(n)) operations to
generate membership proof. Because all hash values are already calculated, the last complexity is
also evaluated in comparison operations.
In a binary Merkle tree, a membership proof (per Algorithm 2) consists of a set of pairs. Each pair
contains a hash value and a positional indicator specifying whether the hash should be
concatenated from the left or right. Consequently, the size of such a proof is on the order of
O(log2(n)). For a k-ary Merkle tree, proof construction methodologies differ, primarily in the
structure of the proof elements. Consider a verifier who, at a given step, holds a hash hi and needs
to compute its parent hash, defined ash = H(h1, h2, ..., hi, ..., hk). The proof must supply all sibling
hashes of hi.</p>
        <p>One efficient approach is to structure the proof element as a pair of concatenated strings:
A left-side string: l = h1||h2||...||hi−1
A right-side string: r = hi+1||hi+2||...||hk</p>
        <p>In this model, if hi is the first element (i=1), the left string l is empty. Likewise, if hi is the last
element (i=k), the right string r is empty. To proceed, the verifier computes the parent hash using
the received elements as H(l||hi||r).</p>
        <p>The other way is to represent the step of the proof like a whole set of additional hashes and an
id of position, where the hash from the previous step must be concatenated. The first strategy
requires less space because there is no id in it, and has less complexity to verify because we don’t
have to find appropriate places to put the hashes. However, both strategies have the same time
complexity. The size of the proof for k-ary Merkle tree is O((m − 1)logm(n)). Algorithm (alg. 3)
shows the second approach for an k-ary Merkle tree membership proof cration.</p>
        <p>Algorithms (alg. 4), (alg. 5) that checks membership proof uses hashing operation. For the k-ary
tree, algorithms will perform (k − 1) logk(n) hashing operations. So the complexity of verification of
membership proof is O((k − 1) logk(n)), where n is the number of elements in the tree.</p>
        <sec id="sec-2-4-1">
          <title>4. Merkle tree extensions</title>
          <p>As previously established, numerous definitions and variations of Merkle trees exist. Merkle trees
and their extensions can be categorized based on several key characteristics:</p>
          <p>The tree structure is not necessarily binary. It can be designed as a generic k-ary tree,
where each internal node has at most k child nodes. Implementations such as binary (k=2)
or 16-ary (k=16) trees are common.</p>
          <p>The tree's topology may be perfect or imperfect, as well as balanced or unbalanced,
depending on the specific application and construction algorithm.</p>
          <p>The overall structure can be either static (constant) or adaptive, dynamically changing in
response to data modifications.</p>
          <p>The digest function itself can be customized. This includes variations in its input
parameters or the computational logic used to produce the hash output.</p>
          <p>The tree may incorporate specialized node types beyond the standard leaf and internal
nodes to support extended features.</p>
          <p>The fundamental tree can be augmented with additional data substructures to provide
enhanced functionality.</p>
        </sec>
      </sec>
      <sec id="sec-2-5">
        <title>4.1. Sparse Merkle Tree (SMT)</title>
        <p>
          A Sparse Merkle Tree (SMT) [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] is an authenticated data structure conceptually modeled as a
perfect Merkle tree of intractable size. The structure assumes a distinct leaf node for every possible
output of its underlying cryptographic hash function. Consequently, for a hash function with a
256-bit output space, such as SHA-256, the tree would conceptually comprise 2256 leaf nodes. To use
that behavior, we can assume that every leaf has an additional field id. With that field, we can
efficiently append new elements. Moreover, because of that field, we don’t have to search for the
element in the membership proof generation. So we will win in speed, but occasionally, we lose in
memory. To bind the hash of the leaf to its id, we define the hash of a leaf node asH(id||data).
        </p>
        <p>
          Remark. Sometimes (like in [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ]), a sparse Merkle tree is called an Addressable Merkle Tree
(AMT). Both names are correct and give some intuitive information about the tree. We will use the
first name “Sparse Merkle Tree”.
        </p>
        <p>To create an empty k-ary sparse Merkle tree of height h, one can use pseudocode (alg. 6), where
the input size must be equal to kh, where k, h ∈ N, k ⩾ 2. If we are using SHA-256, We can have
sizes 2256 (k = 2, h = 256), 4128 (k = 4, h = 128), etc.</p>
        <p>Appending a new leaf here means changing the existing leaf hash because the structure has already
been created, and updating the tree. The algorithm for appending a new element is much simpler
than the one for a binary Merkle tree because we know where the new node must be, and there is
no need to rebuild the entire tree or find an empty place. To find a leaf algorithm, use O(1)
operations. To update the tree, we need to update the leaf, the changed leaf’s parent and its parent,
and so on. If we use pointer parent in all the nodes, then it is a trivial task. If we save all the nodes
using the mentioned notation, then, if we change leaf, we N ij know that its parent node is node
N ji− 1 (or in other words children of a node N ij is node N kji++1a , a= 0 , k − 1).</p>
        <p>[ k ]</p>
        <p>The algorithm of membership proof generation for sparse Merkle tree is similar to (alg. 3) for
kary Merkle tree proof generation. The only difference is the search of a node. The size of the
membership proof is also the same as for a k-ary tree, i.e. O((k − 1) logk(n)). Verification of the
membership proof has no change compared to (alg. 4). However, if the hash of a leaf is computed
as H(id||data), then it is reasonable to attach the id of a node to the proof and use the right hash
value for the proof verification at the beginning.</p>
        <p>For a sparse Merkle tree, there is also a method of proving element exclusion. The check of the
exclusion is the same algorithm as the check of inclusion because if the element exists, we know
the id of the leaf where the hash of the data must be located. Therefore, if the algorithm (alg. 4), for
the SMT proof, returns True, then the element exists, and if the algorithm returns False, the
element doesn’t exist.</p>
      </sec>
      <sec id="sec-2-6">
        <title>4.2. Indexed Merkle Tree (IMT)</title>
        <p>
          An Indexed Merkle tree is a Merkle tree, extended with additional structure [
          <xref ref-type="bibr" rid="ref23">23</xref>
          ]. To be precise,
leaves are organized in a linked list. Leaves have four fields:val, nextId, nextVal, and hash. The hash
field equals the hash value of the concatenation of three previous fields. Because storing data
directly in the leaves might be insecure and memory inefficient, it is possible to use val and nextVal
fields to store data hashes. Internal nodes are the same as the usual Merkle tree internal nodes. Like
the sparse Merkle tree, the indexed Merkle tee can be an intractable structure, but it is possible to
make it more compact because the newly appended leaf will be located in the most left-most free
position. That is why we can store the biggest left-most nonempty subtree of the tree.
        </p>
        <p>
          Algorithm (alg. 7) is presented in the form of a pseudocode for creating a new empty k-ary
indexed Merkle tree with a predefined height. It is pretty much the same as the other tree-creation
algorithms ((alg. 1), (alg. 6)). The only difference is the arguments for leaf creation are different (like
with sparse Merkle trees).
Appending a new value requires finding the leaf in O(n) comparison operations in a sorted linked
list, and then two updates of the root in O(log2(n)) operations of finding hash values for each
update.
There is an algorithm for appending multiple leaves at once for the indexed Merkle tree. It is the
most efficient when we append the sorted set of values [
          <xref ref-type="bibr" rid="ref23 ref24">23, 24</xref>
          ]. For more, we can efficiently
append a Merkle subtree or indexed Merkle subtree to the existing indexed Merkle tree [
          <xref ref-type="bibr" rid="ref24">24</xref>
          ].
        </p>
        <p>Algorithm (alg. 9) for the membership proof generation is similar to previous algorithms but has
some differences. The main difference is the additional return values. We need an algorithm to
return the set of searched node values because the hash value of a node isn’t only the hash of a
value but a hash of the concatenation of node values: val, nextId, nextVal. We can’t know the last
two values beforehand, unlike the id in a space Merkle tree.</p>
        <p>
          Algorithm for generating membership proof (alg. 9) [
          <xref ref-type="bibr" rid="ref24">24</xref>
          ], firstly look for a leaf that has the same
value as the one searched for or as close as possible to its value. It requires O(n) comparison
operations. Then, the algorithm searches for the hash values of the required vertices in O(log2(n))
comparisons. Because the structure formed by leaves is sorted (the further, the greater the values
are), we can find exactly where our desired element should be. Therefore, if the verification of the
membership proof returns True, then our element belongs to the tree, and if the algorithm returns
False, then the element does not belong to the tree. So, the membership proof is also an exclusion
proof. The proof verification algorithm is the same as for other trees but uses the proper
concatenation for the leaf node values.
        </p>
      </sec>
      <sec id="sec-2-7">
        <title>4.3. Verkle Trees (VT)</title>
        <p>
          Verkle Tree [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ], i.e., Very Short Merkle Tree, is a bandwidth-efficient alternative to Merkle Tree.
The main difference is the replacement of cryptographic hash functions with Vector Commitments.
That change affects the size of the proof for k-ary Verkle Tree. It works better if the k is bigger. In
k-ary
Merkle trees, root’s hash value is equal to H(h1, h2, ..., hk), where hi, i= 1 , k are hashes of root
children. If we need Prover to prove that hash hj is really in the tree, Prover needs to send the
Verifier all hi, i= 1 , k, i≠ j. However, if we use vector commitments, then we can calculate the
hash of the root using the next formula: H′(h1, h2, h3, ..., hk) = H′(h1, ..., h j− 1)H′(h j)H′(h j+1..., hk). So,
Prover needs to give only two values instead of k−1. That change makes the proof size of the
Verkle tree more compact than an ordinary Merkle tree proof (O(logk(n)) instead of O(k logk(n))).
The only downgrade is the usage of vector commitments that are more time-consuming than
hashing, which makes the complexity of tree creation and tree element insertion harder than for
the Merkle tree (O(kn) instead of O(n) for construction [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]). However, it is worth mentioning that
bandwidth is typically much more expensive than computational power in the applications.
        </p>
      </sec>
      <sec id="sec-2-8">
        <title>4.4. Radix Merkle Tree (RMT)</title>
        <p>Radix Merkle is built on top of the Merkle tree but with a different goal. For more, it uses “search
proof”. However, as said before, is possible to use both types of proof.</p>
        <p>
          The difference between the Merkle tree and the radix Merkle tree is described in Fig. 3. The
Radix Merkle Tree [
          <xref ref-type="bibr" rid="ref20">20</xref>
          ] consists of leaves, branches (or just an inner node), and root nodes. In
addition to them, radix trees, for example, in Ethereum [
          <xref ref-type="bibr" rid="ref20">20</xref>
          ], also use the Extension node, which is
a node containing a section of a radix path spanning two or more nodes without any side branches
that are common for two or more child nodes. Leaves in a radix Merkle tree aren’t always located
on the last level. A leaf can even be a child of the root. These different node types and the way the
tree stores the information creates a very different tree structure.
        </p>
        <p>It is common to use the 16-ary radix Merkle tree. Because every inner node has 16 = 24 child
nodes, we can name every child node with a hexadecimal digit. Because every symbol takes exactly
4 bits, it is common to use nibbles.</p>
        <p>Definition 4.1 (Nibble). A nibble refers to four consecutive binary digits or half of an 8-bit byte.</p>
        <p>The term nibble is used to describe a child of a node, and so to define a path from the root to
some leaf. Radix tree has a different proof format that uses nibbles. The membership proof is a
radix path from the root to the leaf. In other words, the radix path is just an ordered set of
directions to the next nodes, i.e., nibbles. We can concatenate those hexadecimal digits into one
hexadecimal number representing the path.</p>
        <p>
          The main advantage of a radix tree [
          <xref ref-type="bibr" rid="ref20">20</xref>
          ] is the ease of locating data from an address’s radix path,
sometimes called node key. The next most valuable property is the ease of appending a new
element, such that a tree is still sorted. A radix tree’s disadvantage is that it is sparsely populated
with leaves at varying heights until the radix tree is nearing full saturation. Therefore, if the lookup
advantages of a radix tree could be transferred to a k-Merkle tree, say by using radix paths in all
TXs, then a very dense data structure with leaves on a common level and fast look-up times could
be created.
Because the radix path is a hexadecimal number, it is possible to use the account address as a radix
path [
          <xref ref-type="bibr" rid="ref20">20</xref>
          ]. That gives us a tool to record the users.
        </p>
        <p>
          Authors of [
          <xref ref-type="bibr" rid="ref20">20</xref>
          ] give an example of radix tree creation for Ethereum account management. A
32byte long Ethereum address is read in hex, where each hex value is read as a path in the k =
16radix tree. A hex value between 0 and 15 corresponds to a path from the current node to one of its
children ranging from 0 to 15. Once the last occupied node is passed, regardless of whether all
hexes in the address have been read, a leaf node containing the account is created. If a leaf node is
reached during this process, that leaf node is replaced with a branch node, and the account leaves
are moved down a level. When a path contains a series of nodes that do not branch off (i.e., each
node has only one child), that sequence is compressed into a single extension node. This
optimization avoids using multiple branch nodes to represent a simple, linear path.
        </p>
      </sec>
      <sec id="sec-2-9">
        <title>4.4.1. Relative Index and Time Stamped Merkle Hash Tree (RITS-MHT)</title>
        <p>
          The Relative Index and Time Stamped Merkle Hash Tree (RITS-MHT) is a data structure proposed
in [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]. It was specifically designed for data auditing in cloud computing environments [
          <xref ref-type="bibr" rid="ref25">25</xref>
          ]. This
data structure is a tree that integrates a Merkle Tree (MT) with a radix path for each node. This
design significantly improves search efficiency, reducing the computational cost of finding a data
block from O(n) —as found in Wang’s protocol [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] — to a much faster O(logn). Additionally, the
structure tracks the time of the last data modification, which serves to guarantee data freshness. In
[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] described algorithms for inserting and removing data and its signing.
        </p>
      </sec>
      <sec id="sec-2-10">
        <title>4.4.2. Merkle Patricia Trie (MPT)</title>
        <p>
          Merkle Patricia tree (or Merkle Patricia trie) [
          <xref ref-type="bibr" rid="ref19 ref20">19, 20</xref>
          ] is a radix Merkle tree implementation used in
Ethereum. In Ethereum, every block header contains three Merkle trees for three kinds of objects
[
          <xref ref-type="bibr" rid="ref19">19</xref>
          ]: transactions, receipts, and state, which aims at allowing light clients to make and get
verifiable answers to many kinds of queries. The transactions tree serves to verify the inclusion of
a transaction within a block, while the receipts tree facilitates the retrieval of all instances
corresponding to a particular event (e.g., amount of gas used or any event logs from the
transactions), and the state tree to check the current balance of an account, whether an account
exists, or to simulate running transactions on a given contract.
        </p>
        <p>Ethereum requires a tree data structure that can quickly recalculate a tree root after an edit,
insert, or delete operation. The tree root must depend on the data and not on the order in which
updates are made. Note that regular Merkle trees do not satisfy this requirement. Furthermore, the
data structure must prevent Denial-of-Service attacks where malicious attackers may craft
transactions to make the tree as deep as possible and, hence, slow updates. To stop this, the data
structure must have bounded depth.</p>
        <p>
          In The Merkle Patricia Tries, proof of membership, i.e., key, is encoded using a special
HexPrefix (HP) encoding [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ]. The nibble is appended to the beginning of the key to signify parity and
terminator status. Parity denotes if the length of a key is even or odd. Terminator status denotes
whether the node is an extension or a leaf node. Note that if the original key value was of even
length, an extra zero nibble would be appended to achieve overall evenness. This ensures that the
key can be properly represented in bytes.
        </p>
      </sec>
      <sec id="sec-2-11">
        <title>4.4.3. Jellyfish Merkle Tree (JMT)</title>
        <p>
          Jellyfish Merkle Tree [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ] is a modified version of AR16 MT , i.e. Addressable (Sparse) Radix 16-ary
Merkle Tree, with the following features:



        </p>
        <p>Version-based Node Key. JMT chooses a version-based key schema with multi-fold
benefits:
 Facilitating version-based sharding.
 Greatly lowering compaction overhead in LSM-tree (Log-Structured Merge-tree) based
storage engines such as RocksDB.
 Smaller key size on average.</p>
        <p>Less Complexity. JMT has only two physical node types, Internal Node and Leaf Node.
Ex- tension node is removed, because it is unlikely for two paths to share a long common
part of the path.</p>
        <p>Concise Proof Format. The number of sibling digests in a JMT proof is less on average
(Θ(log( number of existent leaves))) than that of the same A(S)RMT without optimizations
(Θ(log( number of maximum leaves))), i.e., the height of the equivalent A(S)MT), requiring
less computation and space.</p>
        <p>
          Authors of [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ] created Jellyfish Merkle Tree as a tree optimized for computation and space,
designed for the Diem Blockchain. The proof format and verification algorithm are complex, but
the tree has a smaller proof size and less computation overhead of verification that practically
benefits users while keeping the algorithm complexity transparent to end users.
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>5. Improvements</title>
      <sec id="sec-3-1">
        <title>5.1. Storage space improvement</title>
      </sec>
      <sec id="sec-3-2">
        <title>5.1.1. Pruned Merkle Tree (PMT)</title>
        <p>
          In some cases, using Merkle trees to compute digest, i.e. the hash in root, there is a need to
duplicate the node. Authors of [
          <xref ref-type="bibr" rid="ref17 ref18">17, 18</xref>
          ] say that it is an ineffective way and propose their approach,
firstly named Merkle Trim Tree (MTT), and then named Pruned Merkle Tree (PMT). They change
the construction algorithm by delaying the computation of the digest of the first node and other
nodes to the root. Such a construction allows us to save a little of memory by not copying blocks.
An example of the difference between the Merkle tree and the Pruned Merkle tree is shown in
Fig. 13. Because of not copying the node, the algorithm for PMT creation will save space equal to
two nodes in comparison with the usual MT creation algorithm. If the tree is perfect, then the
pruned Merkle tree will look like the usual Merkle tree.
        </p>
      </sec>
      <sec id="sec-3-3">
        <title>5.1.2. Default hashes for SMT</title>
        <p>A sparse Merkle tree is a big mathematical structure, so despite being fast, sparse Merkle trees need
a lot of memory because there are a lot of empty nodes, so, there is a necessity to use some
memory-saving strategies.</p>
        <p>
          The problem with memory can be solved by associating the empty subtree, i.e. subtree without
non- default leaves, with one node with some default hash [
          <xref ref-type="bibr" rid="ref2 ref21">2, 21</xref>
          ]. We can do it in two ways: by
predefined hash value hash for the whole tree or by one predefined hash for one level of the tree,
i.e. for a tree of height h, we have hashh= hash, hashh− 1 = H(hashh, hashh), hashh− 2 = H(hashh− 1, hashh− 1),
etc. However, that idea is incomplete because it slows down non-membership proof. The next way
is not only to change the empty subtree by one node but also to leverage the leaf to a higher level.
Unfortunately, that approach leads to higher algorithm complexity.
        </p>
      </sec>
      <sec id="sec-3-4">
        <title>5.1.3. Tree inner nodes storing</title>
        <p>
          Another way to save memory for a sparse Merkle tree is not to save inner nodes hash in the
memory, because it is possible to calculate them when needed using leaf hashes. There is an
algorithm, TREEHASH [
          <xref ref-type="bibr" rid="ref26 ref27">26, 27</xref>
          ], which can compute the root of a tree and require only leaves
hashes. The algorithm can compute the hash in a root of a tree in O(n) time, using O(log(n)) space
in the process. TREEHASH is created for binary trees, but extending it to work with k-ary tree isn’t
a problem, (alg. 10).
Algorithm (alg. 11) can generate proofs and require only leaves hashes to work. It is similar to
algorithm (alg. 1), which creates the tree, but with additional steps and without the tree creation.
Its membership proof generation requires you to calculate O(n) hashes for the whole tree to create
the membership proof, so it is memory-efficient but time-inefficient. The mentioned algorithm is a
straightforward method for calculating the proof. There are better approaches to it [
          <xref ref-type="bibr" rid="ref26 ref27 ref28">26–28</xref>
          ].
        </p>
      </sec>
      <sec id="sec-3-5">
        <title>5.1.4. Time and space compromise solution</title>
        <p>
          To find a compromise between time and space, authors of [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] define caching strategies based on
capturing branches. The main idea is to store hashes of some nodes, and then use saved hashes to
skip some computations. On average, there will be faster proofs. Author of [
          <xref ref-type="bibr" rid="ref28">28</xref>
          ] proposes a proof
computing algorithm working with O(log(n)/h) operations per output and O(log(n(2h/h))) space,
using some saved subgraphs.
        </p>
      </sec>
      <sec id="sec-3-6">
        <title>5.2. Membership proof size improvement</title>
        <p>
          Average membership proof size improvement. In [
          <xref ref-type="bibr" rid="ref29">29</xref>
          ] described a strategy similar to building a
Hafman code tree. It reduces the size of membership proof for frequently used elements but
increases the membership proof size for rarely used elements. This approach makes the proof size
less on average than the same for the usual Merkle tree.
        </p>
        <p>Verkle Trees (VT). As was said before, Verkle Trees has a small membership proof because they
use committing instead of hashing. That, reduce the proof size from O(k logk(n) to O(logk(n), by
the price of computations. There is no problem with implementing that strategy in sparse Merkle
trees, indexed Merkle trees, or even in radix Merkle trees.</p>
      </sec>
      <sec id="sec-3-7">
        <title>5.3. Logic improvement</title>
        <p>
          The Odd and Even Merkle Hash Tree (O&amp;E MHT), proposed in [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ], presents an alternative method
for root hash computation. The fundamental principle of this approach is to deviate from
sequential node processing. Instead, nodes are segregated based on their index parity: all
oddindexed nodes are aggregated to form a left branch, while all even-indexed nodes constitute a right
branch. An example of this structure is illustrated in Fig. 14.
        </p>
        <p>
          Notably, this construction does not reduce algorithmic execution time; on the contrary, it
increases the overall complexity of the implementation. The Modified Merkle Hash Tree (MMHT),
also presented in [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ], is a technique designed to avoid the need for node duplication. The
methodology involves partitioning the initial set of hashes into two distinct subsets. Following this,
two intermediate hash values are computed from these respective subsets, potentially using
different schemes. The final root hash is then derived by computing the hash of the concatenation
of these two intermediate results.
As shown in Fig. 17, for a binary Modified Merkle hash tree (2-ary MMHT) there is a set of x values
that digest is computed as a chain, and the set that digest is computed as the usual binary Merkle
tree scheme. We can use the tree construction to avoid duplication of nodes in the Merkle tree.
MMHT algorithm process steps are described in algorithm 1 in [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. Authors are using a Count
trigger value to give a number of nodes to be concatenated together. As shown in Fig. 17 to avoid
duplications we need to have x+ 2k data blocks, so the second part will form the perfect Merkle tree
of height k. However, it is possible to give fewer values than needed to have the perfect Merkle
tree. So the complexity of the approach for a tree that is divided into two parts of length x and t is
equal to the complexity of an ordinary Merkle tree with t elements + x.
        </p>
        <p>There are some problems with MMHT. The main of them is the time to get to the first blocks.
The less the sequence number of the block, the bigger the time is. Because of that, for the first
blocks, the proof size is bigger, the modification time is bigger, etc.</p>
        <p>
          In article [
          <xref ref-type="bibr" rid="ref30">30</xref>
          ] about recursive STARKs, the author introduces us to recursive proving. using
recursive STARKs we prove some statements for leaves, then for nodes in the next level and up to
the root node. The proof is valid if all the proofs are valid. It is an AND logic. Because AND logic is
harder than OR, authors of [
          <xref ref-type="bibr" rid="ref31">31</xref>
          ] propose to use OR logic. They write a lot of advantages of using
OR logic in proof aggregation. Unfortunately, that work is in progress and there is no practical
implementation yet.
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>6. Comparison and results</title>
      <p>All the mentioned trees have different constructions, use cases, and complexities. Table 1 describes
the main advantages and disadvantages of those constructions.</p>
      <p>Faster insertion and deletion compared to k-ary
MT, support nonmembership proof.</p>
      <p>Faster insertion and deletion compared to k-ary
MT. Can be built on top of an existing linked
list. Has a smaller downgrade for appending
multiple elements at once than SMT.</p>
      <p>Short proofs, so faster proof exchange and
proof verification.</p>
      <p>Disadvantages
Average speed.</p>
      <p>Requires a lot of memory (leaf
for every possible output of the
hash function).</p>
      <p>Slow search of node, which can
affect the speed of membership
proof creation, element insertion,
etc., when the tree is nearly full.</p>
      <p>Hard creation and insertion
because of the use of vector
commitments instead of hashes.</p>
      <p>Short proofs, and even shorter proofs for proofs
with multiple nodes with a common path.</p>
      <p>Complex implementation,
memory inefficient.</p>
      <p>Theoretical results of the complexity of the main algorithms, i.e. new element insertion,
membership proof generation and verification are shown in a table 2.</p>
      <p>In Table 2, “h.” means complexity in hashing, and “c.” means complexity in comparisons. There
are two exceptions. VT uses a commitment function instead of a hashing and RMT uses a
comparison function instead of hashing. MP search means MP creation while the whole tree
structure is available</p>
      <p>O(k log_k(n)) O(k log_k(n)) O(k log_k(n)) O(log_k(n)) O(k log_k(n)) nibbles</p>
      <p>O(k log_k(n)) O(k log_k(n)) O(k log_k(n)) O(k log_k(n)) O(k log_k(n))
Tree type
k-ary MT
k-ary SMT
k-ary IMT
k-ary VT
k-ary RMT
tree size (nodes)
Creation (h)
Inserting (h)
Node search (c)
MP search (c)
MP creation (h)
NMP search (c)
NMP creation (h)
MMP verification
(h)</p>
      <p>O(n)
O(n)
O(n)
O(n)
O(n)
MP verification (h) O(k log_k(n)) O(k log_k(n)) O(k log_k(n)) O(log_k(n)) O(log_k(n)) c
O(n)
O(n)
O(1)
O(n)
O(n)
O(log_k(n)) O(n)
O(log_k(n)) O(n)</p>
      <p>O(n)
O(n)
O(n)
O(n)
O(n)
O(k log_k(n)) O(k log_k(n)) O(log_k(n)) O(log_k(n)) c</p>
      <p>O(n)
O(kn)
O(n)
O(n)
O(n)
O(n)
O(n)</p>
      <p>O(n)
O(n)
O(1)
O(1)
O(1) c.</p>
      <p>O(1)
O(1) c.
There are a lot of Merkle tree constructions for different purposes. They have their pros and cons.
If we need a simple tree implementation, then the best choice is the sparse Merkle tree (SMT). If the
purposeof a tree is to have short proofs for big bandwidth, then the best choices are the Verkle
Tree (VT) and the radix Merkle tree (RMT). If the purpose of a tree is to store a huge amount of
data, then the best choices are sparse Merkle tree (SMT) and indexed Merkle tree (IMT). If we are
constantly modifying the tree, or we need fast proofs having nearly unlimited memory on a Prover
and Verifier side, then the best choice is the radix Merkle tree (RMT). And finally, if we are lacking
in memory, then the standard Merkle tree could be the best choice. For the best performance, it is
better to implement the mentioned in a section 5 improvements if possible.</p>
      <sec id="sec-4-1">
        <title>Declaration on Generative AI</title>
        <p>While preparing this work, the authors used the AI programs Grammarly Pro to correct text
grammar and Strike Plagiarism to search for possible plagiarism. After using this tool, the authors
reviewed and edited the content as needed and took full responsibility for the publication’s content.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>R. </given-names>
            <surname>Merkle</surname>
          </string-name>
          .
          <article-title>A Digital Signature based on a Conventional Encryption Function</article-title>
          ,
          <source>in: Advances in Cryptology - CRYPTO '87. CRYPTO</source>
          <year>1987</year>
          , vol.
          <volume>293</volume>
          ,
          <year>1987</year>
          ,
          <fpage>369</fpage>
          -
          <lpage>378</lpage>
          . doi:
          <volume>10</volume>
          .1007/3-540-48184- 2_
          <fpage>32</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>D.</surname>
          </string-name>
           Rasmus,
          <string-name>
            <surname>P.</surname>
          </string-name>
           Tobias,
          <string-name>
            <surname>P.</surname>
          </string-name>
           Roel,
          <article-title>Efficient Sparse Merkle Trees: Caching Strategies</article-title>
          and
          <string-name>
            <surname>Secure (Non-)Membership</surname>
            <given-names>Proofs</given-names>
          </string-name>
          , Cryptology ePrint Archive,
          <year>Paper 2016</year>
          /683.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>R.</surname>
          </string-name>
           Chandran,
          <article-title>Pros and Cons of Merkle Tree</article-title>
          ,
          <source>in: Artificial Intelligence and Communication Technologies</source>
          ,
          <year>2023</year>
          ,
          <fpage>649</fpage>
          -
          <lpage>653</lpage>
          . doi:
          <volume>10</volume>
          .52458/
          <fpage>978</fpage>
          -81-955020-5-9-61
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>V.</given-names>
             
            <surname>Zhebka</surname>
          </string-name>
          , et al.,
          <article-title>Methodology for Choosing a Consensus Algorithm for Blockchain Technology</article-title>
          ,
          <source>in: Digital Economy Concepts and Technologies Workshop</source>
          , DECaT, vol.
          <volume>3665</volume>
          ,
          <year>2024</year>
          ,
          <fpage>106</fpage>
          -
          <lpage>113</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>M. Saqib</given-names>
            <surname>Niaz</surname>
          </string-name>
          , G. 
          <article-title>Saake, Merkle Hash Tree based Techniques for Data Integrity of Outsourced Data</article-title>
          , in: Workshop Grundlagen von Datenbanken, vol.
          <volume>1366</volume>
          ,
          <year>2015</year>
          ,
          <fpage>66</fpage>
          -
          <lpage>71</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Q.</given-names>
             
            <surname>Wang</surname>
          </string-name>
          , et al.,
          <article-title>Enabling Public Auditability and Data Dynamics for Storage Security in Cloud Computing</article-title>
          ,
          <source>IEEE Trans. Parallel Distrib. Syst</source>
          .
          <volume>22</volume>
          (
          <year>2011</year>
          )
          <fpage>847</fpage>
          -
          <lpage>859</lpage>
          . doi:
          <volume>10</volume>
          .1109/TPDS.
          <year>2010</year>
          .183
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>F.</given-names>
             
            <surname>Kipchuk</surname>
          </string-name>
          , et al.,
          <source>Assessing Approaches of IT Infrastructure Audit, in: IEEE 8th Int. Conf. on Problems of Infocommunications, Science and Technology</source>
          ,
          <year>2021</year>
          . doi:
          <volume>10</volume>
          .1109/picst54195.
          <year>2021</year>
          .9772181
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>A.</given-names>
             
            <surname>Riadh</surname>
          </string-name>
          , et al.,
          <article-title>Data Integrity Time Optimization of a Blockchain IoT Smart Home Net- work Using Different Consensus and Hash Algorithms</article-title>
          , Wireless Commun.
          <source>Mobile Comput</source>
          .
          <year>2021</year>
          (
          <article-title>1) (</article-title>
          <year>2021</year>
          ). doi:
          <volume>10</volume>
          .1155/
          <year>2021</year>
          /4401809
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>A.</given-names>
             
            <surname>Riadh</surname>
          </string-name>
          , et al.,
          <article-title>Peer-to-Peer User Identity Verification Time Optimization in IoT Blockchain Network</article-title>
          ,
          <source>Sensors</source>
          <volume>23</volume>
          (
          <year>2023</year>
          ). doi:
          <volume>10</volume>
          .3390/s23042106
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>J. Kuszmaul</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Verkle</given-names>
            <surname>Trees</surname>
          </string-name>
          ,
          <year>2019</year>
          . URL: https://api.semanticscholar.org/Corpus
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11] N. 
          <string-name>
            <surname>Garg</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Bawa</surname>
          </string-name>
          , RITS-MHT:
          <article-title>Relative Indexed and Time Stamped Merkle Hash Tree based Data Auditing Protocol for Cloud Computing</article-title>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Netw</surname>
          </string-name>
          .
          <source>Comput. Appl</source>
          .
          <volume>84</volume>
          (
          <year>2017</year>
          )
          <fpage>1</fpage>
          -
          <lpage>13</lpage>
          . doi:
          <volume>10</volume>
          .1016/j.jnca.
          <year>2017</year>
          .
          <volume>02</volume>
          .005
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>Y.</given-names>
             
            <surname>Kostiuk</surname>
          </string-name>
          , et al.,
          <article-title>Models and Algorithms for Analyzing Information Risks during the Security Audit of Personal Data Information System</article-title>
          ,
          <source>in: 3rd Int. Conf. on Cyber Hygiene &amp; Conflict Management in Global Information Networks (CH&amp;CMiGIN)</source>
          , vol.
          <volume>3925</volume>
          ,
          <year>2025</year>
          ,
          <fpage>155</fpage>
          -
          <lpage>171</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>P.</surname>
          </string-name>
           Rogaway,
          <string-name>
            <surname>T.</surname>
          </string-name>
           Shrimpton,
          <string-name>
            <given-names>Cryptographic</given-names>
            <surname>Hash-Function</surname>
          </string-name>
          <string-name>
            <surname>Basics</surname>
          </string-name>
          : Definitions, Implications, and
          <article-title>Separations for Preimage Resistance</article-title>
          ,
          <string-name>
            <surname>Second-Preimage Resistance</surname>
          </string-name>
          , and Collision Resistance, In: Fast Software Encryption, Berlin, Heidelberg: Springer Berlin Heidelberg,
          <year>2004</year>
          ,
          <fpage>371</fpage>
          -
          <lpage>388</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>D.</given-names>
             
            <surname>Catalano</surname>
          </string-name>
          ,
          <string-name>
            <surname>D.</surname>
          </string-name>
           Fiore,
          <source>Vector Commitments and their Applications</source>
          , Cryptology ePrint Archive,
          <year>Paper 2011</year>
          /495.
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>R.</surname>
          </string-name>
           Patgiri,
          <string-name>
            <surname>M.</surname>
          </string-name>
           
          <article-title>Dutta Borah, HEX-BLOOM: An Efficient Method for Authenticity and Integrity Verification in Privacy-Preserving Computing</article-title>
          , Cryptology ePrint Archive,
          <year>Paper 2021</year>
          /773.
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>R. C.</given-names>
            <surname>Merkle</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A Digital</given-names>
            <surname>Signature</surname>
          </string-name>
          <article-title>Based on a Conventional Encryption Function</article-title>
          , Advances in Cryptology,
          <source>CRYPTO'87. Lecture Notes in Computer Science</source>
          , vol.
          <volume>293</volume>
          ,
          <year>1988</year>
          ,
          <fpage>369</fpage>
          -
          <lpage>378</lpage>
          . doi:
          <volume>10</volume>
          .1007/3-540-48184-2_
          <fpage>32</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>M.</given-names>
            <surname>Gracy</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Jeyavadhanam</surname>
          </string-name>
          , MTTBA
          <article-title>- A Key Contributor for Sustainable Energy Consumption Time and Space Utility for Highly Secured Crypto Transactions in Blockchain Technology</article-title>
          ,
          <year>2022</year>
          . doi:
          <volume>10</volume>
          .48550/arXiv.2209.13431
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>M.</given-names>
            <surname>Gracy</surname>
          </string-name>
          , R. 
          <string-name>
            <surname>Jeyavadhanam</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
           A. 
          <article-title>Raj, Enhancing transaction verification through pruned merkle tree in blockchain</article-title>
          ,
          <source>J. Theor. Appl. Inf. Technol</source>
          . (
          <year>2023</year>
          )
          <fpage>6421</fpage>
          -
          <lpage>6433</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <surname>Haitz</surname>
            <given-names>S</given-names>
          </string-name>
          ´aez de Oc´
          <article-title>ariz Borde, An Overview of Trees in Blockchain Technology: Merkle Trees</article-title>
          and
          <source>Merkle Patricia Tries</source>
          ,
          <year>2022</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>A.</given-names>
             
            <surname>Kudzin</surname>
          </string-name>
          , et al.,
          <source>Scaling Ethereum 2.0s Cross-Shard Transactions with Refined Data Structures, Cryptography</source>
          <volume>6</volume>
          (
          <year>2022</year>
          ). doi:
          <volume>10</volume>
          .3390/cryptography6040057
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>Z.</given-names>
             
            <surname>Gao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
             
            <surname>Hu</surname>
          </string-name>
          ,
          <string-name>
            <surname>Q.</surname>
          </string-name>
           Wu, Jellyfish Merkle Tree, diem,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22] H. 
          <article-title>Schoenfeld, Dynamic Merkle-Trees, Vixra</article-title>
          .org,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>ZIDEN.IO</given-names>
            ,
            <surname>Indexed Merkle Tree - A More Optimized</surname>
          </string-name>
          <article-title>Solution for ZK proofs</article-title>
          ,
          <year>2023</year>
          . URL: https://blog.ziden.
          <article-title>io/indexed-merkle-tree-a-more-optimized-solution-for-zk-proofs-c75b0d0b1 786</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <surname>Aztec</surname>
          </string-name>
          , Indexed Merkle Tree,
          <year>2023</year>
          . URL: https://docs.aztec.network/aztec/concepts/storage/ trees/indexed_merkle_tree
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          [25]
          <string-name>
            <given-names>Y.</given-names>
             
            <surname>Kostiuk</surname>
          </string-name>
          , et al.,
          <source>Effectiveness of Information Security Control using Audit Logs, in: Cybersecurity Providing in Information and Telecommunication Systems</source>
          , vol.
          <volume>3991</volume>
          ,
          <year>2025</year>
          ,
          <fpage>524</fpage>
          -
          <lpage>538</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          [26]
          <string-name>
            <surname>M. </surname>
          </string-name>
          <article-title>Szydlo, Merkle Tree Traversal in Log Space and Time</article-title>
          , in: Advances in Cryptology, EUROCRYPT,
          <year>2004</year>
          ,
          <fpage>541</fpage>
          -
          <lpage>554</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          [27]
          <string-name>
            <given-names>M.</given-names>
             
            <surname>Jakobsson</surname>
          </string-name>
          , et al.,
          <source>Fractal Merkle Tree Representation and Traversal</source>
          , in: Topics in Cryptology - CT-RSA
          <year>2003</year>
          .
          <source>CT-RSA 2003. Lecture Notes in Computer Science</source>
          , vol.
          <volume>2612</volume>
          ,
          <year>2003</year>
          ,
          <fpage>314</fpage>
          -
          <lpage>326</lpage>
          . doi:
          <volume>10</volume>
          .1007/3-540-36563-X_
          <fpage>21</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          [28]
          <string-name>
            <given-names>P.</given-names>
             
            <surname>Berman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
             
            <surname>Karpinski</surname>
          </string-name>
          ,
          <string-name>
            <surname>Y.</surname>
          </string-name>
           
          <article-title>Nekrich, Optimal Trade-off for Merkle Tree Traversal</article-title>
          ,
          <source>Theor. Comput. Sci. 372</source>
          .1 (
          <issue>2007</issue>
          ),
          <fpage>26</fpage>
          -
          <lpage>36</lpage>
          . doi:
          <volume>10</volume>
          .1016/j.tcs.
          <year>2006</year>
          .
          <volume>11</volume>
          .029
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          [29]
          <string-name>
            <given-names>O.</given-names>
             
            <surname>Kuznetsov</surname>
          </string-name>
          , et al.,
          <source>Adaptive Restructuring of Merkle and Verkle Trees for Enhanced Blockchain Scalability</source>
          , arXiv,
          <year>2024</year>
          . doi:
          <volume>10</volume>
          .48550/arXiv.2403.00406
        </mixed-citation>
      </ref>
      <ref id="ref30">
        <mixed-citation>
          [30] G, Kaempfer, StarkWare: Recursive STARKs,
          <year>2022</year>
          URL: https://medium.com/starkware/ recursive-starks78f8dd401025
        </mixed-citation>
      </ref>
      <ref id="ref31">
        <mixed-citation>
          [31]
          <string-name>
            <given-names>O.</given-names>
             
            <surname>Kuznetsov</surname>
          </string-name>
          , et al.,
          <source>Efficient and Universal Merkle Tree Inclusion Proofs via OR Aggregation</source>
          , arXiv,
          <year>2024</year>
          . doi:
          <volume>10</volume>
          .48550/arXiv.2405.07941
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>