<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="introduction">Introduction<a href="https://research.logos.co/rlog/de-mls-with-waku#introduction" class="hash-link" aria-label="Direct link to Introduction" title="Direct link to Introduction"></a></h2>
<p>Secure Group Messaging (SGM) is resource-intensive when aiming for robust security features
like forward secrecy (FS) and post-compromise security (PCS).</p>
<p>One straightforward approach to SGM is a pairwise group chat,
where each pair of group members establishes a unique encryption key using Diffie-Hellman.
While this method ensures security, it falls short in terms of practicality:</p>
<ul>
<li><strong>High storage requirements</strong>: Each participant must store encryption keys for every other participant.</li>
<li><strong>Inefficient encryption</strong>: Each message must be encrypted separately for every participant,
leading to significant computational overhead.</li>
<li><strong>Inefficient message storage and delivery</strong>: Each separately encrypted message must then be sent over the wire,
whatever this wire might be. Or stored in database.</li>
<li><strong>Cumbersome group management</strong>: Adding or removing users and refreshing keys becomes
increasingly inefficient as the group grows.</li>
</ul>
<p>One scalable for Secure Group Messaging (SGM) is Message Layer Security (MLS), as standardized in <a href="https://datatracker.ietf.org/doc/rfc9420/" target="_blank" rel="noopener noreferrer">RFC 9420</a>.
Leveraging TreeKEM, MLS organizes group members in a cryptographic tree structure,
where each participant is responsible for maintaining specific parts of the tree.</p>
<p>While MLS offers scalability and strong security guarantees,
its reliance on server-based delivery services poses limitations for fully decentralized environments.</p>
<p>In this post, we present the implementation details of the first version of Decentralized MLS (de-MLS)
which is an SGM protocol. De-MLS can serve groups that cannot rely on central servers,
such as journalists and activists seeking secure communication.
It is also well suited for DAOs, where Ethereum-based authentication can restrict access to members
holding a minimum ETH balance, and for NGOs or research consortia that prefer not to host their own servers while still
requiring end-to-end encrypted group messaging. Decentralized MLS (de-MLS) satisfies the following features:</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="background">Background<a href="https://research.logos.co/rlog/de-mls-with-waku#background" class="hash-link" aria-label="Direct link to Background" title="Direct link to Background"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="mls">MLS<a href="https://research.logos.co/rlog/de-mls-with-waku#mls" class="hash-link" aria-label="Direct link to MLS" title="Direct link to MLS"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="waku">Waku<a href="https://research.logos.co/rlog/de-mls-with-waku#waku" class="hash-link" aria-label="Direct link to Waku" title="Direct link to Waku"></a></h3>
<p><a href="https://waku.org/" target="_blank" rel="noopener noreferrer">Waku</a> is a decentralized messaging protocol designed for secure and efficient communication in peer-to-peer networks.
It operates as a broadcast-based routing layer where content topics can be used to tag and filter messages.
Users join channels by subscribing to specific content topics,
which determine the scope and type of messages exchanged.
This enables flexible and efficient communication patterns in a decentralized environment.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="de-mls">de-MLS<a href="https://research.logos.co/rlog/de-mls-with-waku#de-mls" class="hash-link" aria-label="Direct link to de-MLS" title="Direct link to de-MLS"></a></h2>
<p>Decentralized MLS (de-MLS) is a peer-to-peer secure group messaging protocol
that can work with any delivery service (DS) meeting a minimal set of requirements.
In this post, we highlight its integration with <a href="https://waku.org/" target="_blank" rel="noopener noreferrer">Waku</a> as the messaging protocol,
while emphasizing that de-MLS itself remains agnostic to the underlying DS.
Further technical details can be found in the <a href="https://rfc.vac.dev/vac/raw/eth-mls-offchain" target="_blank" rel="noopener noreferrer">de-MLS RFC</a>.</p>
<p>Decentralization is achieved not only at the delivery service (DS) level
but also within the authentication service (AS).
Multiple special nodes named Steward in the group serve as authorized identities to authenticate users
before they join or are removed from the group transparently.</p>
<p>de-MLS provides two different user management configurations, both utilizing the Waku protocol for DS:</p>
<ol>
<li><strong>Single Steward</strong>:<!-- -->
<ul>
<li>A single authorized identity (Steward) manages the group,
including removing or adding users with agreement among users by a voting-based consensus.</li>
</ul>
</li>
<li><strong>Multi-Steward</strong>:<!-- -->
<ul>
<li>Multiple Stewards have equal authority to add or remove users.</li>
<li>A consensus mechanism ensures consistency by resolving concurrent changes
within the same epoch and preventing possible conflicts.
In each epoch, all modifications are managed exclusively by a single Steward.</li>
</ul>
</li>
</ol>
<p>Note: We chose the term Steward to reflect the role of transparently coordinating and organizing passengers at stations, much like Stewards do in transit systems.</p>
<p>In multi-Steward settings, de-MLS requires a consensus among Stewards
that have equal rights in the group since changes in an epoch in MLS are required
to be conducted by a single identity, that is the Steward.</p>
<p>For the consensus integration, ongoing research explores two promising approaches:</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="waku-integration">Waku Integration<a href="https://research.logos.co/rlog/de-mls-with-waku#waku-integration" class="hash-link" aria-label="Direct link to Waku Integration" title="Direct link to Waku Integration"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="flow">Flow<a href="https://research.logos.co/rlog/de-mls-with-waku#flow" class="hash-link" aria-label="Direct link to Flow" title="Direct link to Flow"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="1-steward-joins-the-welcome-topic">1. Steward joins the welcome topic<a href="https://research.logos.co/rlog/de-mls-with-waku#1-steward-joins-the-welcome-topic" class="hash-link" aria-label="Direct link to 1. Steward joins the welcome topic" title="Direct link to 1. Steward joins the welcome topic"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="2-group-initialization">2. Group initialization<a href="https://research.logos.co/rlog/de-mls-with-waku#2-group-initialization" class="hash-link" aria-label="Direct link to 2. Group initialization" title="Direct link to 2. Group initialization"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="3-emitting-group-anouncement-ga-by-steward">3. Emitting Group Anouncement (GA) by Steward<a href="https://research.logos.co/rlog/de-mls-with-waku#3-emitting-group-anouncement-ga-by-steward" class="hash-link" aria-label="Direct link to 3. Emitting Group Anouncement (GA) by Steward" title="Direct link to 3. Emitting Group Anouncement (GA) by Steward"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="4-user-joins-the-welcome-topic">4. User joins the welcome topic<a href="https://research.logos.co/rlog/de-mls-with-waku#4-user-joins-the-welcome-topic" class="hash-link" aria-label="Direct link to 4. User joins the welcome topic" title="Direct link to 4. User joins the welcome topic"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="5-user-creates-its-key-package">5. User creates its key package<a href="https://research.logos.co/rlog/de-mls-with-waku#5-user-creates-its-key-package" class="hash-link" aria-label="Direct link to 5. User creates its key package" title="Direct link to 5. User creates its key package"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="6-steward-receives-the-users-key-package">6. Steward receives the User's key package<a href="https://research.logos.co/rlog/de-mls-with-waku#6-steward-receives-the-users-key-package" class="hash-link" aria-label="Direct link to 6. Steward receives the User's key package" title="Direct link to 6. Steward receives the User's key package"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="7-creation-of-voting-proposals">7. Creation of Voting proposals<a href="https://research.logos.co/rlog/de-mls-with-waku#7-creation-of-voting-proposals" class="hash-link" aria-label="Direct link to 7. Creation of Voting proposals" title="Direct link to 7. Creation of Voting proposals"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="8-voting-for-proposal">8. Voting for proposal<a href="https://research.logos.co/rlog/de-mls-with-waku#8-voting-for-proposal" class="hash-link" aria-label="Direct link to 8. Voting for proposal" title="Direct link to 8. Voting for proposal"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="10-sending-messages">10. Sending messages<a href="https://research.logos.co/rlog/de-mls-with-waku#10-sending-messages" class="hash-link" aria-label="Direct link to 10. Sending messages" title="Direct link to 10. Sending messages"></a></h3>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="benchmark">Benchmark<a href="https://research.logos.co/rlog/de-mls-with-waku#benchmark" class="hash-link" aria-label="Direct link to Benchmark" title="Direct link to Benchmark"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="potential-drawbacks-and-countermeasures">Potential drawbacks and countermeasures<a href="https://research.logos.co/rlog/de-mls-with-waku#potential-drawbacks-and-countermeasures" class="hash-link" aria-label="Direct link to Potential drawbacks and countermeasures" title="Direct link to Potential drawbacks and countermeasures"></a></h2>
<p>Since de-MLS replace the servers by P2P, we could lose some good features of servers based MLS.
In this section we present the potential drawbacks and possible countermeasures of de-MLS.</p>
<ul>
<li>Offline users: <code>keyPackage</code>s are provided by the users directly without any storing,
this is required each user must be online for joining to a group.<!-- -->
<ul>
<li>We can consider to use <a href="https://docs.waku.org/guides/js-waku/store-retrieve-messages/" target="_blank" rel="noopener noreferrer">Waku sync nodes</a>
that are nodes has storing ability for a temporary storing of <code>keyPackage</code>s.</li>
</ul>
</li>
<li>DoS attack to Steward: Steward is known in welcome message from periodic group announcement message
so Steward can be targeted for DoS attack.<!-- -->
<ul>
<li>As always we consider to use Rate-Limiting Nullifier (RLN) with Waku to protect network from spam.</li>
</ul>
</li>
<li>Message loss or delay : Because of P2P and consensus settings, message can be lost or delayed.,<!-- -->
<ul>
<li>We can integrate reliability mechanisms to Waku such as
<a href="https://github.com/waku-org/nim-sds" target="_blank" rel="noopener noreferrer">scalable data sync (SDS)</a></li>
<li>Consensus mechanism requires to provide liveness property against offline nodes, for example,
it may provides default YES or NO options for a silent users who do not vote.</li>
</ul>
</li>
<li>Enchanced authentication<!-- -->
<ul>
<li>Ethereum authentication could be inefficient.
We can configure the authentication mechanism for example asking minimum balance or etc.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="conclusion">Conclusion<a href="https://research.logos.co/rlog/de-mls-with-waku#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion"></a></h2>
<p>To summarize, the approach to solving decentralized DS tasks with Waku
can be outlined as shown in the comparison table:</p>
<table><thead><tr><th>Feature</th><th>MLS</th><th>de-MLS</th></tr></thead><tbody><tr><td>Message Distribution</td><td>Messages are sent from the server to clients</td><td>Messages are sent by publishing/subscribing to pub-sub topics</td></tr><tr><td>Commit Message Handling</td><td>Relies on a server</td><td>Relies on a consensus and transparent Steward</td></tr><tr><td>Key Package Management</td><td>Key packages are stored and distributed by the server</td><td>Key packages are provided by the users themselves</td></tr></tbody></table>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="future-work">Future Work<a href="https://research.logos.co/rlog/de-mls-with-waku#future-work" class="hash-link" aria-label="Direct link to Future Work" title="Direct link to Future Work"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="references">References<a href="https://research.logos.co/rlog/de-mls-with-waku#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="overview">Overview<a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#overview" class="hash-link" aria-label="Direct link to Overview" title="Direct link to Overview"></a></h2>
replying to IWANT requests is optional, to safeguard honest peers from adversaries.
This change encourages peers to make redundant IWANT requests for the same message.
While this arrangement works well for small messages, it can be inefficient for bigger ones.
This inefficiency arises from an increase in duplicates
and a higher number of IWANT requests due to longer transmission times for large messages.
As a result, we observe a significant rise in bandwidth utilization and message dissemination times across the network.</p>
<p>IDONTWANT messages in GossipSub v1.2 [<a href="https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.2.md" target="_blank" rel="noopener noreferrer">2</a>] help reduce some duplicates.
However, further efforts are necessary to mitigate this problem
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="message-transfer-time-and-duplicates">Message Transfer Time and Duplicates<a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#message-transfer-time-and-duplicates" class="hash-link" aria-label="Direct link to Message Transfer Time and Duplicates" title="Direct link to Message Transfer Time and Duplicates"></a></h2>
with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>h</mi></mrow><annotation encoding="application/x-tex">h</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal">h</span></span></span></span> indicating the number of hops along the longest path.
This implies that a tenfold increase in message size results in an eightyfold rise in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi><mo>×</mo><msub><mi>τ</mi><mrow><mi>t</mi><mi>x</mi></mrow></msub></mrow><annotation encoding="application/x-tex">D \times \tau_{tx}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7667em;vertical-align:-0.0833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">×</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1132em">τ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em"><span style="top:-2.55em;margin-left:-0.1132em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span><span class="mord mathnormal mtight">x</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em"><span></span></span></span></span></span></span></span></span></span> for a mesh with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi><mo>=</mo><mn>8</mn></mrow><annotation encoding="application/x-tex">D = 8</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span><span class="mspace" style="margin-right:0.2778em"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em"></span></span><span class="base"><span class="strut" style="height:0.6444em"></span><span class="mord">8</span></span></span></span>,
which accumulates across <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>h</mi></mrow><annotation encoding="application/x-tex">h</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal">h</span></span></span></span> hops.
This leads to two fundamental problems:</p>
<ol>
<li>
<p>A longer contention interval (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>τ</mi><mi>D</mi></msub></mrow><annotation encoding="application/x-tex">\tau_D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1132em">τ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em"><span style="top:-2.55em;margin-left:-0.1132em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.02778em">D</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em"><span></span></span></span></span></span></span></span></span></span>) increases the chance that peers receive the same message from multiple mesh members during that interval,<br>
<!-- -->leading to redundant transmissions and more duplicates.
They argue that a node can forward a received message to a maximum of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">D-1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7667em;vertical-align:-0.0833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:0.6444em"></span><span class="mord">1</span></span></span></span> peers
while the original publisher sends it to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> peers.
As a result, we get <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi><mo stretchy="false">(</mo><mi>D</mi><mo>−</mo><mn>1</mn><mo stretchy="false">)</mo><mo>+</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">N(D-1)+1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord mathnormal" style="margin-right:0.10903em">N</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.02778em">D</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:0.6444em"></span><span class="mord">1</span></span></span></span> transmissions in the network.
Only <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">N-1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7667em;vertical-align:-0.0833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">N</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:0.6444em"></span><span class="mord">1</span></span></span></span> transmissions are necessary to deliver a message to all peers.
This rise indicates that larger messages can lead to more duplicates due to longer contention intervals.
It is essential to highlight that the impact of IWANT/IDONTWANT messages is not considered in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>d</mi><mo>ˉ</mo></mover></mrow><annotation encoding="application/x-tex">\bar{d}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8312em"></span><span class="mord accent"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8312em"><span style="top:-3em"><span class="pstrut" style="height:3em"></span><span class="mord mathnormal">d</span></span><span style="top:-3.2634em"><span class="pstrut" style="height:3em"></span><span class="accent-body" style="left:-0.0833em"><span class="mord">ˉ</span></span></span></span></span></span></span></span></span></span> computations above.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="protocols-considered">Protocols Considered<a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#protocols-considered" class="hash-link" aria-label="Direct link to Protocols Considered" title="Direct link to Protocols Considered"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="push-pull-phase-transition-pppt"><a href="https://ethresear.ch/t/pppt-fighting-the-gossipsub-overhead-with-push-pull-phase-transition/22118/1" target="_blank" rel="noopener noreferrer">Push-Pull Phase Transition (PPPT)</a><a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#push-pull-phase-transition-pppt" class="hash-link" aria-label="Direct link to push-pull-phase-transition-pppt" title="Direct link to push-pull-phase-transition-pppt"></a></h3>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="key-considerations-and-poc-implementation">Key Considerations and <a href="https://github.com/vacp2p/nim-libp2p/tree/research_gs_pppt" target="_blank" rel="noopener noreferrer">PoC Implementation</a><a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#key-considerations-and-poc-implementation" class="hash-link" aria-label="Direct link to key-considerations-and-poc-implementation" title="Direct link to key-considerations-and-poc-implementation"></a></h4>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="gossipsub-v14-proposal"><a href="https://github.com/libp2p/specs/pull/654" target="_blank" rel="noopener noreferrer">GossipSub v1.4 Proposal</a><a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#gossipsub-v14-proposal" class="hash-link" aria-label="Direct link to gossipsub-v14-proposal" title="Direct link to gossipsub-v14-proposal"></a></h3>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="key-considerations-and-poc-implementation-1">Key Considerations and <a href="https://github.com/vacp2p/nim-libp2p/tree/research_gs_v1_4" target="_blank" rel="noopener noreferrer">PoC Implementation</a><a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#key-considerations-and-poc-implementation-1" class="hash-link" aria-label="Direct link to key-considerations-and-poc-implementation-1" title="Direct link to key-considerations-and-poc-implementation-1"></a></h4>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="gossipsub-v20-proposal"><a href="https://github.com/libp2p/specs/pull/653" target="_blank" rel="noopener noreferrer">GossipSub v2.0 Proposal</a><a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#gossipsub-v20-proposal" class="hash-link" aria-label="Direct link to gossipsub-v20-proposal" title="Direct link to gossipsub-v20-proposal"></a></h3>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="key-considerations-and-poc-implementation-2">Key Considerations and <a href="https://github.com/vacp2p/nim-libp2p/tree/research_gs_v2_0" target="_blank" rel="noopener noreferrer">PoC Implementation</a><a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#key-considerations-and-poc-implementation-2" class="hash-link" aria-label="Direct link to key-considerations-and-poc-implementation-2" title="Direct link to key-considerations-and-poc-implementation-2"></a></h4>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="experiments">Experiments<a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#experiments" class="hash-link" aria-label="Direct link to Experiments" title="Direct link to Experiments"></a></h2>
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">N</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> denote the number of peers and the number of transmitted messages, respectively,
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="results">Results<a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#results" class="hash-link" aria-label="Direct link to Results" title="Direct link to Results"></a></h3>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="scenario1-increasing-network-size">Scenario1: Increasing Network Size<a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#scenario1-increasing-network-size" class="hash-link" aria-label="Direct link to Scenario1: Increasing Network Size" title="Direct link to Scenario1: Increasing Network Size"></a></h4>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="scenario3-increasing-number-of-publishers">Scenario3: Increasing Number of Publishers<a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#scenario3-increasing-number-of-publishers" class="hash-link" aria-label="Direct link to Scenario3: Increasing Number of Publishers" title="Direct link to Scenario3: Increasing Number of Publishers"></a></h4>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="findings">Findings<a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#findings" class="hash-link" aria-label="Direct link to Findings" title="Direct link to Findings"></a></h2>
<a href="https://forum.research.logos.co/t/vac-research-blog-performance-evaluation-of-gossipsub-improvement-proposals/556" target="_blank" rel="noopener noreferrer">Logos Research forum</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="references">References<a href="https://research.logos.co/rlog/gsub-perf-imp-comparison#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References"></a></h2>
<p>[3] <a href="https://ethresear.ch/t/number-duplicate-messages-in-ethereums-gossipsub-network/19921" target="_blank" rel="noopener noreferrer">Number of Duplicate Messages in Ethereum’s Gossipsub Network</a></p>
<p>[4] <a href="https://ethresear.ch/t/impact-of-idontwant-in-the-number-of-duplicates/22652" target="_blank" rel="noopener noreferrer">Impact of IDONTWANT in the Number of Duplicates</a></p>
<p>[5] <a href="https://www.arxiv.org/abs/2505.17337" target="_blank" rel="noopener noreferrer">PREAMBLE and IMRECEIVING for Improved Large Message Handling</a></p>
<p>[6] <a href="https://arxiv.org/abs/2504.10365" target="_blank" rel="noopener noreferrer">Staggering and Fragmentation for Improved Large Message Handling</a></p>
<p>[7] <a href="https://hackmd.io/X1DoBHtYTtuGqYg0qK4zJw" target="_blank" rel="noopener noreferrer">GossipSub for Big Messages</a></p>
<p>[8] <a href="https://ethresear.ch/t/fulldas-towards-massive-scalability-with-32mb-blocks-and-beyond/19529" target="_blank" rel="noopener noreferrer">FullDAS: Towards Massive Scalability with 32MB Blocks and Beyond</a></p>
<p>[9] <a href="https://github.com/libp2p/specs/pull/681" target="_blank" rel="noopener noreferrer">Choke Extension for GossipSub</a></p>
<p>[10] <a href="https://ethresear.ch/t/pppt-fighting-the-gossipsub-overhead-with-push-pull-phase-transition/22118/1" target="_blank" rel="noopener noreferrer">PPPT: Fighting the GossipSub Overhead with Push-Pull Phase Transition</a></p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="background">Background<a href="https://research.logos.co/rlog/2025-zerokit-perf#background" class="hash-link" aria-label="Direct link to Background" title="Direct link to Background"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-challenge">The Challenge<a href="https://research.logos.co/rlog/2025-zerokit-perf#the-challenge" class="hash-link" aria-label="Direct link to The Challenge" title="Direct link to The Challenge"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-importance-of-benchmarks">The importance of benchmarks<a href="https://research.logos.co/rlog/2025-zerokit-perf#the-importance-of-benchmarks" class="hash-link" aria-label="Direct link to The importance of benchmarks" title="Direct link to The importance of benchmarks"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="benchmarking-with-rusts-criterion-crate">Benchmarking with Rust's criterion crate<a href="https://research.logos.co/rlog/2025-zerokit-perf#benchmarking-with-rusts-criterion-crate" class="hash-link" aria-label="Direct link to Benchmarking with Rust's criterion crate" title="Direct link to Benchmarking with Rust's criterion crate"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="promising-results">Promising results<a href="https://research.logos.co/rlog/2025-zerokit-perf#promising-results" class="hash-link" aria-label="Direct link to Promising results" title="Direct link to Promising results"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="conclusion">Conclusion<a href="https://research.logos.co/rlog/2025-zerokit-perf#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion"></a></h2>
<description><![CDATA[Welcome to the first edition of Nim in Logos — a newsletter covering major Nim features from Logos' perspective.]]></description>
<content:encoded><![CDATA[<p>Welcome to the first edition of <strong>Nim in Logos</strong> — a newsletter covering major Nim features from Logos' perspective.</p>
<p>If you have comments or suggestions, feel free to reach out to the authors directly or start a thread in the <a href="https://discord.gg/logosnetwork" target="_blank" rel="noopener noreferrer">Logos Discord server</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="nim-22---better-stability-smarter-memory-and-smoother-development">Nim 2.2 – Better Stability, Smarter Memory, and Smoother Development<a href="https://research.logos.co/rlog/nim-in-logos-01#nim-22---better-stability-smarter-memory-and-smoother-development" class="hash-link" aria-label="Direct link to Nim 2.2 – Better Stability, Smarter Memory, and Smoother Development" title="Direct link to Nim 2.2 – Better Stability, Smarter Memory, and Smoother Development"></a></h2>
<p>The Nim 2.2 release series focuses on improving language stability, fixing long-standing bugs, and optimizing performance—particularly in the ORC memory management system. The latest patch in this series, version 2.2.4, continues to build on these goals.</p>
<p>Here are some of the key highlights from the 2.2 series:</p>
<ul>
<li><strong>More powerful generics and type expressions:</strong> Stabilization of generics, typedesc, and static types. These features now support arbitrary expressions that previously only worked in limited cases, making them more reliable.</li>
<li><strong>Improved tuple unpacking:</strong> Tuple unpacking now supports discarding values using underscores (_) and allows inline type annotations for unpacked elements.</li>
<li><strong>Memory leak fixes:</strong> Issues with memory leaks when using std/nre’s regular expressions or nested exceptions have been resolved.</li>
<li><strong>More efficient async code:</strong> Futures no longer always copy data, resulting in better performance in asynchronous workflows.</li>
<li><strong>String bug fixes:</strong> Several issues involving string and cstring usage have been corrected.</li>
</ul>
<p>In addition to core language improvements:</p>
<ul>
<li><strong>NimSuggest stability:</strong> The language server has received multiple fixes, improving the experience in IDEs and editors that rely on NimSuggest for autocompletion and error checking.</li>
<li><strong>Better code generation:</strong> Numerous issues related to invalid or broken C and C++ code generation and backend-specific bugs have been addressed, improving Nim’s reliability when targeting other languages.</li>
</ul>
<p>You can read the full release announcement and changelog <a href="https://nim-lang.org/blog/2024/10/02/nim-220-2010.html" target="_blank" rel="noopener noreferrer">here</a></p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="error-handling-in-nim-why-results-beat-exceptions">Error Handling in Nim: Why Results Beat Exceptions<a href="https://research.logos.co/rlog/nim-in-logos-01#error-handling-in-nim-why-results-beat-exceptions" class="hash-link" aria-label="Direct link to Error Handling in Nim: Why Results Beat Exceptions" title="Direct link to Error Handling in Nim: Why Results Beat Exceptions"></a></h2>
<p>Error handling is one of the most critical aspects of writing reliable software, yet it remains a contentious topic in many programming languages. In Nim, developers face a unique challenge: multiple error handling paradigms are supported, leading to confusion about which approach to choose. For robust, maintainable code, our answer at Logos is increasingly clear—favor Result types over exceptions.</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-exception-problem">The Exception Problem<a href="https://research.logos.co/rlog/nim-in-logos-01#the-exception-problem" class="hash-link" aria-label="Direct link to The Exception Problem" title="Direct link to The Exception Problem"></a></h4>
<p>While exceptions might seem convenient for quick scripts and prototypes, they introduce significant challenges in complex, long-running applications:</p>
<ul>
<li><strong>Silent API Changes</strong>: One of the most dangerous aspects of exception-based error handling is that changes deep within dependencies can break your code without any compile-time warning. When a function suddenly starts throwing a new exception type, your code may fail at runtime under exceptional circumstances—often when you least expect it.</li>
<li><strong>Resource Management Issues</strong>: Exceptions create unpredictable control flow that can lead to resource leaks, security vulnerabilities, and unexpected crashes. When an exception unwinds the stack, resources may not be properly cleaned up.</li>
<li><strong>Refactoring Difficulties</strong>: The compiler provides little assistance when working with exception-based code. Adding a new exception type breaks the ABI but leaves the API unchanged, making it nearly impossible to track down all the places that need updating.</li>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-result-advantage">The Result Advantage<a href="https://research.logos.co/rlog/nim-in-logos-01#the-result-advantage" class="hash-link" aria-label="Direct link to The Result Advantage" title="Direct link to The Result Advantage"></a></h4>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="best-practices-for-result-based-error-handling">Best Practices for Result-Based Error Handling<a href="https://research.logos.co/rlog/nim-in-logos-01#best-practices-for-result-based-error-handling" class="hash-link" aria-label="Direct link to Best Practices for Result-Based Error Handling" title="Direct link to Best Practices for Result-Based Error Handling"></a></h4>
<li><strong>Make Errors Explicit</strong>: Use Result when multiple failure paths exist and calling code needs to differentiate between them. This makes error handling visible at the call site and forces developers to consciously handle failure cases.</li>
<li><strong>Handle Errors Locally</strong>: Address errors at each abstraction level rather than letting them bubble up through multiple layers. This prevents spurious abstraction leakage and keeps error handling logic close to where problems occur.</li>
<li><strong>Use Exception Tracking</strong>: Enable exception tracking with <code>{.push raises: [].}</code> at the module level. This helps identify any remaining exception-throwing code and ensures new code follows the Result pattern.</li>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="when-to-break-the-rules">When to Break the Rules<a href="https://research.logos.co/rlog/nim-in-logos-01#when-to-break-the-rules" class="hash-link" aria-label="Direct link to When to Break the Rules" title="Direct link to When to Break the Rules"></a></h4>
<p>While Result should be your default choice, exceptions still have their place:</p>
<ul>
<li><strong>Assertions and Logic Errors</strong>: Use assertions for violated preconditions or situations where recovery isn't possible or expected.</li>
<li><strong>Legacy Integration</strong>: When interfacing with exception-heavy libraries, you may need to use exceptions at integration boundaries, but convert them to Result types as quickly as possible. To ensure safe exception handling, explicitly declare which exceptions a procedure may raise using the <code>{.raises: [SpecificException].}</code> pragma.</li>
</ul>
<p>Error handling in Nim continues to evolve, but the trend is clear: explicit error handling through Result types provides better safety, maintainability, and debugging experience than exceptions. By making errors part of your function signatures and forcing explicit handling at call sites, you create more robust software that fails gracefully and predictably.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="debugging-in-nim">Debugging in Nim<a href="https://research.logos.co/rlog/nim-in-logos-01#debugging-in-nim" class="hash-link" aria-label="Direct link to Debugging in Nim" title="Direct link to Debugging in Nim"></a></h2>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="gdb">GDB<a href="https://research.logos.co/rlog/nim-in-logos-01#gdb" class="hash-link" aria-label="Direct link to GDB" title="Direct link to GDB"></a></h4>
<p>GDB can be used, and step-by-step debugging with GDB and VSCode is possible. However, the interaction is not very smooth. You can set breakpoints in VSCode and press F5 to run the program up to the breakpoint and continue debugging from there. That said, the state of variables is not fully demangled. For example:</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="logs---chronicles">Logs - Chronicles<a href="https://research.logos.co/rlog/nim-in-logos-01#logs---chronicles" class="hash-link" aria-label="Direct link to Logs - Chronicles" title="Direct link to Logs - Chronicles"></a></h4>
<p>At Logos, we primarily debug Nim applications using log outputs. In particular, we make extensive use of the <a href="https://github.com/status-im/nim-chronicles" target="_blank" rel="noopener noreferrer">nim-chronicles</a> library.</p>
<p><code>nim-chronicles</code> is a robust logging library that automatically includes the following contextual information in each log entry:</p>
<p>Additionally, <code>chronicles</code> supports attaching custom log messages along with relevant variable values, which proves especially useful for debugging. For instance, in the following example, the log message is <code>"Configuration. Shards"</code>, and it includes the value of an additional variable, <code>shard</code>.</p>
<p>There are also useful techniques for displaying more detailed information about specific variables:</p>
<ul>
<li><code>repr(p)</code> — Returns a string representation of the variable <code>p</code>, providing a more comprehensive view of its contents.</li>
<li><code>name(typeof(p))</code> — Extracts the type of the variable <code>p</code> as a string. This is particularly helpful when working with pointers or generics.</li>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="logs---echo">Logs - echo<a href="https://research.logos.co/rlog/nim-in-logos-01#logs---echo" class="hash-link" aria-label="Direct link to Logs - echo" title="Direct link to Logs - echo"></a></h4>
<p>The <a href="https://nim-lang.org/docs/system.html#echo%2Cvarargs%5Btyped%2C%5D" target="_blank" rel="noopener noreferrer">echo</a> statement in Nim serves as a basic debugging tool, although it is less powerful and flexible compared to <code>nim-chronicles</code>.</p>
<p>Besides, <a href="https://www.notion.so/Nim-in-Logos-July-2025-2038f96fb65c8042bcbbe676ee8f2182?pvs=21" target="_blank" rel="noopener noreferrer">debugEcho</a> is an interesting alternative, which behaves similarly to <code>echo</code> but it allows working on routines marked with no side effects.</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="heaptrack">Heaptrack<a href="https://research.logos.co/rlog/nim-in-logos-01#heaptrack" class="hash-link" aria-label="Direct link to Heaptrack" title="Direct link to Heaptrack"></a></h4>
<p>This technique enables precise insight into where memory is being consumed within a Nim application.</p>
<p>It is particularly useful for identifying potential memory leaks and is widely employed in <strong>nwaku</strong> (Nim Waku). For more details, refer to the documentation: <a href="https://github.com/waku-org/nwaku/blob/master/docs/tutorial/heaptrack.md" target="_blank" rel="noopener noreferrer">Heaptrack Tutorial</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="formatting-code-in-nim">Formatting code in Nim<a href="https://research.logos.co/rlog/nim-in-logos-01#formatting-code-in-nim" class="hash-link" aria-label="Direct link to Formatting code in Nim" title="Direct link to Formatting code in Nim"></a></h2>
<p>Maintaining a consistent code format is essential for readability and for facilitating clear diff comparisons during code reviews.</p>
<p>To support this, Logos strongly recommends using <a href="https://arnetheduck.github.io/nph/" target="_blank" rel="noopener noreferrer"><em>nph</em></a> across all Nim projects.</p>]]></content:encoded>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="introduction">Introduction<a href="https://research.logos.co/rlog/mdsecheck-method#introduction" class="hash-link" aria-label="Direct link to Introduction" title="Direct link to Introduction"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="mds-matrix-how-to-define-and-construct">MDS matrix: how to define and construct<a href="https://research.logos.co/rlog/mdsecheck-method#mds-matrix-how-to-define-and-construct" class="hash-link" aria-label="Direct link to MDS matrix: how to define and construct" title="Direct link to MDS matrix: how to define and construct"></a></h2>
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∣</mi></mrow><annotation encoding="application/x-tex">|</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord">∣</span></span></span></span> stands for vertical concatenation,
do not coincide in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span> or more components.
The set of all possible column vectors <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>v</mi><mtext></mtext><mi mathvariant="normal">∣</mi><mtext></mtext><mi>M</mi><mi>v</mi></mrow><annotation encoding="application/x-tex">v \: | \: M v</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord mathnormal" style="margin-right:0.03588em">v</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mord">∣</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span><span class="mord mathnormal" style="margin-right:0.03588em">v</span></span></span></span> for
some fixed matrix <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> is a systematic MDS code, i.e.
for which all entries in the concatenation of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">x</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">y</span></span></span></span> are distinct.
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="partial-substitution-permutation-networks">Partial substitution-permutation networks<a href="https://research.logos.co/rlog/mdsecheck-method#partial-substitution-permutation-networks" class="hash-link" aria-label="Direct link to Partial substitution-permutation networks" title="Direct link to Partial substitution-permutation networks"></a></h2>
as an <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span>-dimensional vector over some finite field,
and lies in replacing the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6595em"></span><span class="mord mathnormal">i</span></span></span></span>-th component of the internal state
replaces the internal state with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi><mi>X</mi><mo>+</mo><mi>c</mi></mrow><annotation encoding="application/x-tex">M X + c</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7667em;vertical-align:-0.0833em"></span><span class="mord mathnormal" style="margin-right:0.07847em">MX</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">c</span></span></span></span>,
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi></mrow><annotation encoding="application/x-tex">X</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07847em">X</span></span></span></span> is the current internal state,
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> is a nonsingular square matrix and
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">c</span></span></span></span> is the vector of the round constants.
The value of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">c</span></span></span></span> is specific to the cryptoprimitive
while <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> typically depends only on the cryptoprimitive.
The data flow diagram for an SPN is given below.</p>
In the case of P-SPNs, security considerations commonly demand to choose <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="square-mds-matrix-security-check-in-the-context-of-p-spns">Square MDS matrix security check in the context of P-SPNs<a href="https://research.logos.co/rlog/mdsecheck-method#square-mds-matrix-security-check-in-the-context-of-p-spns" class="hash-link" aria-label="Direct link to Square MDS matrix security check in the context of P-SPNs" title="Direct link to Square MDS matrix security check in the context of P-SPNs"></a></h2>
Such matrices are called insecure with respect to particular P-SPNs.</p>
<p>An infinitely long subspace trail of period <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi></mrow><annotation encoding="application/x-tex">l</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal" style="margin-right:0.01968em">l</span></span></span></span> exists for a P-SPN,
by means of the same <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi></mrow><annotation encoding="application/x-tex">l</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal" style="margin-right:0.01968em">l</span></span></span></span>-round transformation,
leads to existence of infinitely long subspace trails of period <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal">p</span></span></span></span>
for this P-SPN for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal">p</span></span></span></span> no larger than a given <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi></mrow><annotation encoding="application/x-tex">l</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal" style="margin-right:0.01968em">l</span></span></span></span>.
of non-existence of infinitely long subspace trails of period <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal">p</span></span></span></span>
for P-SPNs using this matrix for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal">p</span></span></span></span> no larger than a specified <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi></mrow><annotation encoding="application/x-tex">l</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal" style="margin-right:0.01968em">l</span></span></span></span>.</p>
<p>The sufficient test method is a direct consequence of
the minimal polynomial of the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal">p</span></span></span></span>-th power of the tested matrix
has maximum degree and is irreducible for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo>∈</mo><mo stretchy="false">[</mo><mn>1..</mn><mi>l</mi><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">p \in [1..l]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7335em;vertical-align:-0.1944em"></span><span class="mord mathnormal">p</span><span class="mspace" style="margin-right:0.2778em"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mopen">[</span><span class="mord">1..</span><span class="mord mathnormal" style="margin-right:0.01968em">l</span><span class="mclose">]</span></span></span></span>.
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="mdsecheck-method-getting-rid-of-the-matrix-powers">MDSECheck method: getting rid of the matrix powers<a href="https://research.logos.co/rlog/mdsecheck-method#mdsecheck-method-getting-rid-of-the-matrix-powers" class="hash-link" aria-label="Direct link to MDSECheck method: getting rid of the matrix powers" title="Direct link to MDSECheck method: getting rid of the matrix powers"></a></h2>
of a root of the characteristic polynomial of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span>
are all prime divisors of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span>.</p>
</li>
<li>
<p>The non-presence check reuses some data computed during
the checking for irreducibility the minimal polynomial of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span>,
which in this case coincides with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo stretchy="false">(</mo><mi>y</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">f(y)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord mathnormal" style="margin-right:0.10764em">f</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em">y</span><span class="mclose">)</span></span></span></span>
designating the characteristic polynomial of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span>.
only one system of linear equations over <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi><mi>F</mi><mo stretchy="false">(</mo><mi>q</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">GF(q)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord mathnormal" style="margin-right:0.13889em">GF</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em">q</span><span class="mclose">)</span></span></span></span>.
If <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> has an irreducible minimal polynomial of maximum degree,
then the minimal polynomial of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> does not have such properties.</p>
</li>
</ol>
<p>The correctness of the first distinctive feature can be proven as follows.
Hence, due to matrix similarity properties, there is some matrix <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>S</mi></mrow><annotation encoding="application/x-tex">S</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.05764em">S</span></span></span></span>
because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>h</mi></mrow><annotation encoding="application/x-tex">h</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal">h</span></span></span></span> divides the quotient of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span> and some of its prime factors.
because at this point <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo stretchy="false">(</mo><mi>y</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">f(y)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord mathnormal" style="margin-right:0.10764em">f</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em">y</span><span class="mclose">)</span></span></span></span> is known to be irreducible,
and some root of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo stretchy="false">(</mo><mi>y</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">f(y)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord mathnormal" style="margin-right:0.10764em">f</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em">y</span><span class="mclose">)</span></span></span></span> is mapped by this isomorphism to
the residue class the polynomial <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">y</span></span></span></span> in this ring.</p>
</li>
<li>
<p>All elements of a finite field <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi><mi>F</mi><mo stretchy="false">(</mo><msup><mi>q</mi><mi>w</mi></msup><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">GF(q^w)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord mathnormal" style="margin-right:0.13889em">GF</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03588em">q</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6644em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.02691em">w</span></span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span> and only they
The <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span> x <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span> matrix <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> does not have a minimal polynomial of maximum degree,
if some Krylov subspace of order <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span> for it is not <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span>-dimensional.
and in the considered case the latter polynomial has degree less than <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span>,
If <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi></mrow><annotation encoding="application/x-tex">A</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal">A</span></span></span></span> is singular,
the minimal polynomial of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> is reducible or does not have maximum degree,
so checking <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> has been accomplished;
otherwise, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo stretchy="false">(</mo><mi>y</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">f(y)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord mathnormal" style="margin-right:0.10764em">f</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em">y</span><span class="mclose">)</span></span></span></span>, which is the minimal and characteristic polynomial of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span>,
can be expressed as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mi>n</mi></msup><mo>−</mo><msub><mi>X</mi><mrow><mi>n</mi><mtext></mtext><mo>−</mo><mtext></mtext><mn>1</mn></mrow></msub><msup><mi>y</mi><mrow><mi>n</mi><mtext></mtext><mo>−</mo><mtext></mtext><mn>1</mn></mrow></msup><mo>−</mo><msub><mi>X</mi><mrow><mi>n</mi><mtext></mtext><mo>−</mo><mtext></mtext><mn>2</mn></mrow></msub><msup><mi>y</mi><mrow><mi>n</mi><mtext></mtext><mo>−</mo><mtext></mtext><mn>2</mn></mrow></msup><mo>−</mo><mo>…</mo><mo>−</mo><msub><mi>X</mi><mn>1</mn></msub><mi>y</mi><mo>−</mo><msub><mi>X</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">y^n - X_{n \: - \: 1} y^{n \: - \: 1} -
and the unconditional P-SPN security level bound <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi></mrow><annotation encoding="application/x-tex">l</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal" style="margin-right:0.01968em">l</span></span></span></span> are received as inputs.</p>
</li>
<li>
<p>The Krylov method fragment is used to compute the minimal polynomial of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span>.
If the computation fails, then <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> is not unconditionally secure,
so the check of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> is complete.
and, therefore, coincides with the characteristic polynomial of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span>.</p>
</li>
<li>
<p>Algorithm 2.2.9 is used
to check for irreducibility the minimal polynomial of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span>,
which is also the characteristic polynomial of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> in this case.
If the polynomial is reducible, then the check of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> is complete,
because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> has been found to be not unconditionally secure.</p>
so the check of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">M</span></span></span></span> is complete.
then the unconditional P-SPN security level is at least <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi></mrow><annotation encoding="application/x-tex">l</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal" style="margin-right:0.01968em">l</span></span></span></span>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="mdsecheck-library-crate-implementation-in-rust">MDSECheck library crate: implementation in Rust<a href="https://research.logos.co/rlog/mdsecheck-method#mdsecheck-library-crate-implementation-in-rust" class="hash-link" aria-label="Direct link to MDSECheck library crate: implementation in Rust" title="Direct link to MDSECheck library crate: implementation in Rust"></a></h2>
<p>The library crate <a href="https://research.logos.co/rlog/mdsecheck-method#references">[3]</a> provides tools for
the crates ark-ff <a href="https://research.logos.co/rlog/mdsecheck-method#references">[9]</a> and ark-poly <a href="https://research.logos.co/rlog/mdsecheck-method#references">[10]</a>.
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="conclusion">Conclusion<a href="https://research.logos.co/rlog/mdsecheck-method#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="references">References<a href="https://research.logos.co/rlog/mdsecheck-method#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References"></a></h2>
<li>L. Grassi, D. Khovratovich, C. Rechberger, A. Roy, M. Schofnegger. "<a href="https://eprint.iacr.org/2019/458.pdf" target="_blank" rel="noopener noreferrer">POSEIDON: A New Hash Function for Zero-Knowledge Proof Systems (Updated Version)</a>".</li>
<li>L. Grassi, C. Rechberger, M. Schofnegger. "<a href="https://eprint.iacr.org/2020/500.pdf" target="_blank" rel="noopener noreferrer">Proving Resistance Against Infinitely Long Subspace Trails: How to Choose the Linear Layer</a>".</li>
<li>The page "<a href="https://crates.io/crates/mdsecheck" target="_blank" rel="noopener noreferrer">mdsecheck</a>" on crates.io.</li>
<li>Y. Kumar, P. Mishra, S. Samanta, K. Chand Gupta, A. Gaur. "<a href="https://arxiv.org/pdf/2403.10372" target="_blank" rel="noopener noreferrer">Construction of all MDS and involutory MDS matrices</a>".</li>
<li>The page "<a href="https://proofwiki.org/wiki/Value_of_Cauchy_Determinant" target="_blank" rel="noopener noreferrer">Value of Cauchy Determinant</a>" on proofwiki.org.</li>
<li>T. Silva, R. Dahab "<a href="https://www.ic.unicamp.br/~reltech/PFG/2021/PFG-21-43.pdf" target="_blank" rel="noopener noreferrer">MDS Matrices for Cryptography</a>".</li>
<li>S. Huczynska, M. Neunhöffer. "<a href="http://www.math.rwth-aachen.de/~Max.Neunhoeffer/Teaching/ff2012/ff2012.pdf" target="_blank" rel="noopener noreferrer">Finite Fields</a>"</li>
<li>R. Crandall, C. Pomerance. "<a href="http://thales.doa.fmph.uniba.sk/macaj/skola/teoriapoli/primes.pdf" target="_blank" rel="noopener noreferrer">Prime Numbers: A Computational Perspective</a>" (2nd edition).</li>
<li>The page "<a href="https://crates.io/crates/ark-ff" target="_blank" rel="noopener noreferrer">ark-ff</a>" on crates.io.</li>
<li>The page "<a href="https://crates.io/crates/ark-poly" target="_blank" rel="noopener noreferrer">ark-poly</a>" on crates.io.</li>
<li>The page "<a href="https://crates.io/crates/ark-bn254" target="_blank" rel="noopener noreferrer">ark-bn254</a>" on crates.io.</li>
Logos Research is proud to reflect on the milestones and breakthroughs that defined another year of researching and developing free and open digital public goods for the <a href="https://free.technology/" target="_blank" rel="noopener noreferrer">Institute of Free Technology</a> and wider web3 ecosystem.</p>
<p>Logos Research comprises various subteams and service units, each with its own focus.
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="nescience">Nescience<a href="https://research.logos.co/rlog/2024-recap#nescience" class="hash-link" aria-label="Direct link to Nescience" title="Direct link to Nescience"></a></h2>
<p>Nescience is our state separation architecture that aims to enable private transactions and provide a general-purpose execution environment for classical applications.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="highlights">Highlights<a href="https://research.logos.co/rlog/2024-recap#highlights" class="hash-link" aria-label="Direct link to Highlights" title="Direct link to Highlights"></a></h3>
<li><a href="https://vac.dev/rlog/zkVM-testing/" target="_blank" rel="noopener noreferrer">Benchmarked the performance of the six zkVMs</a> that best fit Nescience</li>
</ul>
</li>
<li>Defined the NSSA architecture<!-- -->
<ul>
<li>Brought clarity to NSSA’s design and explained the system’s architecture <a href="https://vac.dev/rlog/Nescience-state-separation-architecture/" target="_blank" rel="noopener noreferrer">in a lengthy exploratory blog post</a></li>
</ul>
</li>
<li>Built the sandboxed testnet<!-- -->
<ul>
<li>Designed the first version of the node specification</li>
<li>All core components (execution types, UTXOs, cryptographic primitives) implemented and being tested</li>
<li>Testing the performance of all execution types in various scenarios</li>
</ul>
</li>
</ul>
<p>We also made progress on the essential parts of NSSA’s system, including:</p>
<ul>
<li>Key protocol for secure key management</li>
<li>Execution types and circuits for reliable computation</li>
<li>UTXO specification to manage state transitions effectively</li>
<li>Cryptography module to ensure privacy and security</li>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="looking-forward">Looking forward<a href="https://research.logos.co/rlog/2024-recap#looking-forward" class="hash-link" aria-label="Direct link to Looking forward" title="Direct link to Looking forward"></a></h3>
<p>In 2025, the Nescience team plans to double down on what works, fix what doesn’t, and push NSSA closer to real-world use.</p>
<ul>
<li>Sandboxed testnet data analysis – the sandboxed testnet will be our primary data source that we will analyse to identify issues, limitations, and areas for improvement.</li>
<li>Expanding the node – expand sandboxed components into a full node implementation with rigorous testing and iterative optimization (to bridge the gap between proof of concept and production readiness).</li>
<li>Finalizing the architecture and RFC – after completing NSSA’s architecture, we will draft an RFC to ensure transparency and enable greater collaboration with the broader ecosystem.</li>
<li>Testing real-life scenarios – applying NSSA to diverse, practical use cases to assess its adaptability, performance, and impact.</li>
<li>Ongoing optimization – ensure NSSA is robust, efficient, and ready to scale.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="token-economics-tke">Token Economics (TKE)<a href="https://research.logos.co/rlog/2024-recap#token-economics-tke" class="hash-link" aria-label="Direct link to Token Economics (TKE)" title="Direct link to Token Economics (TKE)"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="highlights-1">Highlights<a href="https://research.logos.co/rlog/2024-recap#highlights-1" class="hash-link" aria-label="Direct link to Highlights" title="Direct link to Highlights"></a></h3>
<li>Formalized and implemented <a href="https://codex.storage/" target="_blank" rel="noopener noreferrer">Codex</a> economic incentives in the Litepaper and simulations</li>
<li>Orchestrated Status Network incentive structure and smart contract implementation</li>
<li>Started building <a href="https://nomos.tech/" target="_blank" rel="noopener noreferrer">Nomos’s</a> economic model</li>
<li>Consulted and provided analysis of incentives for the Logos Operators ordinals project</li>
<li>Drove discussions on the economic sustainability of <a href="https://waku.org/" target="_blank" rel="noopener noreferrer">Waku</a>;
helped define RLN membership and its payment mechanism</li>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="looking-forward-1">Looking forward<a href="https://research.logos.co/rlog/2024-recap#looking-forward-1" class="hash-link" aria-label="Direct link to Looking forward" title="Direct link to Looking forward"></a></h3>
Additionally, the service unit aims to continue building its external reputation through partnerships and publications of relevant work on the <a href="https://forum.research.logos.co/" target="_blank" rel="noopener noreferrer">Logos Research forum</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="quality-assurance-qa">Quality Assurance (QA)<a href="https://research.logos.co/rlog/2024-recap#quality-assurance-qa" class="hash-link" aria-label="Direct link to Quality Assurance (QA)" title="Direct link to Quality Assurance (QA)"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="highlights-2">Highlights<a href="https://research.logos.co/rlog/2024-recap#highlights-2" class="hash-link" aria-label="Direct link to Highlights" title="Direct link to Highlights"></a></h3>
<li>Matured Waku interoperability testing framework with coverage for all major protocols and features</li>
<li>Began collaboration with Nomos, contributing to unit and integration testing</li>
<li>Partnered with the <a href="https://status.app/" target="_blank" rel="noopener noreferrer">Status</a> team to test message reliability under unstable network conditions</li>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="looking-forward-2">Looking forward<a href="https://research.logos.co/rlog/2024-recap#looking-forward-2" class="hash-link" aria-label="Direct link to Looking forward" title="Direct link to Looking forward"></a></h3>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="rfc">RFC<a href="https://research.logos.co/rlog/2024-recap#rfc" class="hash-link" aria-label="Direct link to RFC" title="Direct link to RFC"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="highlights-3">Highlights<a href="https://research.logos.co/rlog/2024-recap#highlights-3" class="hash-link" aria-label="Direct link to Highlights" title="Direct link to Highlights"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="looking-forward-3">Looking forward<a href="https://research.logos.co/rlog/2024-recap#looking-forward-3" class="hash-link" aria-label="Direct link to Looking forward" title="Direct link to Looking forward"></a></h3>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="applied-cryptography-and-zk-acz">Applied Cryptography and ZK (ACZ)<a href="https://research.logos.co/rlog/2024-recap#applied-cryptography-and-zk-acz" class="hash-link" aria-label="Direct link to Applied Cryptography and ZK (ACZ)" title="Direct link to Applied Cryptography and ZK (ACZ)"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="highlights-4">Highlights<a href="https://research.logos.co/rlog/2024-recap#highlights-4" class="hash-link" aria-label="Direct link to Highlights" title="Direct link to Highlights"></a></h3>
and <a href="https://github.com/vacp2p/stealth-address-kit/releases/tag/v0.1.0" target="_blank" rel="noopener noreferrer">v0.1.0</a></li>
<li>Published:<!-- -->
<ul>
<li><a href="https://vac.dev/rlog/rln-light-verifiers/" target="_blank" rel="noopener noreferrer">Verifying RLN Proofs in Light Clients with Subtrees</a></li>
<li><a href="https://vac.dev/rlog/rln-v3/" target="_blank" rel="noopener noreferrer">RLN-v3: Towards a Flexible and Cost-Efficient Implementation</a></li>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="looking-forward-4">Looking forward<a href="https://research.logos.co/rlog/2024-recap#looking-forward-4" class="hash-link" aria-label="Direct link to Looking forward" title="Direct link to Looking forward"></a></h3>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="p2p">P2P<a href="https://research.logos.co/rlog/2024-recap#p2p" class="hash-link" aria-label="Direct link to P2P" title="Direct link to P2P"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="highlights-5">Highlights<a href="https://research.logos.co/rlog/2024-recap#highlights-5" class="hash-link" aria-label="Direct link to Highlights" title="Direct link to Highlights"></a></h3>
<li>PR to libp2p specifications about specific lib2p GossipSub improvements we researched and tested <a href="https://github.com/libp2p/specs/pull/654" target="_blank" rel="noopener noreferrer">https://github.com/libp2p/specs/pull/654</a></li>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="looking-forward-5">Looking forward<a href="https://research.logos.co/rlog/2024-recap#looking-forward-5" class="hash-link" aria-label="Direct link to Looking forward" title="Direct link to Looking forward"></a></h3>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="distributed-systems-testing-dst">Distributed Systems Testing (DST)<a href="https://research.logos.co/rlog/2024-recap#distributed-systems-testing-dst" class="hash-link" aria-label="Direct link to Distributed Systems Testing (DST)" title="Direct link to Distributed Systems Testing (DST)"></a></h2>
<p>The DST Service Unit’s primary objective is to assist IFT portfolio projects in understanding the scaling behavior of their nodes within larger networks.
By conducting thorough regression testing, the DST unit helps ensure the reliability and stability of projects.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="highlights-6">Highlights<a href="https://research.logos.co/rlog/2024-recap#highlights-6" class="hash-link" aria-label="Direct link to Highlights" title="Direct link to Highlights"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="looking-forward-6">Looking forward<a href="https://research.logos.co/rlog/2024-recap#looking-forward-6" class="hash-link" aria-label="Direct link to Looking forward" title="Direct link to Looking forward"></a></h3>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="nim">Nim<a href="https://research.logos.co/rlog/2024-recap#nim" class="hash-link" aria-label="Direct link to Nim" title="Direct link to Nim"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="highlights-7">Highlights<a href="https://research.logos.co/rlog/2024-recap#highlights-7" class="hash-link" aria-label="Direct link to Highlights" title="Direct link to Highlights"></a></h3>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="smart-contracts-sc">Smart Contracts (SC)<a href="https://research.logos.co/rlog/2024-recap#smart-contracts-sc" class="hash-link" aria-label="Direct link to Smart Contracts (SC)" title="Direct link to Smart Contracts (SC)"></a></h2>
<p>Logos Research's Smart Contracts Service Unit ensures the smart contracts deployed across the various IFT portfolio projects are secure, robust, and aligned with project requirements.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="highlights-8">Highlights<a href="https://research.logos.co/rlog/2024-recap#highlights-8" class="hash-link" aria-label="Direct link to Highlights" title="Direct link to Highlights"></a></h3>
<li>Deployed the SNT staking protocol testnet following Status's <a href="https://our.status.im/snt-vote-results/" target="_blank" rel="noopener noreferrer">governance vote</a> to develop SNT staking and Status Network</li>
<li>Wrote specifications for <a href="https://github.com/codex-storage/codex-contracts-eth/tree/master/certora/specs" target="_blank" rel="noopener noreferrer">Codex's architectural components</a> and <a href="https://github.com/vacp2p/staking-reward-streamer/tree/main/certora/specs" target="_blank" rel="noopener noreferrer">Status's staking contracts</a></li>
<li>Delivered several learn-up sessions on a variety of topics for IFT contributors, including:<!-- -->
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="looking-forward-7">Looking forward<a href="https://research.logos.co/rlog/2024-recap#looking-forward-7" class="hash-link" aria-label="Direct link to Looking forward" title="Direct link to Looking forward"></a></h3>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="heading-into-2025">Heading into 2025<a href="https://research.logos.co/rlog/2024-recap#heading-into-2025" class="hash-link" aria-label="Direct link to Heading into 2025" title="Direct link to Heading into 2025"></a></h2>
<p>This year has seen Logos Research involved with many research, development, and testing undertakings in support of IFT portfolio projects.
The digital public goods that emerge from our efforts not only support the organization itself but are open and free to use by any project that would benefit.</p>
<p>As we move into 2025, we aim to nurture a stronger RFC culture across the IFT to encourage greater collaboration and knowledge sharing among portfolio projects.
Our goal is to serve as an internal conduit of expertise within the organization, supported by a strong RFC culture, maintaining a repository of internal knowledge creation, and identifying and facilitating IFT project synergies.
<p>We also aim to establish a diverse research community around Logos Research, and our efforts in this regard are already underway.
In the final quarter of 2024, Logos Research stepped up its collaboration with the libp2p community and made a concerted effort to engage the community on the <a href="https://forum.research.logos.co/" target="_blank" rel="noopener noreferrer">Logos Research forum</a>.
In 2025, we aim to continue working closely with those communities to which we already have ties, such as the libp2p, Ethereum, and Nim ecosystems.</p>
<p>We look forward to continuing our journey with you!</p>
<p><em>Follow <a href="https://x.com/LogosRnD" target="_blank" rel="noopener noreferrer">Logos Research on X</a>, join us in the <a href="https://discord.gg/FPSXQ9afJE" target="_blank" rel="noopener noreferrer">Logos Research Discord</a>, or take part in the discussions on the <a href="https://forum.research.logos.co/" target="_blank" rel="noopener noreferrer">Logos Research forum</a> to stay up to date with our research and development progress.</em></p>]]></content:encoded>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="introduction">Introduction<a href="https://research.logos.co/rlog/climbing-merkle-trees#introduction" class="hash-link" aria-label="Direct link to Introduction" title="Direct link to Introduction"></a></h2>
the storage space required to maintain a copy of every transaction becomes untenable for most users.
However, the integrity of a blockchain relies on a large pool of users that can validate the blockchain's history from its inception to its present state.
The data representing the blockchain's state is compressed.
As mentioned, it is essential for users to be able to validate the blockchain's history.
The property of compression and validation was solved in Bitcoin by the use of Merkle trees.
Merkle trees were introduced first by Ralph Merkle in his dissertation [<a href="https://www.ralphmerkle.com/papers/Thesis1979.pdf" target="_blank" rel="noopener noreferrer">1</a>].
A Merkle tree is a data structure that compresses a digest of data to a constant size while still providing a method for proving membership of elements of the digest.
A previous rlog[<a href="https://research.logos.co/rlog/rln-light-verifiers/" target="_blank" rel="noopener noreferrer">2</a>] described how Merkle trees with their proof of membership could be used for lightweight clients for RLN.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="tree-structure">Tree structure<a href="https://research.logos.co/rlog/climbing-merkle-trees#tree-structure" class="hash-link" aria-label="Direct link to Tree structure" title="Direct link to Tree structure"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="merkle-trees">Merkle trees<a href="https://research.logos.co/rlog/climbing-merkle-trees#merkle-trees" class="hash-link" aria-label="Direct link to Merkle trees" title="Direct link to Merkle trees"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="construction">Construction<a href="https://research.logos.co/rlog/climbing-merkle-trees#construction" class="hash-link" aria-label="Direct link to Construction" title="Direct link to Construction"></a></h3>
<p>In this section, we show how Merkle trees are constructed to compress a digest <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span>.
we assume that the digest <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> has this many entries since a Merkle tree is a binary tree.
Additionally, each digest can be padded to ensure that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> has the desired number of entries.</p>
<p>Each leaf of the Merkle tree contains the hash of a digest entry.
The root hash is a compressed representation of the digest <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span>.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="merkle-tree-intregrity">Merkle tree intregrity<a href="https://research.logos.co/rlog/climbing-merkle-trees#merkle-tree-intregrity" class="hash-link" aria-label="Direct link to Merkle tree intregrity" title="Direct link to Merkle tree intregrity"></a></h3>
<p>The Merkle tree is able to bind a digest with one of the properties of hash functions (see our previous Logos Research 101 [<a href="https://research.logos.co/rlog/vac101-fiat-shamir#hash-functions" target="_blank" rel="noopener noreferrer">3</a>] for information on hash functions).
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="proof-of-membership">Proof of membership<a href="https://research.logos.co/rlog/climbing-merkle-trees#proof-of-membership" class="hash-link" aria-label="Direct link to Proof of membership" title="Direct link to Proof of membership"></a></h3>
<p>An interesting and critical property of Merkle trees is their ability to prove that any piece of data is part of its digest.
This can be done with logarithmic storage and logarithmic computation time.</p>
<p>Suppose that we want to show that data <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">ℓ</mi></mrow><annotation encoding="application/x-tex">\ell</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord">ℓ</span></span></span></span> is part of the Merkle tree's digest.
Additionally, suppose that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="sans-serif">h</mi><mi mathvariant="sans-serif">a</mi><mi mathvariant="sans-serif">s</mi><mi mathvariant="sans-serif">h</mi></mrow><annotation encoding="application/x-tex">\mathsf{hash}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord"><span class="mord mathsf">hash</span></span></span></span></span> is the hash function used to construct the tree.
We assume that the hash function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="sans-serif">h</mi><mi mathvariant="sans-serif">a</mi><mi mathvariant="sans-serif">s</mi><mi mathvariant="sans-serif">h</mi></mrow><annotation encoding="application/x-tex">\mathsf{hash}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord"><span class="mord mathsf">hash</span></span></span></span></span> can be computed in constant-time for any input.</p>
<p>Suppose that a prover provides data <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">ℓ</mi></mrow><annotation encoding="application/x-tex">\ell</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord">ℓ</span></span></span></span> to a verifier,
and tells the verifier that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">ℓ</mi></mrow><annotation encoding="application/x-tex">\ell</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord">ℓ</span></span></span></span> corresponds to the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6595em"></span><span class="mord mathnormal">i</span></span></span></span>th leaf of the Merkle tree.
For the verifier to be convinced that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">ℓ</mi></mrow><annotation encoding="application/x-tex">\ell</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord">ℓ</span></span></span></span> is part of the digest, he needs to be able to construct the tree's root hash using <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="sans-serif">h</mi><mi mathvariant="sans-serif">a</mi><mi mathvariant="sans-serif">s</mi><mi mathvariant="sans-serif">h</mi></mrow><annotation encoding="application/x-tex">\mathsf{hash}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord"><span class="mord mathsf">hash</span></span></span></span></span>, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6595em"></span><span class="mord mathnormal">i</span></span></span></span>, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">ℓ</mi></mrow><annotation encoding="application/x-tex">\ell</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord">ℓ</span></span></span></span> and some additional information from the prover.
<p>The leaf index <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6595em"></span><span class="mord mathnormal">i</span></span></span></span> indicates whether a hash value provided by the prover is a left or right sibling.
This is done by looking at the binary expansion of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6595em"></span><span class="mord mathnormal">i</span></span></span></span>.</p>
depending on whether <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>h</mi><mn>0</mn><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup></mrow><annotation encoding="application/x-tex">h'_0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.2481em"></span><span class="mord"><span class="mord mathnormal">h</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.7519em"><span style="top:-2.4519em;margin-left:0em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">0</span></span></span><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.2481em"><span></span></span></span></span></span></span></span></span></span> is a left or right sibling.
This pathing continues until the verifier either successfully computes the root hash (in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">n+1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6667em;vertical-align:-0.0833em"></span><span class="mord mathnormal">n</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:0.6444em"></span><span class="mord">1</span></span></span></span> hashes) or fails to do so.</p>
<p>The prover has to provide <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span> sibling nodes for the proof of membership.</p>
<p>There is a key detail that is essential for the proof of membership to be secure.
The root hash has to be provided to the verifier prior to the selection of data <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">ℓ</mi></mrow><annotation encoding="application/x-tex">\ell</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord">ℓ</span></span></span></span>.
Otherwise, the prover could generate a series of hash values (with the corresponding root hash) to forge a proof of membership.</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="capped-proof-of-membership">Capped proof of membership<a href="https://research.logos.co/rlog/climbing-merkle-trees#capped-proof-of-membership" class="hash-link" aria-label="Direct link to Capped proof of membership" title="Direct link to Capped proof of membership"></a></h4>
<p>Polygon provides an implementation [<a href="https://github.com/0xPolygonZero/plonky2/blob/main/plonky2/src/hash/merkle_tree.rs" target="_blank" rel="noopener noreferrer">4</a>] of a shortened proof of membership with a slight modification.
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="extensions-of-merkle-trees">Extensions of Merkle trees<a href="https://research.logos.co/rlog/climbing-merkle-trees#extensions-of-merkle-trees" class="hash-link" aria-label="Direct link to Extensions of Merkle trees" title="Direct link to Extensions of Merkle trees"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="sparse-merkle-trees">Sparse Merkle trees<a href="https://research.logos.co/rlog/climbing-merkle-trees#sparse-merkle-trees" class="hash-link" aria-label="Direct link to Sparse Merkle trees" title="Direct link to Sparse Merkle trees"></a></h3>
<p>Let <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span> denote the number of bits that a hash value can possess. This means that our SMT can have at most <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mi>n</mi></msup></mrow><annotation encoding="application/x-tex">2^n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6644em"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6644em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span></span></span></span></span></span></span></span> leaves.</p>
<p>An SMT is treated as a Merkle tree in which each entry is placed in the leaf corresponding to its hash value, and the other entries have a <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="sans-serif">n</mi><mi mathvariant="sans-serif">u</mi><mi mathvariant="sans-serif">l</mi><mi mathvariant="sans-serif">l</mi></mrow><annotation encoding="application/x-tex">\mathsf{null}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord"><span class="mord mathsf">null</span></span></span></span></span> marker inserted in.
However, we can also prove nonmembership of an element by showing that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="sans-serif">n</mi><mi mathvariant="sans-serif">u</mi><mi mathvariant="sans-serif">l</mi><mi mathvariant="sans-serif">l</mi></mrow><annotation encoding="application/x-tex">\mathsf{null}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord"><span class="mord mathsf">null</span></span></span></span></span> is located in the element's hash location.
The crucial difference between a sorted and unsorted SMT is that the unsorted variant cannot be used to prove nonmembership.</p>
<p>We can take advantage of the sparse nature of SMTs to provide shortened proofs.
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="proof-of-nonmembership">Proof of nonmembership<a href="https://research.logos.co/rlog/climbing-merkle-trees#proof-of-nonmembership" class="hash-link" aria-label="Direct link to Proof of nonmembership" title="Direct link to Proof of nonmembership"></a></h3>
<p>In the first Logos Research 101 [<a href="https://research.logos.co/rlog/vac101-membership-with-bloom-filters-and-cuckoo-filters" target="_blank" rel="noopener noreferrer">5</a>], we examined Bloom and Cuckoo filters that could be used for proof of membership and nonmembership.
Our entire digest could consist of a maximum of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mn>256</mn></msup></mrow><annotation encoding="application/x-tex">2^{256}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8141em"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">256</span></span></span></span></span></span></span></span></span></span></span></span> entries.
This assumes that our digest does not contain collisions.</p>
<p>The fingerprint of a piece of data <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">ℓ</mi></mrow><annotation encoding="application/x-tex">\ell</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord">ℓ</span></span></span></span> indicates which leaf of the SMT it is contained in.
This means that a nonmembership of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">ℓ</mi></mrow><annotation encoding="application/x-tex">\ell</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord">ℓ</span></span></span></span> in the SMT becomes a matter of proving that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="sans-serif">n</mi><mi mathvariant="sans-serif">u</mi><mi mathvariant="sans-serif">l</mi><mi mathvariant="sans-serif">l</mi></mrow><annotation encoding="application/x-tex">\mathsf{null}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord"><span class="mord mathsf">null</span></span></span></span></span> is contained in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">ℓ</mi></mrow><annotation encoding="application/x-tex">\ell</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord">ℓ</span></span></span></span>'s location.</p>
<p>It is crucial for the SMT to be sorted.
Otherwise, a malicious party can append the entry <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">ℓ</mi></mrow><annotation encoding="application/x-tex">\ell</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord">ℓ</span></span></span></span> to a random location.
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="verkle-trees">Verkle Trees<a href="https://research.logos.co/rlog/climbing-merkle-trees#verkle-trees" class="hash-link" aria-label="Direct link to Verkle Trees" title="Direct link to Verkle Trees"></a></h3>
The multiple <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">k-1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7778em;vertical-align:-0.0833em"></span><span class="mord mathnormal" style="margin-right:0.03148em">k</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:0.6444em"></span><span class="mord">1</span></span></span></span> is the number of silbings that a node has on each layer.
Hence, the proof size grows faster than a logarithmic function of the digest size.</p>
<p>An alternate approach is to use a different data structure: Verkle trees [<a href="https://math.mit.edu/research/highschool/primes/materials/2018/Kuszmaul.pdf" target="_blank" rel="noopener noreferrer">6</a>].
We will explore Verkle trees in a future Logos Research 101 edition.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="references">References<a href="https://research.logos.co/rlog/climbing-merkle-trees#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References"></a></h2>
<li><a href="https://www.ralphmerkle.com/papers/Thesis1979.pdf" target="_blank" rel="noopener noreferrer">Secrecy, Authentication, and Public Key Systems</a></li>
<li><a href="https://research.logos.co/rlog/vac101-fiat-shamir#hash-functions" target="_blank" rel="noopener noreferrer">Logos Research 101: Transforming an Interactive Protocol to a Noninteractive Argument</a></li>
<li><a href="https://github.com/0xPolygonZero/plonky2/blob/main/plonky2/src/hash/merkle_tree.rs" target="_blank" rel="noopener noreferrer">Capped merkle tree in Plonky2</a></li>
<li><a href="https://research.logos.co/rlog/vac101-membership-with-bloom-filters-and-cuckoo-filters" target="_blank" rel="noopener noreferrer">Logos Research 101: Membership with Bloom Filters and Cuckoo Filters</a></li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="motivation">Motivation<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#motivation" class="hash-link" aria-label="Direct link to Motivation" title="Direct link to Motivation"></a></h2>
<p>The challenge of large message transmissions in GossipSub leads to longer than expected network-wide message dissemination times (and relatively higher fluctuations).
such as Ethereum and Waku [<a href="https://eips.ethereum.org/EIPS/eip-4844" target="_blank" rel="noopener noreferrer">1</a>,<a href="https://docs.waku.org/research/research-and-studies/message-propagation/" target="_blank" rel="noopener noreferrer">2</a>].</p>
<p>This matter has been extensively discussed in the libp2p community [<a href="https://github.com/libp2p/rust-libp2p/pull/3666" target="_blank" rel="noopener noreferrer">3</a>,
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="problem-description">Problem description<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#problem-description" class="hash-link" aria-label="Direct link to Problem description" title="Direct link to Problem description"></a></h2>
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi><mo separator="true">,</mo><mi>D</mi></mrow><annotation encoding="application/x-tex">X, D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8778em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.07847em">X</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> represent the round number and mesh size.</p>
<p>Transmitting to a higher number of peers (floodpublish) can theoretically reduce latency by increasing the transmissions in each round to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>D</mi><mo>−</mo><mn>1</mn><msup><mo stretchy="false">)</mo><mrow><mi>X</mi><mo>−</mo><mn>1</mn></mrow></msup><mo>×</mo><mo stretchy="false">(</mo><mi>F</mi><mo>+</mo><mi>D</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(D-1)^{X-1} \times (F+D)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.02778em">D</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:1.0913em;vertical-align:-0.25em"></span><span class="mord">1</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8413em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.07847em">X</span><span class="mbin mtight">−</span><span class="mord mtight">1</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">×</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.13889em">F</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span><span class="mclose">)</span></span></span></span>,
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>F</mi></mrow><annotation encoding="application/x-tex">F</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.13889em">F</span></span></span></span> represents the number of peers included in floodpublish.</p>
<p>This arrangement works fine for relatively small/moderate message sizes.
However, as message sizes increase, significant rises and fluctuations in network-wide message dissemination time are seen.</p>
<p>Interestingly, a higher <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> or <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>F</mi></mrow><annotation encoding="application/x-tex">F</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.13889em">F</span></span></span></span> can also degrade performance in this situation.</p>
<p>Several aspects contribute to this behavior:</p>
Moreover, the benefits of sequential message relaying can be compromised by prioritizing slow (or busy) peers.</p>
</li>
<li>
<p>Most use cases necessitate validating received messages before forwarding them to the next-hop peers.
For a higher message transfer time <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>τ</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(\tau )</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.1132em">τ</span><span class="mclose">)</span></span></span></span>, this store-and-forward delay accumulates across the hops traveled by the message.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="possible-improvements">Possible improvements<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#possible-improvements" class="hash-link" aria-label="Direct link to Possible improvements" title="Direct link to Possible improvements"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="1-minimizing-transfer-time-for-large-messages">1. Minimizing transfer time for large messages<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#1-minimizing-transfer-time-for-large-messages" class="hash-link" aria-label="Direct link to 1. Minimizing transfer time for large messages" title="Direct link to 1. Minimizing transfer time for large messages"></a></h3>
<p>The impact of message size and achievable data rate on message transmit time <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal" style="margin-right:0.1132em">τ</span></span></span></span> is crucial
as this time accumulates due to the store-and-forward delay introduced at intermediate hops.</p>
<p>Some possible improvements to minimize overall message dissemination latency include:</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="a-message-fragmentation">a. Message fragmentation<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#a-message-fragmentation" class="hash-link" aria-label="Direct link to a. Message fragmentation" title="Direct link to a. Message fragmentation"></a></h4>
with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>S</mi><mo separator="true">,</mo><mi>R</mi></mrow><annotation encoding="application/x-tex">S, R</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8778em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.05764em">S</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em"></span><span class="mord mathnormal" style="margin-right:0.00773em">R</span></span></span></span> being the data size and data rate,
and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>h</mi><mo separator="true">,</mo><msub><mi>P</mi><mi>h</mi></msub></mrow><annotation encoding="application/x-tex">h, P_h</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em"></span><span class="mord mathnormal">h</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em">P</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">h</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em"><span></span></span></span></span></span></span></span></span></span> being the number of hops in the longest path and message propagation time through the longest path.</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="b-message-staggering">b. Message staggering<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#b-message-staggering" class="hash-link" aria-label="Direct link to b. Message staggering" title="Direct link to b. Message staggering"></a></h4>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="c-message-prioritization-for-slow-senders">c. Message prioritization for slow senders<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#c-message-prioritization-for-slow-senders" class="hash-link" aria-label="Direct link to c. Message prioritization for slow senders" title="Direct link to c. Message prioritization for slow senders"></a></h4>
leading to redundant transmissions [<a href="https://ethresear.ch/t/number-duplicate-messages-in-ethereums-gossipsub-network/19921" target="_blank" rel="noopener noreferrer">11</a>].
Implementing efficient strategies (only for slow senders) like lazy sending
and prioritizing locally published messages/IWANT replies over already queued messages
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="2-mitigating-transport-issues">2. Mitigating transport issues<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#2-mitigating-transport-issues" class="hash-link" aria-label="Direct link to 2. Mitigating transport issues" title="Direct link to 2. Mitigating transport issues"></a></h3>
that generate traffic after intervals long enough to trigger the resetting of the congestion window.</p>
<p>Implementing straightforward measures like transport-level ping-pong messages can effectively mitigate this problem [<a href="https://github.com/libp2p/specs/pull/558" target="_blank" rel="noopener noreferrer">13</a>].</p>
Usually, these peers also receive the same message from other sources during this time, wasting the publisher's bandwidth.</p>
<p>The same is the case with IWANT replies.</p>
<p>Maintaining a bigger mesh (with warm TCP connections) and relaying to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> peers can be a better alternative to this problem.</p>
<p>For every received packet, a peer makes roughly <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> transmissions to contribute its fair share to the spread of messages.
<p>Although the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span>-spread is attributed to quicker dissemination and resilience against non-conforming peers,
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="a-staggering-with-idontwant-messages">a. Staggering with IDONTWANT messages<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#a-staggering-with-idontwant-messages" class="hash-link" aria-label="Direct link to a. Staggering with IDONTWANT messages" title="Direct link to a. Staggering with IDONTWANT messages"></a></h4>
leading to an additional workload for early receivers [<a href="https://github.com/vacp2p/nim-libp2p/issues/1101" target="_blank" rel="noopener noreferrer">14</a>].</p>
<p>Potential solutions to mitigate these problems include:</p>
<ol>
<li>Defering IHAVE announcements for large messages.</li>
</ol>
<p>Deferring IHAVE announcements can indirectly prioritize message transmission to the mesh peers over IWANT replies.
<p>This requires <a href="https://research.logos.co/rlog/gsub-largemsg-improvements#b-imreceiving-message">prior knowledge of msgIDs</a> for the messages under reception.
to handle situations where a sender starts sending a message and never completes the transmission.</p>
<ol start="3">
<li>Not issuing IWANT for a message if at least <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi></mrow><annotation encoding="application/x-tex">K</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07153em">K</span></span></span></span> peers have transmitted IDONTWANT for the same message
(as this indicates that these peers will eventually relay this message).</li>
</ol>
<p>However, this approach can inadvertently empower a group of non-conforming mesh peers to send IDONTWANT for a message and never complete message transmission.
A delayed IWANT, along with negative peer scoring, can remedy this problem.</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="b-imreceiving-message">b. IMReceiving message<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#b-imreceiving-message" class="hash-link" aria-label="Direct link to b. IMReceiving message" title="Direct link to b. IMReceiving message"></a></h4>
the receiver can request to defer this transmission by sending a brief IMReceiving message.</p>
<p>An IDONTWANT from the receiver will indicate successful message reception. Otherwise, the waiting sender can initiate transmission after a specific wait interval.</p>
<p>However, waiting for IMReceiving after sending the preamble can delay the message transmission.
urging other mesh peers to defer sending the same message [<a href="https://forum.research.logos.co/t/large-message-handling-idontwant-imreceiving/281" target="_blank" rel="noopener noreferrer">15</a>,
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="c-idontwant-message-with-reduced-forwarding">c. IDONTWANT message with reduced forwarding<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#c-idontwant-message-with-reduced-forwarding" class="hash-link" aria-label="Direct link to c. IDONTWANT message with reduced forwarding" title="Direct link to c. IDONTWANT message with reduced forwarding"></a></h4>
As a result, a significantly smaller number of transmissions is sufficient for propagating the message to the entire network.</p>
<p>This approach conserves peer bandwidth by minimizing redundant transmissions
while ensuring GossipSub resilience at the cost of one RTT (for missing peers).</p>
<p>Interestingly, curtailing queuing delays can also help lower network-wide message dissemination latency (for huge messages).</p>
<p>However, finding an appropriate value for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi></mrow><annotation encoding="application/x-tex">K</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07153em">K</span></span></span></span> is crucial for optimal performance.
These early transmissions and randomized <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi></mrow><annotation encoding="application/x-tex">K</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07153em">K</span></span></span></span> set selection can help achieve an overall better peer score.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="4-message-prioritization">4. Message prioritization<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#4-message-prioritization" class="hash-link" aria-label="Direct link to 4. Message prioritization" title="Direct link to 4. Message prioritization"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="5-maximizing-benefits-from-iwant-messages">5. Maximizing benefits from IWANT messages<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#5-maximizing-benefits-from-iwant-messages" class="hash-link" aria-label="Direct link to 5. Maximizing benefits from IWANT messages" title="Direct link to 5. Maximizing benefits from IWANT messages"></a></h3>
<p>During heartbeat intervals, GossipSub nodes transmit IHAVE messages (carrying IDs of seen messages) to the peers not included in the full-message mesh.
This function is essential in protecting against network partitions and indirectly aids in safeguarding against Sybil and eclipse attacks.</p>
<p>However, it is essential to understand that high transmission times for large messages
require careful due diligence when using IWANT messages for reasons not limited to:</p>
<ol>
<li>
<p>A large message reception may take several hundred milliseconds to complete.
During this time, an IHAVE message announcing the same message ID will trigger an IWANT request.</p>
</li>
<li>
<p>A peer can send IWANT requests for the same message to multiple nodes,
leading to simultaneous transmissions of the same message.</p>
</li>
<li>
<p>Replying to (potentially many) IWANT requests can delay the transmission of the same message to mesh peers,
resulting in lower peer scores and slower message propagation.</p>
</li>
</ol>
<p>A few possible solutions to mitigate this problem may include:</p>
<ol>
<li>
<p>Issuing IHAVE announcements only after the message is delivered to many mesh peers.</p>
</li>
<li>
<p>Allocating a volume-based budget to service IWANT requests during each heartbeat interval.</p>
</li>
<li>
<p>Deferring IWANT requests for messages that are currently being received.</p>
</li>
<li>
<p>Deferring IWANT requests if at least <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi></mrow><annotation encoding="application/x-tex">K</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07153em">K</span></span></span></span> IDONTWANTs are received for the same message.</p>
</li>
<li>
<p>A large message transmission can yield high <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>C</mi><mrow><mi>w</mi><mi>n</mi><mi>d</mi></mrow></msub></mrow><annotation encoding="application/x-tex">C_{wnd}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07153em">C</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.02691em">w</span><span class="mord mathnormal mtight">n</span><span class="mord mathnormal mtight">d</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em"><span></span></span></span></span></span></span></span></span></span>; preferring such peers during mesh maintenance can be helpful.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="summary">Summary<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary"></a></h2>
Some of these have already been explored and discussed to some extent [<a href="https://hackmd.io/X1DoBHtYTtuGqYg0qK4zJw" target="_blank" rel="noopener noreferrer">5</a>,
<a href="https://forum.research.logos.co/t/large-message-handling-in-gossipsub-potential-improvements/375" target="_blank" rel="noopener noreferrer">Logos Research forum</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="references">References<a href="https://research.logos.co/rlog/gsub-largemsg-improvements#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References"></a></h2>
<p>[2] Message Propagation Times With Waku-RLN. Retrieved from <a href="https://docs.waku.org/research/research-and-studies/message-propagation/" target="_blank" rel="noopener noreferrer">https://docs.waku.org/research/research-and-studies/message-propagation/</a></p>
<p>[5] GossipSub for Big Messages. Retrieved from <a href="https://hackmd.io/X1DoBHtYTtuGqYg0qK4zJw" target="_blank" rel="noopener noreferrer">https://hackmd.io/X1DoBHtYTtuGqYg0qK4zJw</a></p>
<p>[9] Potential Gossip Improvement List for EIP4844. Retrieved from <a href="https://hackmd.io/@gRwfloEASH6NWWS_KJxFGQ/B18wdnNDh" target="_blank" rel="noopener noreferrer">https://hackmd.io/@gRwfloEASH6NWWS_KJxFGQ/B18wdnNDh</a></p>
<p>[11] Number of Duplicate Messages in Ethereum’s GossipSub Network. Retrieved from <a href="https://ethresear.ch/t/number-duplicate-messages-in-ethereums-gossipsub-network/19921" target="_blank" rel="noopener noreferrer">https://ethresear.ch/t/number-duplicate-messages-in-ethereums-gossipsub-network/19921</a></p>
<description><![CDATA[This post provides quick insights into the IDONTWANT message performance and highlights minor tweaks that can further contribute to performance gains.]]></description>
<content:encoded><![CDATA[<p>This post provides quick insights into the IDONTWANT message performance and highlights minor tweaks that can further contribute to performance gains.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="overview">Overview<a href="https://research.logos.co/rlog/gsub-idontwant-perf-eval#overview" class="hash-link" aria-label="Direct link to Overview" title="Direct link to Overview"></a></h2>
<p><a href="https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.2.md?plain=1#L52" target="_blank" rel="noopener noreferrer">IDONTWANT</a> messages are introduced to curtail redundant transmissions without compromising resilience.
Cutting down on duplicates can potentially render two significant advantages:</p>
<ol>
<li>
<p>Reducing bandwidth requirements</p>
</li>
<li>
<p>Reducing message dissemination time (latency)</p>
</li>
</ol>
<p>For IDONTWANTs to be effective, they must be received and processed by the sender before the sender starts relaying the respective message.</p>
<p><a href="https://ethresear.ch/t/number-duplicate-messages-in-ethereums-gossipsub-network/19921#arrival-time-of-duplicates-9" target="_blank" rel="noopener noreferrer">Duplicates investigation</a> reveals that
the average time difference between the first message arrival and the first duplicate arrival is higher than the average round trip time in Ethereum's GossipSub network.</p>
<p>This allows for timely IDONTWANT reception and canceling of many duplicate transmissions,
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="experiments">Experiments<a href="https://research.logos.co/rlog/gsub-idontwant-perf-eval#experiments" class="hash-link" aria-label="Direct link to Experiments" title="Direct link to Experiments"></a></h2>
<p>We conducted a series of experiments with different arrangements (changing heartbeat_interval and message size)
to precisely identify the impact of IDONTWANT messages on bandwidth utilization and message dissemination time.</p>
<p>The experiments are performed on nim-libp2p using the <a href="https://github.com/vacp2p/dst-gossipsub-test-node/pull/4" target="_blank" rel="noopener noreferrer">shadow simulator</a>.
The peer bandwidth and link latency are uniformly set between 50-150 Mbps and 40-130 milliseconds in five stages.</p>
<p>In all experiments, ten messages are transmitted to the network, i.e.,
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="findings">Findings<a href="https://research.logos.co/rlog/gsub-idontwant-perf-eval#findings" class="hash-link" aria-label="Direct link to Findings" title="Direct link to Findings"></a></h2>
<a href="https://forum.research.logos.co/t/large-message-handling-idontwant-imreceiving/281" target="_blank" rel="noopener noreferrer">IDONTWANTs only after it has finished downloading the message</a>.
<a href="https://forum.research.logos.co/t/libp2p-gossipsub-idontwant-message-performance-impact/374" target="_blank" rel="noopener noreferrer">Logos Research forum</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="references">References<a href="https://research.logos.co/rlog/gsub-idontwant-perf-eval#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References"></a></h2>
<description><![CDATA[In this post, we introduce a common technique used to convert interactive protocols to their noninteractive variant.]]></description>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="introduction">Introduction<a href="https://research.logos.co/rlog/vac101-fiat-shamir#introduction" class="hash-link" aria-label="Direct link to Introduction" title="Direct link to Introduction"></a></h2>
Specifically, the Prover and the Verifier exchange messages so that the Verifier can validate the Prover's claim.
However, this communication is not practical for many applications.
It is necessary that any party can verify the Prover's claim in decentralized systems.
It is impractical for the Prover to be in active communication with a large number of verifying parties.
Instead, it is desirable for the Prover to generate a proof on their own that can convince any party.
To achieve this, it is necessary for the Prover to generate the Verifier's messages in such a way
that the Prover cannot manipulate the Verifier's messages for her benefit.
The Fiat-Shamir heuristic <a href="https://dl.acm.org/doi/10.5555/36664.36676" target="_blank" rel="noopener noreferrer">1</a> is used for this purpose.
Even though much of our discussion will focus on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Σ</mi></mrow><annotation encoding="application/x-tex">\Sigma</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord">Σ</span></span></span></span>-protocols,
the Fiat-Shamir heuristic is not limited to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Σ</mi></mrow><annotation encoding="application/x-tex">\Sigma</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord">Σ</span></span></span></span>-protocols.
The Fiat-Shamir heuristic has been applied to zk-SNARKs, but the security in this setting has been the subject of discussion and research in recent years.
Block et al. <a href="https://eprint.iacr.org/2023/1071" target="_blank" rel="noopener noreferrer">2</a> provide the first formal analysis of Fiat-Shamir heuristic in zk-SNARKs.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="sigma-protocols">Sigma Protocols<a href="https://research.logos.co/rlog/vac101-fiat-shamir#sigma-protocols" class="hash-link" aria-label="Direct link to Sigma Protocols" title="Direct link to Sigma Protocols"></a></h2>
<p>A <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Σ</mi></mrow><annotation encoding="application/x-tex">\Sigma</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord">Σ</span></span></span></span>-protocol is a family of interactive protocols that consists of three publicly transmitted messages between the Prover and the Verifier.
In particular, the protocol has the following framework:</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-schnorr-protocol">The Schnorr Protocol<a href="https://research.logos.co/rlog/vac101-fiat-shamir#the-schnorr-protocol" class="hash-link" aria-label="Direct link to The Schnorr Protocol" title="Direct link to The Schnorr Protocol"></a></h3>
<p>The Schnorr protocol <a href="https://link.springer.com/chapter/10.1007/0-387-34805-0_22" target="_blank" rel="noopener noreferrer">3</a> is usually the first <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Σ</mi></mrow><annotation encoding="application/x-tex">\Sigma</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord">Σ</span></span></span></span>-protocol that one studies.
The Schnorr protocol provides a framework that enables the Prover to convince the Verifier that: for group elements <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">g</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi></mrow><annotation encoding="application/x-tex">X</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07847em">X</span></span></span></span>,
the Prover knows the power to raise <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">g</span></span></span></span> to obtain <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi></mrow><annotation encoding="application/x-tex">X</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07847em">X</span></span></span></span>.
while in additive notation it is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi><mo>+</mo><mi>g</mi><mo>=</mo><mn>2</mn><mi>g</mi></mrow><annotation encoding="application/x-tex">g + g = 2g</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7778em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">g</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">g</span><span class="mspace" style="margin-right:0.2778em"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em"></span></span><span class="base"><span class="strut" style="height:0.8389em;vertical-align:-0.1944em"></span><span class="mord">2</span><span class="mord mathnormal" style="margin-right:0.03588em">g</span></span></span></span>.
We assume that our group is of prime order <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal">p</span></span></span></span>, and is sufficiently large to satisfy the discrete logarithm assumption.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="chaum-pedersen-protocol">Chaum-Pedersen protocol<a href="https://research.logos.co/rlog/vac101-fiat-shamir#chaum-pedersen-protocol" class="hash-link" aria-label="Direct link to Chaum-Pedersen protocol" title="Direct link to Chaum-Pedersen protocol"></a></h3>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="hash-functions">Hash Functions<a href="https://research.logos.co/rlog/vac101-fiat-shamir#hash-functions" class="hash-link" aria-label="Direct link to Hash Functions" title="Direct link to Hash Functions"></a></h2>
<p>Cryptographic hash functions serve as the backbone to the Fiat-Shamir heuristic.
A hash function, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="sans-serif">H</mi><mi mathvariant="sans-serif">a</mi><mi mathvariant="sans-serif">s</mi><mi mathvariant="sans-serif">h</mi></mrow><annotation encoding="application/x-tex">\mathsf{Hash}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord"><span class="mord mathsf">Hash</span></span></span></span></span>, is a special function that takes in an arbitrary binary string and outputs a binary string of a predetermined fixed length.
<p>The security of cryptographic hash functions will rely on certain tasks being computationally infeasible.
A task is computationally infeasible provided that there is no deterministic algorithm that can conclude the task in polynomial-time.</p>
<p>A cryptographic hash function satisfies the following properties:</p>
<ul>
<li><strong>Succinct</strong>: The hash function should be easy to compute; the hash <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mi mathvariant="sans-serif">H</mi><mi mathvariant="sans-serif">a</mi><mi mathvariant="sans-serif">s</mi><mi mathvariant="sans-serif">h</mi></mrow><mo stretchy="false">(</mo><mi mathvariant="bold">b</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\mathsf{Hash}({\bf{b}})</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord"><span class="mord mathsf">Hash</span></span><span class="mopen">(</span><span class="mord"><span class="mord"><span class="mord"><span class="mord mathbf">b</span></span></span></span><span class="mclose">)</span></span></span></span> can be efficiently computed for any binary string <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">b</mi></mrow><annotation encoding="application/x-tex">{\bf{b}}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord"><span class="mord"><span class="mord"><span class="mord mathbf">b</span></span></span></span></span></span></span>.</li>
<li><strong>Preimage Resistance</strong>: It should be computationally infeasible to work backwards given the output of a hash function. Let <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">y</mi></mrow><annotation encoding="application/x-tex">{\bf{y}}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6389em;vertical-align:-0.1944em"></span><span class="mord"><span class="mord"><span class="mord"><span class="mord mathbf" style="margin-right:0.01597em">y</span></span></span></span></span></span></span> be a binary string of length <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span>.
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-fiat-shamir-heuristic">The Fiat-Shamir heuristic<a href="https://research.logos.co/rlog/vac101-fiat-shamir#the-fiat-shamir-heuristic" class="hash-link" aria-label="Direct link to The Fiat-Shamir heuristic" title="Direct link to The Fiat-Shamir heuristic"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="schnorr-protocol-with-the-strong-fiat-shamir">Schnorr Protocol with the strong Fiat-Shamir<a href="https://research.logos.co/rlog/vac101-fiat-shamir#schnorr-protocol-with-the-strong-fiat-shamir" class="hash-link" aria-label="Direct link to Schnorr Protocol with the strong Fiat-Shamir" title="Direct link to Schnorr Protocol with the strong Fiat-Shamir"></a></h3>
This choice of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">c</span></span></span></span> provides security since it should be computationally infeasible to find collisions for the outputs of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="sans-serif">H</mi><mi mathvariant="sans-serif">a</mi><mi mathvariant="sans-serif">s</mi><mi mathvariant="sans-serif">h</mi></mrow><annotation encoding="application/x-tex">\mathsf{Hash}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord"><span class="mord mathsf">Hash</span></span></span></span></span>.
<p>The elements that would be omitted in the hash by applying weak Fiat-Shamir heuristic are <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">g</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi></mrow><annotation encoding="application/x-tex">X</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07847em">X</span></span></span></span>.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="chaum-pedersen-protocol-with-the-strong-fiat-shamir">Chaum-Pedersen Protocol with the strong Fiat-Shamir<a href="https://research.logos.co/rlog/vac101-fiat-shamir#chaum-pedersen-protocol-with-the-strong-fiat-shamir" class="hash-link" aria-label="Direct link to Chaum-Pedersen Protocol with the strong Fiat-Shamir" title="Direct link to Chaum-Pedersen Protocol with the strong Fiat-Shamir"></a></h3>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="improper-use-of-the-fiat-shamir-heuristic">Improper use of the Fiat-Shamir heuristic<a href="https://research.logos.co/rlog/vac101-fiat-shamir#improper-use-of-the-fiat-shamir-heuristic" class="hash-link" aria-label="Direct link to Improper use of the Fiat-Shamir heuristic" title="Direct link to Improper use of the Fiat-Shamir heuristic"></a></h2>
However, a subtle but serious issue that can occur in the application of the Fiat-Shamir heuristic has been a point of discussion for the past few years.
The issue concerns what messages are included in the hash.
In particular, Bernhard et al. discuss the pitfalls of the weak Fiat-Shamir heuristic.
Recall that the strong Fiat-Shamir heuristic requires that the public parameters are included in the calculations of the Verifier's messages while the weak version does not.
In recent years, auditors from <a href="https://www.trailofbits.com/" target="_blank" rel="noopener noreferrer">Trail of Bits</a> and <a href="https://www.openzeppelin.com/" target="_blank" rel="noopener noreferrer">OpenZeppelin</a> have
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="schnorr-protocol-with-the-weak-fiat-shamir-heuristic">Schnorr protocol with the weak Fiat-Shamir heuristic<a href="https://research.logos.co/rlog/vac101-fiat-shamir#schnorr-protocol-with-the-weak-fiat-shamir-heuristic" class="hash-link" aria-label="Direct link to Schnorr protocol with the weak Fiat-Shamir heuristic" title="Direct link to Schnorr protocol with the weak Fiat-Shamir heuristic"></a></h3>
the first where we only include the Prover's claim <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi></mrow><annotation encoding="application/x-tex">X</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07847em">X</span></span></span></span> but not the public parameter <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">g</span></span></span></span>, and
the second where we include the public parameter <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">g</span></span></span></span> but not the Prover's claim <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi></mrow><annotation encoding="application/x-tex">X</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07847em">X</span></span></span></span>.</p>
<p>Since we omit the generator <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi><mo>∈</mo><mi mathvariant="double-struck">G</mi></mrow><annotation encoding="application/x-tex">g \in \mathbb{G}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7335em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">g</span><span class="mspace" style="margin-right:0.2778em"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em"></span></span><span class="base"><span class="strut" style="height:0.6889em"></span><span class="mord mathbb">G</span></span></span></span> from the computation for the message <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">c</span></span></span></span> in our first approach,
Since, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">g</span></span></span></span> is not fixed as it was not included in the computation of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">c</span></span></span></span>.
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="chaum-pedersen-protocol-with-the-fiat-shamir-heuristic">Chaum-Pedersen protocol with the Fiat-Shamir heuristic<a href="https://research.logos.co/rlog/vac101-fiat-shamir#chaum-pedersen-protocol-with-the-fiat-shamir-heuristic" class="hash-link" aria-label="Direct link to Chaum-Pedersen protocol with the Fiat-Shamir heuristic" title="Direct link to Chaum-Pedersen protocol with the Fiat-Shamir heuristic"></a></h3>
As such, a malicious Prover can generate values for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mo separator="true">,</mo><mi>V</mi><mo separator="true">,</mo><mi>W</mi></mrow><annotation encoding="application/x-tex">U,V,W</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8778em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.10903em">U</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em"></span><span class="mord mathnormal" style="margin-right:0.22222em">V</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em"></span><span class="mord mathnormal" style="margin-right:0.13889em">W</span></span></span></span>, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">g</span></span></span></span> that satisfy the Verifier's identity checks.
In the case of a malicious Prover, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.13889em">T</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>S</mi></mrow><annotation encoding="application/x-tex">S</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.05764em">S</span></span></span></span> are randomly group elements instead of being computed using a value <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi></mrow><annotation encoding="application/x-tex">t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6151em"></span><span class="mord mathnormal">t</span></span></span></span> that the Prover selected.
This means a malicious Prover must randomly select the value <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal" style="margin-right:0.04398em">z</span></span></span></span> as well.</p>
<p>Given the values that have been fixed so far, each of the Verifier's identities consists of two unknowns.
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="conclusion">Conclusion<a href="https://research.logos.co/rlog/vac101-fiat-shamir#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="references">References<a href="https://research.logos.co/rlog/vac101-fiat-shamir#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References"></a></h3>
<li><a href="https://dl.acm.org/doi/10.5555/36664.36676" target="_blank" rel="noopener noreferrer">How to Prove Yourself: Practical Solutions to Identification and Signature Problems</a></li>
</ol>
</li>
<li>
<ol start="2">
<li><a href="https://eprint.iacr.org/2023/1071" target="_blank" rel="noopener noreferrer">Fiat-Shamir Security of FRI and Related SNARKs</a></li>
</ol>
</li>
<li>
<ol start="3">
<li><a href="https://link.springer.com/chapter/10.1007/0-387-34805-0_22" target="_blank" rel="noopener noreferrer">Efficient Identification and Signatures for Smart Cards</a></li>
</ol>
</li>
<li>
<ol start="4">
<li><a href="https://link.springer.com/content/pdf/10.1007/3-540-48071-4_7.pdf" target="_blank" rel="noopener noreferrer">Wallet Databases with Observers</a></li>
</ol>
</li>
<li>
<ol start="5">
<li><a href="https://www.cs.princeton.edu/~appel/papers/verif-sha.pdf" target="_blank" rel="noopener noreferrer">Verification of a Cryptographic Primitive: SHA-256</a></li>
<li><a href="https://eprint.iacr.org/2019/458" target="_blank" rel="noopener noreferrer">Poseidon: A New Hash Function for Zero-Knowledge Proof Systems</a></li>
</ol>
</li>
<li>
<ol start="8">
<li><a href="https://eprint.iacr.org/2016/771.pdf" target="_blank" rel="noopener noreferrer">How not to Prove Yourself: Pitfalls of the Fiat-Shamir Heuristic and Applications to Helios</a></li>
</ol>
</li>
<li>
<ol start="9">
<li><a href="https://blog.trailofbits.com/2022/04/13/part-1-coordinated-disclosure-of-vulnerabilities-affecting-girault-bulletproofs-and-plonk/" target="_blank" rel="noopener noreferrer">Frozen Heart - Part 1</a></li>
</ol>
</li>
<li>
<ol start="10">
<li><a href="https://blog.trailofbits.com/2022/04/14/the-frozen-heart-vulnerability-in-giraults-proof-of-knowledge/" target="_blank" rel="noopener noreferrer">Frozen Heart - Part 2</a></li>
</ol>
</li>
<li>
<ol start="11">
<li><a href="https://blog.trailofbits.com/2022/04/15/the-frozen-heart-vulnerability-in-bulletproofs/" target="_blank" rel="noopener noreferrer">Frozen Heart - Part 3</a></li>
</ol>
</li>
<li>
<ol start="12">
<li><a href="https://blog.trailofbits.com/2022/04/18/the-frozen-heart-vulnerability-in-plonk/" target="_blank" rel="noopener noreferrer">Frozen Heart - Part 4</a></li>
</ol>
</li>
<li>
<ol start="13">
<li><a href="https://blog.openzeppelin.com/the-last-challenge-attack" target="_blank" rel="noopener noreferrer">The Last Challenge Attack Blog</a></li>
</ol>
</li>
<li>
<ol start="14">
<li><a href="https://eprint.iacr.org/2023/691" target="_blank" rel="noopener noreferrer">Weak Fiat-Shamir Attacks on Modern Proof Systems</a></li>
</ol>
</li>
<li>
<ol start="15">
<li><a href="https://eprint.iacr.org/2024/398" target="_blank" rel="noopener noreferrer">The Last Challenge Attack</a></li>
<p>Following our initial exploration of zkVMs in our previous blog post [<a href="https://research.logos.co/rlog/zkVM-explorations/" target="_blank" rel="noopener noreferrer">1</a>],
we have conducted a series of tests to identify the most suitable zkVM for the Nescience architecture [<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture" target="_blank" rel="noopener noreferrer">2</a>].
This post outlines the testing process, results, and conclusions. Additionally, the full test suite and scripts can be found
on our GitHub page [<a href="https://github.com/vacp2p/nescience-zkvm-testing" target="_blank" rel="noopener noreferrer">3</a>], allowing others to replicate the results or explore the candidates further.
Please note that we chose not to use hardware acceleration in our benchmarks, as our project is aimed at a broad audience.
<p>When narrowing down the zkVMs, we focused on key factors:</p>
<ul>
<li>True zero-knowledge functionality: The zkVMs had to demonstrate or be close to demonstrating the ability to generate and verify zero-knowledge proofs.</li>
<li>Performance baselines: We sought zkVMs with solid benchmarks in performance, particularly in speed and efficiency.</li>
<li>Specific functionalities: For Nescience, functionalities like lookup tables, precompiles, and recursive capabilities are critical.</li>
</ul>
<p>We need a zkVM that supports these to enable robust project development.</p>
<h1>Preliminary information on the candidates</h1>
<ol>
<li>
<p>SP1 is a performant, open-source zkVM that verifies the execution of arbitrary Rust (or any LLVM-compiled language) programs.
Nexus also supports precompiles and targeted compilation, and besides Rust, it offers C++ support.</p>
</li>
<li>
<p>ZkMIPS is a general verifiable computing infrastructure based on Plonky2 and the MIPS microarchitecture, aiming to empower Ethereum
as a global settlement layer. It can run arbitrary Rust code as well. Notably, zkMIPS is the only zkVM in this list that utilizes the MIPS opcode set.</p>
</li>
<li>
<p>ZkWASM adheres to and supports the unmodified standard WASM bytecode specification. Since Rust code can be compiled to WASM bytecode,
one could theoretically run any Rust code on a zkWASM machine, providing flexibility and broad language support.</p>
</li>
<li>
<p>Valida is a STARK-based virtual machine aiming to improve upon the state of the art in several categories:</p>
<ul>
<li>Code reuse: The VM has a RISC-inspired instruction set, simplifying the targeting of conventional programming languages.
division, modulus division, and square root calculations. We designed the test around heptagonal numbers, which required zkVMs to process
multiple arithmetic operations simultaneously. By using this method, we could measure efficiency and speed in handling complex mathematical calculations –
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="1-sp1">1. SP1<a href="https://research.logos.co/rlog/zkVM-testing#1-sp1" class="hash-link" aria-label="Direct link to 1. SP1" title="Direct link to 1. SP1"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="2-risc0">2. RISC0<a href="https://research.logos.co/rlog/zkVM-testing#2-risc0" class="hash-link" aria-label="Direct link to 2. RISC0" title="Direct link to 2. RISC0"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="3-nexus">3. Nexus<a href="https://research.logos.co/rlog/zkVM-testing#3-nexus" class="hash-link" aria-label="Direct link to 3. Nexus" title="Direct link to 3. Nexus"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="4-zkmips">4. ZkMIPS<a href="https://research.logos.co/rlog/zkVM-testing#4-zkmips" class="hash-link" aria-label="Direct link to 4. ZkMIPS" title="Direct link to 4. ZkMIPS"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="5-zkwasm">5. ZkWASM<a href="https://research.logos.co/rlog/zkVM-testing#5-zkwasm" class="hash-link" aria-label="Direct link to 5. ZkWASM" title="Direct link to 5. ZkWASM"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="6-valida">6. Valida<a href="https://research.logos.co/rlog/zkVM-testing#6-valida" class="hash-link" aria-label="Direct link to 6. Valida" title="Direct link to 6. Valida"></a></h3>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="summary-table">Summary table<a href="https://research.logos.co/rlog/zkVM-testing#summary-table" class="hash-link" aria-label="Direct link to Summary table" title="Direct link to Summary table"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="stage-1">Stage 1<a href="https://research.logos.co/rlog/zkVM-testing#stage-1" class="hash-link" aria-label="Direct link to Stage 1" title="Direct link to Stage 1"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="stage-2">Stage 2<a href="https://research.logos.co/rlog/zkVM-testing#stage-2" class="hash-link" aria-label="Direct link to Stage 2" title="Direct link to Stage 2"></a></h3>
the memory issues were too significant to ignore, making it unsuitable.</p>
<p>Finally, zkWASM exhibited the poorest results, struggling both in proof size and generation time. Despite its potential for WASM bytecode support,
the excessive RAM consumption (up to 57 GB in the memory test) rendered it impractical for Nescience’s use case.</p>
<p>In conclusion, RISC0 is the best fit for Nescience at this stage, but Valida remains a future candidate as its development progresses.</p>
<p>In the future, we plan to compare RISC0 and SP1 with CUDA acceleration. Ideally, by that time, more zkVMs will include similar acceleration capabilities,
enabling a fairer and more comprehensive comparison across platforms.</p>
<p>We’d love to hear your thoughts on our zkVM testing process and results! Do you agree with our conclusions, or do you think we missed a promising zkVM?
We’re always open to feedback, insights, and suggestions from the community.</p>
<p>Join the discussion and share your perspectives on
<a href="https://forum.research.logos.co/t/zkvm-testing-report-evaluating-zero-knowledge-virtual-machines-for-nescience/" target="_blank" rel="noopener noreferrer">our forum</a> or try out the
<p>[3] Our GitHub Page for zkVM Testing. Retrieved from <a href="https://github.com/vacp2p/nescience-zkvm-testing" target="_blank" rel="noopener noreferrer">https://github.com/vacp2p/nescience-zkvm-testing</a></p>
<p>[4] Introducing SP1: A performant, 100% open-source, contributor-friendly zkVM. Retrieved from <a href="https://blog.succinct.xyz/introducing-sp1/" target="_blank" rel="noopener noreferrer">https://blog.succinct.xyz/introducing-sp1/</a></p>
<p>[5] The first general purpose zkVM. Retrieved from <a href="https://www.risczero.com/zkvm" target="_blank" rel="noopener noreferrer">https://www.risczero.com/zkvm</a></p>
<p>[6] The Nexus 2.0 zkVM. Retrieved from <a href="https://docs.nexus.xyz/" target="_blank" rel="noopener noreferrer">https://docs.nexus.xyz/</a></p>
<p>[7] ZKM Architecture. Retrieved from <a href="https://docs.zkm.io/zkm-architecture" target="_blank" rel="noopener noreferrer">https://docs.zkm.io/zkm-architecture</a></p>
<p>[8] ZK-WASM. Retrieved from <a href="https://delphinuslab.com/zk-wasm/" target="_blank" rel="noopener noreferrer">https://delphinuslab.com/zk-wasm/</a></p>
<p>[9] Valida zkVM Design. Retrieved from <a href="https://delendum.xyz/writings/2023-05-10-zkvm-design.html" target="_blank" rel="noopener noreferrer">https://delendum.xyz/writings/2023-05-10-zkvm-design.html</a></p>]]></content:encoded>
However, as the term "zkVM" becomes more widely adopted, it is critical to distinguish between projects that truly satisfy the stringent requirements of a zkVM and those that do not.</p>
<h1>What is a zkVM?</h1>
<p>A zkVM is a virtual machine that combines the principles of cryptographic proof generation and privacy preservation with the computational model
of traditional virtual machines. Essentially, a zkVM enables the execution of arbitrary programs while generating cryptographic proofs—specifically, zero-knowledge proofs (ZKPs)—that
can verify the correctness of these computations without revealing any sensitive information. This ensures that computations can be trusted while protecting the privacy of the data involved.
<li>Proof generation: The ability to produce ZKPs that verify the correct execution of programs. There are several types of cryptographic techniques used in zkVMs to
generate these proofs, such as zk-SNARKs, zk-STARKs, and recursive proofs. A zkVM’s ability to generate these proofs determines how effectively it can ensure the integrity of computations
<li>Privacy preservation: The system must maintain privacy, ensuring that only the proof is revealed, not the underlying computation or data. Privacy-preserving zkVMs allow users to maintain
confidentiality without compromising the security or verifiability of their operations. However, not all zkVMs achieve the same level of privacy. Some may focus more on proof generation
and scalability while deprioritizing privacy features, which can limit their use in certain privacy-sensitive applications.</li>
<li>Scalability and performance: zkVMs should offer scalable and efficient computation, leveraging advanced cryptographic techniques like zk-SNARKs, zk-STARKs, or recursive proofs.
A zkVM's performance must also be measured in terms of latency (time to generate and verify a proof) and throughput (number of computations processed within a certain time frame).</li>
<li>Verifiable computation: The zkVM should be able to prove the execution of arbitrary programs in a secure and verifiable manner. Verifiable computation ensures that zkVMs can be deployed
across a wide range of applications, from DeFi to private data-sharing platforms and more.</li>
</ul>
<h1>Why zkVMs matter</h1>
<p>The rise of zkVMs is a crucial development for the future of blockchain and decentralized technologies. As more systems require the ability to scale while maintaining privacy and trust,
zkVMs provide a powerful solution. They offer the potential to reshape the way decentralized applications (dapps) handle sensitive information, enabling them to be both efficient and private.</p>
<p>It is essential to distinguish between projects that fully realize the potential of zkVMs and those that do not. In the remainder of this post, we evaluate several zkVM projects, analyzing
whether they satisfy the criteria for being classified as zkVMs based on our research.</p>
<h1>Our methodology</h1>
<p>We analyzed each project’s documentation, source code, and available benchmarks to determine whether they meet the definition of a zkVM.
Our criteria focus on the key capabilities of zkVMs—proof generation, privacy, scalability, and integration with existing systems.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="1-sp1">1. [SP1]<a href="https://research.logos.co/rlog/zkVM-explorations#1-sp1" class="hash-link" aria-label="Direct link to 1. [SP1]" title="Direct link to 1. [SP1]"></a></h2>
<li>Overview: SP1 [<a href="https://blog.succinct.xyz/introducing-sp1/" target="_blank" rel="noopener noreferrer">1</a>] is a developer-friendly zkVM designed to enable ZKP execution for LLVM-based languages like C, C++, Rust, and others. It supports a RISC-V-like instruction set architecture (ISA),
which makes it compatible with various programming languages compiled through LLVM.</li>
<li>Main focus: The main focus of SP1 is scalability, open-source contributions, and accessibility for developers. It prioritizes performance over privacy,
making it a good fit for environments where privacy isn't the primary concern.</li>
<li>Privacy: Not explicitly mentioned, making it less suitable for privacy-preserving applications.</li>
<li>Performance: SP1 has demonstrated up to 5.4x better performance than similar zkVMs like RISC0 for specific computations such as Fibonacci sequence generation.</li>
<li>Integration: SP1 is highly adaptable for rollups, light client verifiers, oracles, and even web2 projects like verifying the originality of images.</li>
<li>Conclusion: Yes, SP1 is a zkVM, but it does not prioritize zero-knowledge privacy, focusing more on scalability and performance.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="2-nexus">2. [Nexus]<a href="https://research.logos.co/rlog/zkVM-explorations#2-nexus" class="hash-link" aria-label="Direct link to 2. [Nexus]" title="Direct link to 2. [Nexus]"></a></h2>
<li>Overview: Nexus [<a href="https://docs.nexus.xyz/" target="_blank" rel="noopener noreferrer">2</a>] is a highly modular zkVM designed to process up to a trillion CPU cycles per second. It relies on RISC-V instructions for computation, making it extensible and scalable.
However, it currently lacks full ZKP capabilities due to its use of Spartan proofs.</li>
<li>Main focus: Nexus focuses on high performance and scalability, aiming to create an efficient execution environment for computationally intensive tasks.</li>
<li>Privacy: Although zero-knowledge privacy isn't the primary feature of Nexus, the project hints at potential privacy enhancements in the future.</li>
<li>Performance: Nexus has a high theoretical throughput, but it has yet to demonstrate benchmarks on zero-knowledge privacy.</li>
<li>Integration: Nexus is a good fit for high-performance environments that do not necessarily require full privacy.</li>
<li>Conclusion: Yes, Nexus qualifies as a zkVM in terms of scalability and proof generation, but it does not yet achieve full zero-knowledge privacy.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="3-risc0">3. [RISC0]<a href="https://research.logos.co/rlog/zkVM-explorations#3-risc0" class="hash-link" aria-label="Direct link to 3. [RISC0]" title="Direct link to 3. [RISC0]"></a></h2>
<li>Overview: Risc0 [<a href="https://www.risczero.com/zkvm" target="_blank" rel="noopener noreferrer">3</a>] is a general-purpose zkVM with strong developer support. It allows for the execution of Rust and C code on a RISC-V virtual machine
and generates zk-SNARK and zk-STARK proofs for these computations.</li>
<li>Main focus: Risc0 is focused on ease of use for developers by abstracting away the complexities of circuit generation, making it accessible for a wide range of use cases.</li>
<li>Privacy: Full zero-knowledge privacy is supported via zk-SNARK and zk-STARK proofs, with Groth16 used for constant-size proof generation.</li>
<li>Performance: Risc0 offers strong benchmarks across different hardware setups, making it one of the most versatile zkVMs in terms of performance and scalability.</li>
<li>Integration: Risc0 integrates with several ecosystems, including Ethereum, and supports verifiable execution of Rust-based programs.</li>
<li>Conclusion: Yes, Risc0 qualifies as a zkVM, offering a balance of developer usability, scalability, and privacy.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="4-powdr">4. [Powdr]<a href="https://research.logos.co/rlog/zkVM-explorations#4-powdr" class="hash-link" aria-label="Direct link to 4. [Powdr]" title="Direct link to 4. [Powdr]"></a></h2>
<li>Overview: Powdr [<a href="https://docs.powdr.org/" target="_blank" rel="noopener noreferrer">4</a>] is a toolkit for creating custom zkVMs. It allows developers to select from various front-end and back-end components to create zkVMs tailored to specific needs.</li>
<li>Main focus: Powdr is focused on providing a modular architecture for zkVM creation. It enables flexibility by allowing the combination of different ZK-proof backends like Halo2 or Valida.</li>
<li>Privacy: Powdr itself does not generate ZKPs, but it facilitates the creation of zkVMs that do.</li>
<li>Performance: The performance depends on the components chosen by the developer, as Powdr itself is more of a framework.</li>
<li>Integration: Powdr is highly customizable and can integrate with existing zkVM frameworks to extend their capabilities.</li>
<li>Conclusion: No, Powdr is not a zkVM itself, but it is a powerful tool for building customized zkVMs with different privacy and performance needs.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="5-zkmips">5. [ZkMIPS]<a href="https://research.logos.co/rlog/zkVM-explorations#5-zkmips" class="hash-link" aria-label="Direct link to 5. [ZkMIPS]" title="Direct link to 5. [ZkMIPS]"></a></h2>
<li>Overview: ZkMIPS [<a href="https://docs.zkm.io/zkm-architecture" target="_blank" rel="noopener noreferrer">5</a>] uses zk-STARKs to ensure privacy during computation, ensuring that private inputs are preserved while still proving correctness.</li>
<li>Performance: ZkMIPS is built for scalability, though explicit benchmarks are not widely published.</li>
<li>Integration: ZkMIPS can be integrated into systems that rely on MIPS architecture, making it versatile for legacy codebases that require privacy.</li>
<li>Conclusion: Yes, zkMIPS is a zkVM focused on scalability and privacy for MIPS-based architectures.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="6-valida">6. [Valida]<a href="https://research.logos.co/rlog/zkVM-explorations#6-valida" class="hash-link" aria-label="Direct link to 6. [Valida]" title="Direct link to 6. [Valida]"></a></h2>
<li>Overview: Valida [<a href="https://delendum.xyz/writings/2023-05-10-zkvm-design.html" target="_blank" rel="noopener noreferrer">6</a>] is a performance-oriented zkVM that generates proofs for programs using a custom ISA designed to optimize zkVM implementation.
It uses Plonky3 for its proof system.</li>
<li>Main focus: Valida is centered around optimizing prover performance and extensibility, making it a valuable tool for generating proofs efficiently.</li>
<li>Privacy: While Valida is focused on performance, it does not prioritize zero-knowledge privacy as much as other zkVMs.</li>
<li>Performance: Valida has benchmarks indicating its performance advantages in proving computations quickly, particularly through parallel processing.</li>
<li>Integration: Valida is specialized and may not integrate as seamlessly into general-purpose systems, as it is optimized for performance over broad applicability.</li>
<li>Conclusion: Yes, Valida qualifies as a zkVM based on proof generation, but its lack of focus on privacy makes it less suitable for privacy-first use cases.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="7-jolt">7. [Jolt]<a href="https://research.logos.co/rlog/zkVM-explorations#7-jolt" class="hash-link" aria-label="Direct link to 7. [Jolt]" title="Direct link to 7. [Jolt]"></a></h2>
<li>Overview: Jolt [<a href="https://a16zcrypto.com/posts/article/building-jolt/" target="_blank" rel="noopener noreferrer">7</a>] is a zkVM built to optimize prover performance using a modified Hyrax polynomial commitment system. It relies on RISC-V instructions for computation
but falls short of full zero-knowledge capabilities.</li>
<li>Main focus: Jolt's main goal is to optimize the speed of proving program execution, making it suitable for high-performance applications where privacy isn't the primary concern.</li>
<li>Privacy: Jolt does not fully achieve zero-knowledge privacy due to the choice of polynomial commitment schemes.</li>
<li>Performance: Jolt offers strong performance, with benchmarks highlighting its ability to process proofs efficiently.</li>
<li>Integration: Jolt can be integrated with systems that prioritize speed over privacy, particularly where rapid proof generation is essential.</li>
<li>Conclusion: Yes, Jolt qualifies as a zkVM based on proof generation, though it does not provide full zero-knowledge privacy.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="8-zkwasm">8. [ZkWASM]<a href="https://research.logos.co/rlog/zkVM-explorations#8-zkwasm" class="hash-link" aria-label="Direct link to 8. [ZkWASM]" title="Direct link to 8. [ZkWASM]"></a></h2>
<li>Overview: ZkWASM [<a href="https://delphinuslab.com/zk-wasm/" target="_blank" rel="noopener noreferrer">8</a>] is a zkVM designed to execute WebAssembly (WASM) code in a privacy-preserving and scalable manner. It uses zk-SNARKs to prove the correctness of WASM
program execution while ensuring privacy.</li>
<li>Main focus: ZkWASM focuses on scalability and privacy for WebAssembly, making it ideal for dapps that require verifiable computation without compromising privacy.</li>
<li>Privacy: Full zero-knowledge privacy is provided through zk-SNARKs, ensuring that the execution of WASM programs remains confidential.</li>
<li>Performance: ZkWASM is optimized for running WASM programs efficiently, with offchain computation and onchain verification to enhance performance.</li>
<li>Integration: ZkWASM is ideal for dapps, particularly those that use WebAssembly and require verifiable execution.</li>
<li>Conclusion: Yes, zkWASM qualifies as a zkVM, providing strong privacy, scalability, and verifiable execution for WebAssembly code.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="9-aleo">9. [Aleo]<a href="https://research.logos.co/rlog/zkVM-explorations#9-aleo" class="hash-link" aria-label="Direct link to 9. [Aleo]" title="Direct link to 9. [Aleo]"></a></h2>
<li>Overview: Aleo's [<a href="https://aleo.org/blog/" target="_blank" rel="noopener noreferrer">9</a>] snarkVM converts code into Aleo instructions, which are then compiled into bytecode executable on its zkVM. Aleo emphasizes building private, scalable dapps.</li>
<li>Main focus: Aleo prioritizes privacy and scalability for dapps, providing a robust framework for developers building private dapps.</li>
<li>Privacy: Aleo offers full privacy through zk-SNARK proofs, making it suitable for building fully private applications.</li>
<li>Performance: Aleo focuses on scalability through efficient proof systems, though detailed performance benchmarks are not widely available.</li>
<li>Integration: Aleo is built for privacy-first dapps and integrates with other zkVM-based systems.</li>
<li>Conclusion: Yes, Aleo qualifies as a zkVM, offering a comprehensive solution for private and scalable dapps.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="10-ola">10. [Ola]<a href="https://research.logos.co/rlog/zkVM-explorations#10-ola" class="hash-link" aria-label="Direct link to 10. [Ola]" title="Direct link to 10. [Ola]"></a></h2>
<li>Overview: Ola [<a href="https://github.com/Sin7Y/olavm-whitepaper-v2/tree/master" target="_blank" rel="noopener noreferrer">10</a>] is a ZK-friendly, high-performance layer-2 (L2) rollup platform that is still under development. It is designed to execute computations offchain while generating
validity proofs for these computations, ensuring that they are correctly executed without compromising security.</li>
<li>Privacy: Ola does not specifically prioritize privacy in the same way that zkVMs do. While it leverages ZKPs for scalability, its focus is on proving the correctness of
transactions and computations rather than ensuring that the data remains private.</li>
<li>Performance: Ola is designed to achieve high performance, particularly in terms of transaction throughput.</li>
<li>Integration: Ola is designed to be interoperable with various layer-1 blockchains. The platform supports a hybrid ZK-rollup architecture and is expected to include bridges for cross-chain
interoperability, enabling assets and data to move seamlessly between the layer-1 blockchain and the Ola rollup.</li>
<li>Conclusion: No, Ola is not a zkVM. While it leverages ZKPs (in the form of ZK-rollups) to ensure the validity of offchain computations, its primary focus is on scalability and performance
rather than privacy or verifiable execution of arbitrary programs. Ola is more accurately described as a ZK-rollup platform aimed at improving transaction throughput and reducing transaction costs on
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="11-miden">11. [Miden]<a href="https://research.logos.co/rlog/zkVM-explorations#11-miden" class="hash-link" aria-label="Direct link to 11. [Miden]" title="Direct link to 11. [Miden]"></a></h2>
<li>Overview: Miden zkVM [<a href="https://0xpolygonmiden.github.io/miden-vm/intro/main.html" target="_blank" rel="noopener noreferrer">11</a>] is a zk-STARK-based virtual machine that converts code into Miden VM instructions and proves the execution of these instructions with zero-knowledge privacy.</li>
<li>Main focus: Miden focuses on scalability and privacy for ZK-rollups, offering efficient proof generation for dapps.</li>
<li>Privacy: Miden ensures privacy for transactions and programs via zk-STARK proofs, making it suitable for private dapps.</li>
<li>Performance: Miden is optimized for scalability, with benchmarks showing its ability to handle up to 1,000 transactions per second (TPS).</li>
<li>Integration: Miden integrates well with ZK-rollup solutions, making it ideal for L2 scaling solutions on blockchains like Ethereum.</li>
<li>Conclusion: Yes, Miden qualifies as a zkVM, providing strong privacy and scalability for dapps and ZK-rollups.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="12-zkos">12. [ZkOS]<a href="https://research.logos.co/rlog/zkVM-explorations#12-zkos" class="hash-link" aria-label="Direct link to 12. [ZkOS]" title="Direct link to 12. [ZkOS]"></a></h2>
<li>Overview: ZkOS [<a href="https://osblog.stephenmarz.com/index.html" target="_blank" rel="noopener noreferrer">12</a>] is a verifiable operating system focused on running zkApps in a decentralized manner. It is built on the RISC-V architecture and aims to create
a world computer where all untrusted executions can be verified.</li>
<li>Main focus: ZkOS is primarily designed to offer a proof-of-concept operating system where all executions can be verified in a trustless manner.
However, its focus is more on the infrastructure for verifiable applications rather than being a traditional zkVM.</li>
<li>Privacy: ZkOS does not focus on privacy guarantees such as those found in zkVMs that generate ZKPs.</li>
<li>Performance: ZkOS focuses on the efficient execution of dapps, but performance benchmarks specific to ZKP generation are not provided.</li>
<li>Integration: ZkOS supports the execution of zkApps, but it is more of a verifiable operating system rather than a zkVM, making it distinct in its functionality.</li>
<li>Conclusion: No, zkOS is not a zkVM. It is a verifiable operating system focused on the infrastructure to support zkApps but does not directly generate ZKPs or focus on privacy preservation.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="13-triton">13. [Triton]<a href="https://research.logos.co/rlog/zkVM-explorations#13-triton" class="hash-link" aria-label="Direct link to 13. [Triton]" title="Direct link to 13. [Triton]"></a></h2>
<li>Overview: Triton [<a href="https://triton-vm.org/spec/" target="_blank" rel="noopener noreferrer">13</a>] is a domain-specific language (DSL) and compiler designed primarily for high-performance GPU kernels, particularly those used in deep learning applications.</li>
<li>Main focus: The primary goal of Triton is to optimize computation for machine learning and GPU workloads. It is focused on enhancing performance and efficiency in processing data
rather than on ZKPs or verifiable computation.</li>
<li>Privacy: Triton does not provide ZKPs or privacy features typically associated with zkVMs. Its focus is on high-performance computation rather than cryptographic verifiability.</li>
<li>Performance: Triton is highly optimized for GPU execution, offering significant improvements in performance for computationally intensive tasks such as those found in deep learning.</li>
<li>Integration: Triton is integrated with GPU-based computation environments and is highly specialized for optimizing low-level operations on hardware rather
than being a general-purpose virtual machine.</li>
<li>Conclusion: No, Triton is not a zkVM. It is a specialized tool for optimizing GPU workloads, focusing on performance rather than privacy or ZKPs.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="14-cairo">14. [Cairo]<a href="https://research.logos.co/rlog/zkVM-explorations#14-cairo" class="hash-link" aria-label="Direct link to 14. [Cairo]" title="Direct link to 14. [Cairo]"></a></h2>
<li>Overview: Cairo zkVM [<a href="https://github.com/lambdaclass/cairo-vm/blob/main/docs/python_vm/README.md" target="_blank" rel="noopener noreferrer">14</a>] uses a custom language that compiles to an optimized STARK-based proof system, ensuring verifiable computation. It is primarily used in systems like Starknet.</li>
<li>Main focus: Cairo focuses on scalability and performance, using zk-STARK proofs to ensure the verifiable and secure execution of programs.</li>
<li>Privacy: Cairo provides privacy through zk-STARKs, but it focuses more on scalability and performance than privacy-first use cases.</li>
<li>Performance: Cairo is highly optimized for performance, making it well-suited for scalable applications on Starknet.</li>
<li>Integration: Cairo integrates deeply with systems like Starknet, supporting verifiable computation in a highly scalable and efficient manner.</li>
<li>Conclusion: Yes, Cairo qualifies as a zkVM, focusing on performance and verifiable execution while being ZK-friendly.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="15-snarkos">15. [SnarkOS]<a href="https://research.logos.co/rlog/zkVM-explorations#15-snarkos" class="hash-link" aria-label="Direct link to 15. [SnarkOS]" title="Direct link to 15. [SnarkOS]"></a></h2>
<li>Overview: SnarkOS [<a href="https://aleo.org/post/aleo-completes-security-audits-of-snarkos-and-snarkvm/" target="_blank" rel="noopener noreferrer">15</a>] is a decentralized operating system designed to power Aleo's network, enabling secure and private dapps.
It manages transactions and consensus, making it a critical infrastructure component for Aleo's zkVM-based ecosystem.</li>
<li>Main focus: SnarkOS primarily focuses on securing Aleo's network through consensus mechanisms and privacy-preserving transactions rather than acting as a
zkVM that directly proves program execution.</li>
<li>Privacy: SnarkOS supports zero-knowledge privacy through its integration with Aleo's zkVM, but the operating system itself does not generate ZKPs for arbitrary computations.</li>
<li>Performance: SnarkOS is optimized for managing dapps on the Aleo network and handling private transactions, but its focus is more on infrastructure
and consensus than on proof generation.</li>
<li>Integration: SnarkOS integrates seamlessly with Aleo's zkVM to support private dapps and transactions, but its primary role is as a consensus layer.</li>
<li>Conclusion: No, SnarkOS is not a zkVM. It serves as an operating system for Aleo's decentralized network, focusing on privacy and consensus rather than on generating ZKPs for computations.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="16-lurk">16. [Lurk]<a href="https://research.logos.co/rlog/zkVM-explorations#16-lurk" class="hash-link" aria-label="Direct link to 16. [Lurk]" title="Direct link to 16. [Lurk]"></a></h2>
<li>Overview: Lurk [<a href="https://github.com/lurk-lab" target="_blank" rel="noopener noreferrer">16</a>] is a Turing-complete programming language designed for recursive zk-SNARKs. It focuses on enabling developers to build complex,
recursive ZKPs efficiently through a custom language tailored for verifiable computation.</li>
<li>Main focus: Lurk is centered around recursive proof generation rather than serving as a traditional virtual machine. Its purpose is to facilitate the creation of complex zk-SNARK-based proofs,
making it a specialized tool for cryptographic proofs rather than general-purpose computation.</li>
<li>Privacy: Lurk is built for generating zk-SNARKs, which inherently provide privacy. However, Lurk itself is a language and not a zkVM that executes arbitrary programs and generates ZKPs for them.</li>
<li>Performance: Lurk is optimized for recursive zk-SNARK generation, but specific performance metrics are tied to its proof-generation capabilities rather than traditional execution environments.</li>
<li>Integration: Lurk is specialized for zk-SNARKs and may not easily integrate with other general-purpose systems, as it focuses on specific cryptographic tasks.</li>
<li>Conclusion: No, Lurk is not a zkVM. It is a programming language designed for recursive zk-SNARKs and focuses on proof generation rather than program execution in a virtual machine environment.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="17-piecrust">17. [Piecrust]<a href="https://research.logos.co/rlog/zkVM-explorations#17-piecrust" class="hash-link" aria-label="Direct link to 17. [Piecrust]" title="Direct link to 17. [Piecrust]"></a></h2>
<li>Overview: Piecrust [<a href="https://docs.rs/piecrust/latest/piecrust/" target="_blank" rel="noopener noreferrer">17</a>] is a WASM-based zkVM designed to run on the Dusk Network. It supports concurrent execution and focuses on providing privacy and scalability for smart contracts.</li>
<li>Main focus: Piecrust is designed to provide private and efficient execution of smart contracts through the use of ZKPs.</li>
<li>Privacy: Piecrust supports ZK-friendly computations and enhances privacy through cryptographic primitives such as Merkle trees.</li>
<li>Performance: Piecrust is designed to be scalable and concurrent, allowing multiple sessions to run simultaneously, which improves overall performance.</li>
<li>Integration: Piecrust integrates with the Dusk Network and supports private smart contracts, making it ideal for dapps.</li>
<li>Conclusion: Yes, Piecrust qualifies as a zkVM, offering scalability, privacy, and support for succinct proof generation.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="18-ceno">18. [Ceno]<a href="https://research.logos.co/rlog/zkVM-explorations#18-ceno" class="hash-link" aria-label="Direct link to 18. [Ceno]" title="Direct link to 18. [Ceno]"></a></h2>
<li>Overview: Ceno [<a href="https://eprint.iacr.org/2024/387" target="_blank" rel="noopener noreferrer">18</a>] is a zkVM that provides a theoretical framework for reducing proving time by grouping common portions of code together. It uses recursive proofs to enhance prover efficiency.</li>
<li>Main focus: Ceno aims to optimize prover performance through recursive proofs, making it a powerful tool for handling complex computations efficiently.</li>
<li>Privacy: Ceno supports zero-knowledge privacy through recursive proofs and is designed to handle large-scale computations securely.</li>
<li>Performance: Ceno's recursive proof framework ensures that it can efficiently prove the execution of programs, reducing the time required for proof generation.</li>
<li>Integration: Ceno can be integrated into systems that require high efficiency and privacy, particularly those handling complex, repeated computations.</li>
<li>Conclusion: Yes, Ceno qualifies as a zkVM, providing efficient and private computation through the use of recursive proofs.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="19-stellar">19. [Stellar]<a href="https://research.logos.co/rlog/zkVM-explorations#19-stellar" class="hash-link" aria-label="Direct link to 19. [Stellar]" title="Direct link to 19. [Stellar]"></a></h2>
<li>Overview: Stellar [<a href="https://stellar.org/blog/developers/zkvm-a-new-design-for-fast-confidential-smart-contracts" target="_blank" rel="noopener noreferrer">19</a>] is a decentralized protocol designed to facilitate cross-border transactions between digital and fiat currencies.</li>
<li>Main focus: Stellar's primary goal is to improve financial transactions by enabling decentralized, low-cost currency transfers. It does not aim to provide ZKPs or run verifiable computations
like a zkVM.</li>
<li>Privacy: Stellar focuses on confidentiality and security for financial transactions, but it does not employ ZKPs in the way zkVMs do for verifying computation without revealing data.</li>
<li>Performance: Stellar prioritizes the performance of financial transactions, ensuring low latency and high throughput across its decentralized network.
However, this performance focus is specific to transactions rather than general-purpose program execution.</li>
<li>Integration: Stellar is designed for integration with financial systems, enabling currency conversions and transfers, but it is not built for executing smart contracts or verifiable computations.</li>
<li>Conclusion: No, Stellar is not a zkVM. It is a decentralized financial protocol focused on facilitating cross-border payments rather than verifiable or privacy-preserving computation.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="20-novanet">20. [NovaNet]<a href="https://research.logos.co/rlog/zkVM-explorations#20-novanet" class="hash-link" aria-label="Direct link to 20. [NovaNet]" title="Direct link to 20. [NovaNet]"></a></h2>
<li>Overview: NovaNet [<a href="https://www.novanet.xyz/blog" target="_blank" rel="noopener noreferrer">20</a>] is an open peer-to-peer network that aims to build upon concepts of non-uniform incremental verifiable computation.</li>
<li>Main focus: NovaNet's focus is on peer-to-peer networking and decentralized computing rather than on proving the execution of programs in a zero-knowledge manner.</li>
<li>Privacy: NovaNet does not provide ZKPs or privacy features typically associated with zkVMs. Its focus is on decentralized networking and computation.</li>
<li>Performance: NovaNet prioritizes efficient decentralized computation but does not focus on privacy or performance benchmarks related to ZKPs.</li>
<li>Integration: NovaNet is built for decentralized networks but is not designed to integrate with systems requiring verifiable computation or ZKP generation.</li>
<li>Conclusion: No, NovaNet is not a zkVM. It is a decentralized peer-to-peer network focused on distributed computing rather than zero-knowledge computation.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="21-zkllvm">21. [ZkLLVM]<a href="https://research.logos.co/rlog/zkVM-explorations#21-zkllvm" class="hash-link" aria-label="Direct link to 21. [ZkLLVM]" title="Direct link to 21. [ZkLLVM]"></a></h2>
<li>Overview: ZkLLVM [<a href="https://github.com/NilFoundation/zkLLVM" target="_blank" rel="noopener noreferrer">21</a>] is a compiler that transforms C++ or Rust code into circuits for use in zk-SNARK or zk-STARK systems. Its primary purpose is to bridge high-level programming
languages with ZKP systems by compiling code into arithmetic circuits that can be used to generate and verify proofs.</li>
<li>Main focus: ZkLLVM focuses on making ZKPs accessible to developers by enabling them to write code in familiar languages (C++, Rust) and then compile that code into ZK circuits.</li>
<li>Privacy: ZkLLVM enables the generation of ZKPs by compiling high-level code into ZK-compatible circuits. It plays a crucial role in privacy-preserving applications but does not act
as a zkVM itself.</li>
<li>Performance: ZkLLVM allows for the performance of ZKPs to be closely tied to the complexity of the compiled circuits. The performance depends on the underlying
zk-SNARK or zk-STARK system used.</li>
<li>Integration: ZkLLVM integrates with zk-SNARK and zk-STARK proof systems, making it useful for a variety of privacy-focused applications, but it does not serve as a zkVM
for general-purpose computation.</li>
<li>Conclusion: No, zkLLVM is not a zkVM. It is a compiler that transforms high-level code into ZK circuits, enabling ZKPs but not acting as a virtual machine for executing and proving programs.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="22-zkmove">22. [ZkMove]<a href="https://research.logos.co/rlog/zkVM-explorations#22-zkmove" class="hash-link" aria-label="Direct link to 22. [ZkMove]" title="Direct link to 22. [ZkMove]"></a></h2>
<li>Overview: ZkMove [<a href="https://www.zkmove.net/2023-06-20-zkMove-0.2.0-Achieving-Full-Bytecode-Compatibility-with-Move/" target="_blank" rel="noopener noreferrer">22</a>] is a zkVM designed to execute smart contracts written in the Move language. It utilizes ZKPs to ensure that the execution of these contracts remains verifiable and secure.</li>
<li>Main focus: ZkMove focuses on privacy and verifiable execution for Move-based smart contracts, providing a framework for ZK-friendly computation.</li>
<li>Privacy: ZkMove ensures that smart contract execution remains private through ZKPs, making it suitable for privacy-preserving applications.</li>
<li>Performance: ZkMove is optimized for verifiable execution, ensuring that contracts can be proven correct while preserving privacy.</li>
<li>Integration: ZkMove integrates well with systems that use the Move language, particularly in environments that require private smart contract execution.</li>
<li>Conclusion: Yes, zkMove qualifies as a zkVM, offering ZK-friendly execution and privacy for smart contracts written in the Move language.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="23-o1vm">23. [O1VM]<a href="https://research.logos.co/rlog/zkVM-explorations#23-o1vm" class="hash-link" aria-label="Direct link to 23. [O1VM]" title="Direct link to 23. [O1VM]"></a></h2>
<li>Overview: O1VM [<a href="https://github.com/o1-labs/proof-systems/tree/master/o1vm" target="_blank" rel="noopener noreferrer">23</a>] is a general-purpose zkVM developed by o1Labs. It is designed to prove the execution of MIPS programs efficiently through a combination of zk-SNARKs
and specialized techniques like folding schemes and RAMLookups.</li>
<li>Main focus: O1VM focuses on scalability and verifiable computation for MIPS-based programs, making it a strong contender for executing and proving complex programs efficiently.</li>
<li>Privacy: O1VM ensures privacy through zk-SNARK proofs, keeping the details of the computation private while proving its correctness.</li>
<li>Performance: O1VM is optimized for handling long execution traces and complex computations, making it highly scalable.</li>
<li>Integration: O1VM integrates well with MIPS-based architectures and systems that require privacy-preserving computation.</li>
<li>Conclusion: Yes, o1VM qualifies as a zkVM, providing privacy, scalability, and strong proof generation for MIPS programs.</li>
</ul>
<h1>Summary of findings</h1>
<table><thead><tr><th>Project name</th><th>ZkVM status</th><th>Zero knowledge</th><th>Reasoning/comments</th></tr></thead><tbody><tr><td><strong>SP1</strong></td><td>Yes</td><td>No</td><td>Proves execution of LLVM-based programs but lacks privacy features.</td></tr><tr><td><strong>Nexus</strong></td><td>Yes</td><td>No</td><td>Strong proof generation but lacks zero-knowledge privacy due to Spartan.</td></tr><tr><td><strong>Risc0</strong></td><td>Yes</td><td>Yes</td><td>Supports full ZKP generation for Rust programs.</td></tr><tr><td><strong>Powdr</strong></td><td>No</td><td>Yes</td><td>Toolkit for creating custom zkVMs, not a zkVM itself.</td></tr><tr><td><strong>ZkMIPS</strong></td><td>Yes</td><td>Yes</td><td>Supports MIPS-like architecture with full zero-knowledge and proof generation.</td></tr><tr><td><strong>Valida</strong></td><td>Yes</td><td>No</td><td>Performance-focused zkVM, lacks privacy guarantees.</td></tr><tr><td><strong>Jolt</strong></td><td>Yes</td><td>No</td><td>Performance-focused zkVM, does not achieve zero-knowledge privacy.</td></tr><tr><td><strong>ZkWASM</strong></td><td>Yes</td><td>Yes</td><td>Full zero-knowledge and verifiable execution of WebAssembly code.</td></tr><tr><td><strong>Aleo</strong></td><td>Yes</td><td>Yes</td><td>Fully private and scalable dapps.</td></tr><tr><td><strong>Ola</strong></td><td>No</td><td>No</td><td>Primarily a ZK-rollup platform, not a zkVM, focusing on scalability and performance rather than privacy.</td></tr><tr><td><strong>Miden</strong></td><td>Yes</td><td>Yes</td><td>Zk-STARK-based zkVM with strong privacy and scalability.</td></tr><tr><td><strong>ZkOS</strong></td><td>No</td><td>No</td><td>Verifiable operating system focused on zkApps, not a zkVM.</td></tr><tr><td><strong>Triton</strong></td><td>No</td><td>No</td><td>Optimizes GPU workloads but not designed for ZKPs.</td></tr><tr><td><strong>Cairo</strong></td><td>Yes</td><td>ZK-friendly</td><td>Custom Rust-based language with zk-STARK proof generation.</td></tr><tr><td><strong>SnarkOS</strong></td><td>No</td><td>Yes</td><td>Decentralized OS for Aleo's network, focuses on consensus rather than verifiable computation.</td></tr><tr><td><strong>Lurk</strong></td><td>No</td><td>No</td><td>Programming language for recursive zk-SNARKs, not a zkVM.</td></tr><tr><td><strong>Piecrust</strong></td><td>Yes</td><td>ZK-friendly</td><td>ZkVM with recursive SNARK capabilities, focused on succinct proof generation.</td></tr><tr><td><strong>Ceno</strong></td><td>Yes</td><td>Yes</td><td>Theoretical zkVM improving prover efficiency through recursive proofs.</td></tr><tr><td><strong>Stellar</strong></td><td>No</td><td>No</td><td>Focuses on cross-border transactions, not ZK-proof generation or verifiable computation.</td></tr><tr><td><strong>NovaNet</strong></td><td>No</td><td>No</td><td>Peer-to-peer network focused on distributed computing, not zero-knowledge computation.</td></tr><tr><td><strong>ZkLLVM</strong></td><td>No</td><td>Yes, in some cases</td><td>Compiler for generating ZK-circuits, not a zkVM.</td></tr><tr><td><strong>ZkMove</strong></td><td>Yes</td><td>ZK-friendly</td><td>ZkVM supporting Move language with ZKP execution.</td></tr><tr><td><strong>O1VM</strong></td><td>Yes</td><td>Yes</td><td>MIPS-based zkVM with strong privacy, scalability, and proof generation.</td></tr></tbody></table>
<h1>Insights and conclusions</h1>
<p>Our analysis reveals that many of the projects labeled as zkVMs do meet the core criteria for zkVMs, offering verifiable computation and proof generation
as foundational features. However, a number of these projects fall short of delivering full zero-knowledge privacy. Projects like Risc0, Aleo, and Miden stand out as leading zkVM frameworks
that balance proof generation, privacy, and scalability, offering strong platforms for developers seeking to build privacy-preserving applications.</p>
<p>Conversely, projects like SP1 and Nexus excel in generating verifiable proofs but currently lack comprehensive zero-knowledge privacy mechanisms. These platforms are excellent for
scenarios where proof generation and scalability are paramount, but privacy is not a primary concern.</p>
<p>As zkVM technology continues to evolve, we expect to see more projects integrating enhanced privacy-preserving mechanisms while simultaneously improving performance and scalability.
This ongoing development will likely broaden the application of zkVMs across the blockchain ecosystem, particularly in privacy-sensitive sectors such as finance, data security,
<p>What are your thoughts on our zkVM analysis? Do you agree with our findings, or do you know of other zkVM projects that should be on our radar? We would love to hear your insights, questions,
or suggestions! Feel free to join the <a href="https://forum.research.logos.co/t/exploring-zkvms-which-projects-truly-qualify-as-zero-knowledge-virtual-machines/317" target="_blank" rel="noopener noreferrer">discussion</a> on our forum.</p>
<p>[1] Introducing SP1: A performant, 100% open-source, contributor-friendly zkVM. Retrieved from <a href="https://blog.succinct.xyz/introducing-sp1/" target="_blank" rel="noopener noreferrer">https://blog.succinct.xyz/introducing-sp1/</a></p>
<p>[2] The Nexus 2.0 zkVM. Retrieved from <a href="https://docs.nexus.xyz/" target="_blank" rel="noopener noreferrer">https://docs.nexus.xyz/</a></p>
<p>[3] The first general purpose zkVM. Retrieved from <a href="https://www.risczero.com/zkvm" target="_blank" rel="noopener noreferrer">https://www.risczero.com/zkvm</a></p>
<p>[4] Powdr. Retrieved from <a href="https://docs.powdr.org/" target="_blank" rel="noopener noreferrer">https://docs.powdr.org/</a></p>
<p>[5] ZKM Architecture. Retrieved from <a href="https://docs.zkm.io/zkm-architecture" target="_blank" rel="noopener noreferrer">https://docs.zkm.io/zkm-architecture</a></p>
<p>[6] Valida zkVM Design. Retrieved from <a href="https://delendum.xyz/writings/2023-05-10-zkvm-design.html" target="_blank" rel="noopener noreferrer">https://delendum.xyz/writings/2023-05-10-zkvm-design.html</a></p>
<p>[7] Building Jolt: A fast, easy-to-use zkVM. Retrieved from <a href="https://a16zcrypto.com/posts/article/building-jolt/" target="_blank" rel="noopener noreferrer">https://a16zcrypto.com/posts/article/building-jolt/</a></p>
<p>[8] ZK-WASM. Retrieved from <a href="https://delphinuslab.com/zk-wasm/" target="_blank" rel="noopener noreferrer">https://delphinuslab.com/zk-wasm/</a></p>
<p>[9] Aleo. Retrieved from <a href="https://aleo.org/blog/" target="_blank" rel="noopener noreferrer">https://aleo.org/blog/</a></p>
<p>[12] The Adventures of OS: Making a RISC-V Operating System using Rust. Retrieved from <a href="https://osblog.stephenmarz.com/index.html" target="_blank" rel="noopener noreferrer">https://osblog.stephenmarz.com/index.html</a></p>
<p>[13] Triton VM. Retrieved from <a href="https://triton-vm.org/spec/" target="_blank" rel="noopener noreferrer">https://triton-vm.org/spec/</a></p>
<p>[14] How does the original Cairo VM work?. Retrieved from <a href="https://github.com/lambdaclass/cairo-vm/blob/main/docs/python_vm/README.md" target="_blank" rel="noopener noreferrer">https://github.com/lambdaclass/cairo-vm/blob/main/docs/python_vm/README.md</a></p>
<p>[15] Aleo completes security audits of snarkOS & snarkVM. Retrieved from <a href="https://aleo.org/post/aleo-completes-security-audits-of-snarkos-and-snarkvm/" target="_blank" rel="noopener noreferrer">https://aleo.org/post/aleo-completes-security-audits-of-snarkos-and-snarkvm/</a></p>
<p>[16] Lurk zkVM. Retrieved from <a href="https://github.com/lurk-lab" target="_blank" rel="noopener noreferrer">https://github.com/lurk-lab</a></p>
<p>[17] Piecrust VM. Retrieved from <a href="https://docs.rs/piecrust/latest/piecrust/" target="_blank" rel="noopener noreferrer">https://docs.rs/piecrust/latest/piecrust/</a></p>
<p>[18] Ceno: Non-uniform, Segment and Parallel Zero-knowledge Virtual Machine. Retrieved from <a href="https://eprint.iacr.org/2024/387" target="_blank" rel="noopener noreferrer">https://eprint.iacr.org/2024/387</a></p>
<p>[19] ZkVM: a new design for fast, confidential smart contracts. Retrieved from <a href="https://stellar.org/blog/developers/zkvm-a-new-design-for-fast-confidential-smart-contracts" target="_blank" rel="noopener noreferrer">https://stellar.org/blog/developers/zkvm-a-new-design-for-fast-confidential-smart-contracts</a></p>
<p>[20] Novanet. Retrieved from <a href="https://www.novanet.xyz/blog" target="_blank" rel="noopener noreferrer">https://www.novanet.xyz/blog</a></p>
<p>[21] ZKLLVM. Retrieved from <a href="https://github.com/NilFoundation/zkLLVM" target="_blank" rel="noopener noreferrer">https://github.com/NilFoundation/zkLLVM</a></p>
<p>[22] zkMove 0.2.0 - Achieving Full Bytecode Compatibility with Move. Retrieved from <a href="https://www.zkmove.net/2023-06-20-zkMove-0.2.0-Achieving-Full-Bytecode-Compatibility-with-Move/" target="_blank" rel="noopener noreferrer">https://www.zkmove.net/2023-06-20-zkMove-0.2.0-Achieving-Full-Bytecode-Compatibility-with-Move/</a></p>
<p>[23] O1VM. Retrieved from <a href="https://github.com/o1-labs/proof-systems/tree/master/o1vm" target="_blank" rel="noopener noreferrer">https://github.com/o1-labs/proof-systems/tree/master/o1vm</a></p>]]></content:encoded>
<content:encoded><![CDATA[<p>Nescience: A user-centric state-separation architecture.</p>
<!-- -->
<p><em>Disclaimer: This content is a work in progress. Some components may be updated, changed, or expanded as new research findings become available.</em></p>
<p>In blockchain applications, privacy settings are typically predefined by developers, leaving users with limited control. This traditional,
one-size-fits-all approach often leads to inefficiencies and potential privacy concerns as it fails to cater to the diverse needs of individual users.
The Nescience state-separation architecture (NSSA) aims to address these issues by shifting privacy control from developers to users. NSSA introduces a flexible,
user-centric approach that allows for customized privacy settings to better meet individual needs. This blog post will delve into the details of NSSA,
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="introducing-nssa-a-user-centric-approach">Introducing NSSA: A user-centric approach<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#introducing-nssa-a-user-centric-approach" class="hash-link" aria-label="Direct link to Introducing NSSA: A user-centric approach" title="Direct link to Introducing NSSA: A user-centric approach"></a></h2>
<p>NSSA gives users control over their privacy settings by introducing <em>shielded</em> (which creates a layer of privacy for the outputs, and only the necessary details are shared)
and <em>deshielded</em> (which reveal private details, making them publicly visible) execution types in addition to the traditional public and private modes. This flexibility allows
users to customize their privacy settings to match their unique needs, whether they require high levels of confidentiality or more transparency. In NSSA, the system is divided
into two states: public and private. The public state uses an account-based model while the private state employs a UTXO-based (unspent transaction output) model. Private executions within NSSA utilize
UTXO exchanges, ensuring that transaction details remain confidential. The sequencer verifies these exchanges without accessing specific details, enhancing privacy by unlinking
sender and receiver identities. Zero-knowledge proofs (ZKPs) allow users to prove transaction validity without revealing data, maintaining the integrity and confidentiality of
private transactions. UTXOs contain assets such as balances, NFTs, or private storage data, and are stored in plaintext within Sparse Merkle trees (SMTs) in the private state and
as hashes in the public state. This dual-storage approach keeps UTXO details confidential while allowing public verification through hashes, achieving a balance between privacy and transparency.</p>
<p>Implementing NSSA introduces unique challenges, particularly in cryptographic implementation and maintaining the integrity of private executions. These challenges are addressed
through various solutions such as ZKPs, which ensure transaction validity without compromising privacy, and the dual-storage approach, which maintains confidentiality while enabling
public verification. By allowing users to customize their privacy settings, NSSA enhances user experience and promotes wider adoption of private execution platforms. As we move towards
a future where user-empowered privacy control is crucial, NSSA provides a flexible and user-centric solution that meets the diverse needs of blockchain users.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="why-nssa-differs-from-other-hybrid-execution-platforms">Why NSSA differs from other hybrid execution platforms<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#why-nssa-differs-from-other-hybrid-execution-platforms" class="hash-link" aria-label="Direct link to Why NSSA differs from other hybrid execution platforms" title="Direct link to Why NSSA differs from other hybrid execution platforms"></a></h2>
<p>In many existing hybrid execution platforms, privacy settings are predefined by developers, often applying a one-size-fits-all approach that does not accommodate the
diverse privacy needs of users. These platforms blend public and private states, but control over privacy remains with the application developers.
While this approach is straightforward for developers (who bear the responsibility for any potential privacy leaks), it leaves users with no control over their own privacy settings.
This rigidity becomes problematic as user needs evolve over time, or as new regulations necessitate changes to privacy configurations. In such cases,
updates to decentralized applications are required to adjust privacy settings, which can disrupt the user experience and create friction.</p>
<p>NSSA addresses these limitations by introducing a groundbreaking concept: <strong>selective privacy</strong>. Unlike traditional platforms where privacy
is static and determined by developers, selective privacy empowers users to dynamically choose their own privacy levels based on their unique needs and sensitivity.
This flexibility is critical in a decentralized ecosystem where the diversity of users and use cases demands a more adaptable privacy solution.</p>
<p>In the NSSA model, users have the autonomy to select how they interact with decentralized applications (dapps) by choosing from four types of transaction executions: <strong>public</strong>,
<strong>private</strong>, <strong>shielded</strong>, and <strong>deshielded</strong>. This model allows users to tailor their privacy settings on a per-transaction basis, selecting the most appropriate execution type for each
specific interaction. For instance, a user concerned about data confidentiality might opt for a fully private transaction while another user, wary of privacy but seeking transparency,
<p>While selective privacy may appear complex, especially for users who are not technically inclined, Nescience mitigates this by allowing the community or developers to
establish best practices and recommended approaches. These guidelines provide users with an informed starting point, and over time, users can adjust their privacy
settings as their preferences and trust in the platform evolve. Importantly, selective privacy gives users the right to alter their privacy level at any point in the future,
ensuring that their privacy settings remain aligned with their needs as they change.</p>
<p>This approach not only empowers users but also facilitates greater adoption of dapps. Users who are skeptical about privacy concerns can initially engage with transparent
transactions and gradually shift towards more private executions as they gain confidence in the system and vice versa for users who start with privacy but later find transparency
beneficial for certain transactions. In this way, selective privacy bridges the gap between privacy and transparency, allowing for an optimal balance to emerge from the community’s
<p>To liken this to open-source projects: in traditional systems, developers fix privacy rules much like immutable code—users must comply with these fixed settings.
In contrast, with selective privacy, the rules are malleable and shaped by the users’ preferences, enabling the community to find the ideal balance between privacy and efficiency over time.</p>
<p>NSSA is distinct from traditional zero-knowledge (ZK) rollups in several key ways. One of the unique features of NSSA is its <strong>public execution type</strong>, which does not
require ZKPs or a zero-knowledge virtual machine (zkVM). This provides a significant advantage in terms of scalability and efficiency as users can choose public executions for
transactions that do not require enhanced privacy, avoiding the overhead associated with ZKP generation and verification.</p>
<p>Moreover, NSSA introduces two additional execution types—<strong>shielded and deshielded</strong>—which further distinguish it from traditional privacy-preserving rollups.
These execution types allow for more nuanced control over privacy, giving users the ability to shield certain aspects of a transaction while deshielding others.
This flexibility sets NSSA apart as a more adaptable and user-centric platform, catering to a wide range of privacy needs without imposing a one-size-fits-all solution.</p>
<p>By combining selective privacy with a flexible execution model, NSSA offers a more robust and adaptable framework for decentralized applications,
ensuring that users maintain control over their privacy while benefiting from the security and efficiency of blockchain technology.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="how-nescience-state-separation-architecture-can-be-used">How Nescience state-separation architecture can be used<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#how-nescience-state-separation-architecture-can-be-used" class="hash-link" aria-label="Direct link to How Nescience state-separation architecture can be used" title="Direct link to How Nescience state-separation architecture can be used"></a></h2>
One of the emerging trends in the blockchain space is that each dapp is expected to have its own rollup for efficiency, and it is estimated that Ethereum could see
the deployment of different rollups in the near future. A key question arises: how many of these rollups will incorporate privacy? For dapp developers who want to offer flexible,
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="use-case-adding-privacy-to-existing-dapps">Use case: Adding privacy to existing dapps<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#use-case-adding-privacy-to-existing-dapps" class="hash-link" aria-label="Direct link to Use case: Adding privacy to existing dapps" title="Direct link to Use case: Adding privacy to existing dapps"></a></h3>
<p>Consider a dapp running on a transparent network that offers no inherent privacy to its users. Converting this dapp to a privacy-preserving architecture from scratch would
require significant effort, restructuring, and a deep understanding of cryptographic frameworks. However, with NSSA, the dapp does not need to undergo extensive changes.
Instead, the <strong>Nescience state-separation model</strong> can be deployed as an <strong>add-on</strong>, offering selective privacy as an option for the dapp’s users.</p>
<p>This allows the dapp to retain its existing functionality while providing users with a choice between the traditional, transparent version and a new version with selective privacy features.
With NSSA, the privacy settings are flexible, meaning users can tailor their level of privacy according to their individual needs while the dapp operates on its current infrastructure.
This contrasts sharply with the typical approach, where dapps are either entirely transparent or fully private, with no flexibility for users to select their own privacy preferences.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="key-advantage-decoupling-from-the-host-chain">Key advantage: Decoupling from the host chain<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#key-advantage-decoupling-from-the-host-chain" class="hash-link" aria-label="Direct link to Key advantage: Decoupling from the host chain" title="Direct link to Key advantage: Decoupling from the host chain"></a></h3>
<p>A key feature of NSSA is that it operates independently of the privacy characteristics of the host blockchain. Whether the host chain is fully transparent or fully private,
This decoupling from the host chain’s inherent privacy model is critical as it allows users to benefit from selective privacy even in environments that were not originally designed to offer it.</p>
<p>In <strong>fully private chains</strong>, NSSA allows users to selectively reveal transaction details when compliance with regulations or other requirements is necessary.
In <strong>fully transparent chains</strong>, NSSA allows users to maintain privacy for specific transactions, offering flexibility that would not otherwise be possible.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="conclusion">Conclusion<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion"></a></h3>
<p>NSSA provides a powerful tool for dapp developers who want to offer <strong>selective privacy</strong> to their users without the need for a complete overhaul of their existing systems.
transparent or private blockchains. This flexibility makes NSSA a valuable option for any dapp looking to provide enhanced privacy options while maintaining efficiency and ease of use.</p>
<h1>B. Design</h1>
<p>In this section, we will delve into the core design components of the Nescience state-separation architecture, covering its key structural elements and the mechanisms
that drive its functionality. We will explore the following topics:</p>
<ol>
<li>
<p><strong>Architecture's components</strong>: An in-depth look at the foundational building blocks of NSSA, including the public and private states, UTXO structures, zkVM, and smart contracts.
These components work together to facilitate secure, flexible, and scalable transactions within the architecture.</p>
</li>
<li>
<p><strong>General execution overview</strong>: We will outline the overall flow of transaction execution within NSSA, describing how users interact with the system and how the architecture
supports various types of executions—public, private, shielded, and deshielded—while preserving privacy and efficiency.</p>
</li>
<li>
<p><strong>Execution processes and UTXO management</strong>: This section will focus on the lifecycle of UTXOs within the architecture, from their generation to consumption.
We will also cover the processes involved in managing UTXOs, including proof generation, state transitions, and ensuring transaction validity.</p>
</li>
</ol>
<p>These topics will provide a comprehensive understanding of how NSSA enables flexible and secure interactions within dapps.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="1-architectures-components">1. Architecture's components<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#1-architectures-components" class="hash-link" aria-label="Direct link to 1. Architecture's components" title="Direct link to 1. Architecture's components"></a></h2>
<p>NSSA introduces an advanced prototype execution framework designed to enhance privacy and security in blockchain applications.
This framework integrates several essential components: the public state, private state, zkVM, various execution types, Nescience users, and smart contracts.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="a-public-state">a) Public state<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#a-public-state" class="hash-link" aria-label="Direct link to a) Public state" title="Direct link to a) Public state"></a></h3>
the blockchain network. This state is organized as a single Merkle tree structure, a sophisticated data structure that ensures efficient and secure data verification.
The public state includes critical information such as user balances and the public storage data of smart contracts.</p>
<p>In an account-based model, the public state operates by storing each account or smart contract's public data as individual leaf nodes within the Merkle tree.
When transactions occur, they directly modify the state by updating these leaf nodes. This direct modification ensures that the most current state of the network
<p>The Merkle tree structure is essential for maintaining data integrity. Each leaf node contains a hash of a data block, and each non-leaf node contains the
hash of its child nodes. This hierarchical arrangement means that any change in the data will result in a change in the corresponding hash, making it easy to detect
any tampering. The root hash, or Merkle root, is stored on the blockchain, providing a cryptographic guarantee of the data's integrity. This root hash serves as a single,
concise representation of the entire state, enabling quick and reliable verification by any network participant.</p>
<p>Transparency is a key feature of the public state. All data stored within this state is openly accessible and verifiable by any participant in the network.
This openness ensures that all transactions and state changes are visible and auditable, fostering trust and accountability. For example, user balances are
publicly viewable, which helps ensure transparency and trust in the system. Similarly, public smart contract storage can be accessed and verified by anyone,
making it suitable for applications that require public scrutiny and auditability, such as public record updates and some financial transactions.</p>
<p>The workflow of managing the public state involves several steps to ensure data integrity and transparency. When a user initiates a transaction involving public data,
the relevant changes are proposed and applied to the public state tree. The transaction details, such as transferring funds between accounts or updating smart contract storage,
update the corresponding leaf nodes in the Merkle tree. Following this, the hashes of the affected nodes are recalculated up to the root, ensuring that the entire tree
accurately reflects the new state of the network. The updated Merkle root is then recorded on the blockchain, allowing all network participants to verify the integrity
of the public state. Any discrepancy in the data will result in a mismatched root hash, signaling potential tampering or errors.</p>
<p>In summary, the public state in NSSA leverages the robustness of the Merkle tree structure to provide a secure, transparent, and verifiable environment for publicly
accessible information. By operating on an account-based model and maintaining rigorous data integrity checks, the public state ensures that all transactions are
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="b-private-state">b) Private state<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#b-private-state" class="hash-link" aria-label="Direct link to b) Private state" title="Direct link to b) Private state"></a></h3>
Each user has their own individual Merkle tree, which holds their private information such as balances and storage data. This structure is distinct from the public state,
which uses an account-based model. Instead, the private state employs a UTXO-based model. In this model, each transaction output is a discrete
underlying private data. This means that while the system can verify that a transaction is legitimate, the details of the transaction remain confidential. Only parties
with the appropriate viewing key can access and reconstruct the user’s list of UTXOs, ensuring that sensitive information is protected.</p>
<p>The private state also employs a dual-storage approach to balance privacy and transparency. UTXOs are stored in plaintext within SMTs in the private state,
providing detailed and accessible records for the user. In contrast, the public state only holds hashes of these UTXOs. This method ensures that while the public can verify
the existence and integrity of private transactions through these hashes, they cannot access the specific details.</p>
<p>The workflow for a transaction in the private state begins with the user initiating a transaction involving their private data, such as transferring a private balance or
updating private smart contract storage. The transaction involves spending existing UTXOs, represented as leaves in the Merkle tree, and creating new UTXOs,
which are then appended to the user’s private list. The zkVM generates a ZKP to validate the transaction without revealing
any private data, ensuring the transaction adheres to the system's rules.</p>
<p>Once the proof is generated, it is submitted to the sequencer, which verifies the transaction’s validity. Upon successful verification, the nullifier is added to the nullifier set,
preventing double spending of the same UTXO. The use of ZKPs and nullifiers ensures that the private state maintains both security and privacy.</p>
<p>In summary, the private state in NSSA is meticulously designed to provide users with control over their private information while ensuring the security and integrity of transactions.
By utilizing a UTXO-based model, individual Merkle trees, ZKPs, and a dual-storage system, NSSA achieves a balance between confidentiality and verifiability,
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="c-zkvm-zero-knowledge-virtual-machine">c) ZkVM (zero-knowledge virtual machine)<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#c-zkvm-zero-knowledge-virtual-machine" class="hash-link" aria-label="Direct link to c) ZkVM (zero-knowledge virtual machine)" title="Direct link to c) ZkVM (zero-knowledge virtual machine)"></a></h3>
of privacy and security in blockchain transactions. Its primary function is to generate and aggregate ZKPs, enabling users to validate the
correctness of their transactions without disclosing any underlying details. This capability is crucial for maintaining the confidentiality and integrity of sensitive
<p>ZKPs are sophisticated cryptographic protocols that allow one party, the prover, to convince another party, the verifier, that a certain statement is true,
without revealing any information beyond the validity of the statement itself. In the context of the zkVM, this means users can prove their transactions are valid without
exposing transaction specifics, such as amounts or parties involved. This process is essential for transactions within the private state, where maintaining confidentiality is paramount.</p>
<p>The generation of ZKPs involves intricate cryptographic computations. When a user initiates a transaction, the zkVM processes the transaction inputs and produces a proof
that the transaction adheres to the protocol's rules. This proof must be robust enough to convince the verifier of the transaction's validity while preserving the privacy
<p>Performance optimization is another critical function of the zkVM. In a typical blockchain scenario, verifying multiple individual proofs can be computationally intensive
and time consuming, potentially leading to network congestion and delays. To address this, the zkVM can aggregate multiple ZKPs into a single, consolidated proof.
This aggregation significantly reduces the verification overhead as the verifier needs to check only one comprehensive proof rather than multiple individual ones.
This efficiency is vital for maintaining high throughput and low latency in the blockchain network, ensuring that the system can handle a large volume of transactions swiftly and securely.</p>
<p>Furthermore, the zkVM's role extends beyond mere proof generation and aggregation. It also ensures that all transactions meet the required privacy and security standards
before they are recorded on the blockchain. By interacting seamlessly with other components such as the public and private states, the zkVM ensures that any transaction,
whether it involves public data, private data, or a mix of both, is thoroughly validated and secured.</p>
<p>In summary, the zkVM is essential for the NSSA, providing the cryptographic backbone necessary to support secure and private transactions. Its ability to generate and
By ensuring that all transactions are validated without revealing sensitive information, the zkVM upholds the integrity and trustworthiness of the Nescience blockchain system.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="d-execution-types-in-nssa">d) Execution types in NSSA<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#d-execution-types-in-nssa" class="hash-link" aria-label="Direct link to d) Execution types in NSSA" title="Direct link to d) Execution types in NSSA"></a></h3>
<p>NSSA incorporates multiple execution types to cater to varying levels of privacy and security requirements.
These execution types—public, private, shielded, and deshielded—are designed to provide users with flexible options for managing their transactions based on their specific privacy needs.</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="1-public-executions">1. Public executions<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#1-public-executions" class="hash-link" aria-label="Direct link to 1. Public executions" title="Direct link to 1. Public executions"></a></h4>
<p>Public executions are straightforward transactions that involve reading from and writing to the public state. In this model, data is openly accessible and verifiable
for non-sensitive transactions where public visibility is beneficial, such as updating public records, performing open financial transactions, or interacting with public smart contracts.</p>
<p>The workflow for a public execution starts with a user initiating a transaction that modifies public data. The transaction details are then used to update the relevant
leaf nodes in the Merkle tree. As changes are made, the hashes of affected nodes are recalculated up to the root, ensuring that the entire tree reflects the most recent state.
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="2-private-executions">2. Private executions<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#2-private-executions" class="hash-link" aria-label="Direct link to 2. Private executions" title="Direct link to 2. Private executions"></a></h4>
<p>Private executions are designed for confidential transactions, reading from and writing to the private state. These transactions require ZKPs to ensure that while the
transaction details are validated, the actual data remains private. This execution type is suitable for scenarios where privacy is crucial, such as private financial
transactions or sensitive data management within smart contracts.</p>
<p>In a private execution, the user initiates a transaction involving private data. The transaction spends existing UTXOs and creates new ones, all of which are represented as
leaves in the Merkle tree. The zkVM generates a ZKP to validate the transaction without revealing private data. This proof is submitted to the sequencer,
which verifies the proof to ensure the transaction's validity. Upon successful verification, the nullifier is added to the nullifier set, and the private state is updated
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="3-shielded-executions">3. Shielded executions<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#3-shielded-executions" class="hash-link" aria-label="Direct link to 3. Shielded executions" title="Direct link to 3. Shielded executions"></a></h4>
<p>Shielded executions create a layer of privacy for the outputs by allowing interactions between the public and private states. When a transaction occurs in a shielded execution,
details of the transaction are processed within the private state, ensuring that sensitive information remains confidential. Only the necessary details are shared with the public state,
often in a masked or encrypted form. This approach allows for the validation of the transaction without revealing critical data, thus preserving the privacy of the involved parties.</p>
<p>The workflow for shielded executions begins with the user initiating a transaction that reads from the public state and prepares to write to the private state. Public data is accessed,
and the private state is prepared to receive new data. The zkVM generates a ZKP to hide the receiver’s identity. This proof is submitted to the sequencer, which verifies
the proof to ensure the transaction's validity. If valid, the private state is updated with the new data while the public state reflects the change without revealing private details.
This type of execution is particularly useful for scenarios where the receiver’s identity needs to be hidden, such as in anonymous donation systems or confidential data storage.</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="4-deshielded-executions">4. Deshielded executions<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#4-deshielded-executions" class="hash-link" aria-label="Direct link to 4. Deshielded executions" title="Direct link to 4. Deshielded executions"></a></h4>
<p>Deshielded executions operate in the opposite manner of shielded executions, where data is read from the private state and written to the public state. This execution type is useful
in situations where the sender's identity needs to be kept confidential while making the transaction results publicly visible.</p>
<p>In a deshielded execution, the user initiates a transaction that reads from the private state and prepares to write to the public state. Private data is accessed,
and the transaction details are prepared. The zkVM generates a ZKP to hide the sender’s identity. This proof is then submitted to the sequencer,
which verifies the proof to ensure the transaction's validity. Once verified, the public state is updated with the new data, reflecting the change while keeping the sender’s
details confidential. This can be useful when transparency is needed, such as when auditing or proving certain aspects of a transaction to a wider audience.
By selectively deshielding certain transactions, users can control what information is shared publicly, thus maintaining a balance between privacy and transparency
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="table-of-execution-types">Table of execution types<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#table-of-execution-types" class="hash-link" aria-label="Direct link to Table of execution types" title="Direct link to Table of execution types"></a></h4>
<table><thead><tr><th>Type</th><th>Read from</th><th>Write to</th><th>ZKP required</th><th>Use case</th><th>Description</th></tr></thead><tbody><tr><td>Public</td><td>Public state</td><td>Public state</td><td>No</td><td>Non-sensitive transactions requiring transparency.</td><td>Ideal for transactions that do not require privacy, ensuring full transparency.</td></tr><tr><td>Private</td><td>Private state</td><td>Private state</td><td>Yes</td><td>Confidential transactions needing privacy.</td><td>Suitable for transactions that require confidentiality. Ensures that transaction details remain private through the use of ZKPs.</td></tr><tr><td>Shielded</td><td>Public state</td><td>Private state</td><td>Yes</td><td>Transactions where the receiver’s identity needs to be hidden.</td><td>Hides the identity of the receiver while keeping the transaction details private. Suitable for anonymous donations or confidential data storage.</td></tr><tr><td>Deshielded</td><td>Private state</td><td>Public state</td><td>Yes</td><td>Transactions where the sender’s identity needs to be hidden.</td><td>Ensures the sender’s identity remains confidential while making the transaction results public. Suitable for confidential disbursements or anonymized data publication.</td></tr></tbody></table>
<hr>
<p>By supporting a range of execution types, NSSA provides a flexible and robust framework for managing privacy and security in blockchain transactions.
Whether the need is for complete transparency, total privacy, or a balanced approach, NSSA's execution types allow users to select the level of confidentiality
that best fits their requirements. This flexibility enhances the overall utility of the blockchain, making it suitable for a wide array of applications and use cases.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="e-nescience-users">e) Nescience users<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#e-nescience-users" class="hash-link" aria-label="Direct link to e) Nescience users" title="Direct link to e) Nescience users"></a></h3>
<p>Nescience users are integral to the architecture, managing balances and assets within the blockchain network and invoking smart contracts with various privacy options.
They can choose the appropriate execution type—public, private, shielded, or deshielded—based on their specific privacy and security needs.</p>
<p>Users handle both public and private balances. Public balances are visible to all network participants and suitable for non-sensitive transactions,
these balances, assets, and transactions, allowing users to select the desired execution type seamlessly.</p>
<p>Security is ensured through the use of cryptographic keys, which authenticate and verify transactions. ZKPs maintain privacy
by validating transaction correctness without revealing underlying data, ensuring sensitive information remains confidential even during verification.</p>
<p>The workflow for users involves initiating a transaction, preparing inputs, interacting with smart contracts, generating proofs if needed,
from financial transactions and decentralized applications to data privacy management, allowing users to maintain control over their privacy settings.</p>
<p>By offering this high degree of flexibility and security, Nescience enables users to tailor their privacy settings to their specific needs,
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="f-smart-contracts-in-nssa">f) Smart contracts in NSSA<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#f-smart-contracts-in-nssa" class="hash-link" aria-label="Direct link to f) Smart contracts in NSSA" title="Direct link to f) Smart contracts in NSSA"></a></h3>
Once deployed on the blockchain, these contracts become immutable, meaning their behavior cannot be altered. This ensures that they perform exactly as
intended without the risk of tampering. Because the state and data of the contract are stored permanently on the blockchain, all interactions are fully
transparent and auditable, creating a reliable and trustworthy environment.</p>
<p>One of the key strengths of smart contracts is their ability to automate processes. They are designed to automatically execute when specific conditions are met,
reducing the need for manual oversight or intermediaries. For example, a smart contract might transfer funds when a certain deadline is reached or update a record
once a task is completed. This self-executing nature makes them efficient and minimizes human error.</p>
<p>Smart contracts operate deterministically, meaning they will always produce the same result given the same inputs. This predictability is crucial for ensuring reliability,
especially in complex systems. Additionally, they run in isolated environments on the blockchain, which enhances security by preventing unintended interactions with other processes.</p>
<p>Security is another critical feature of smart contracts. They leverage the underlying cryptographic protections of the blockchain, ensuring that every interaction
is secure and authenticated. Before deployment, the contract code can be audited and verified to ensure it functions correctly. Once on the blockchain,
the immutable nature of the code prevents unauthorized modifications, further ensuring the integrity of the system.</p>
<p>Running smart contracts requires computational resources, which are compensated through gas fees. These fees vary depending on the complexity of the operations within the contract.
More resource-intensive contracts incur higher fees, which helps manage the computational load on the blockchain network.</p>
<p>The workflow of a smart contract begins with its development, where developers code the contract using languages like Rust. Once the code is compiled and deployed to the blockchain,
it becomes a permanent part of the network. Users can then interact with the contract by sending transactions that invoke specific functions. The contract checks whether the
required conditions are met, and if so, it automatically executes the specified actions, such as transferring tokens or updating data on the blockchain.</p>
<p>The benefits of smart contracts are numerous. They eliminate the need for intermediaries by providing a system where trust is built into the code itself.
This not only reduces costs but also increases efficiency by automating repetitive processes. The inherent security of smart contracts, combined with their
transparency—where every action is recorded and visible on the blockchain—makes them a powerful tool for ensuring accountability and trust in decentralized systems.
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="2-general-execution-overview">2. General execution overview<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#2-general-execution-overview" class="hash-link" aria-label="Direct link to 2. General execution overview" title="Direct link to 2. General execution overview"></a></h2>
the four execution types: public, private, shielded, or deshielded. The choice of execution type determines how data will be read from and written to the blockchain,
affecting the transaction's privacy and security levels. Each execution type caters to different privacy needs, allowing the user to tailor the transaction according
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="user-actions">User actions<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#user-actions" class="hash-link" aria-label="Direct link to User actions" title="Direct link to User actions"></a></h3>
<p><strong>Step 1</strong>: <strong>Smart contract selection and input creation</strong></p>
<ul>
<li><strong>Smart contract selection</strong>: The user selects a smart contract they wish to invoke.</li>
<li><strong>Input creation</strong>: The user creates a set of inputs required for the invocation by reading the necessary data from both the public and private states. This includes:<!-- -->
<ul>
<li>Public data such as current account balances, public keys, and smart contract states.</li>
<li>Private data such as private account balances and UTXOs.</li>
<li><strong>Execution type selection</strong>: The user selects the type of execution based on their privacy needs. The options include:<!-- -->
<ul>
<li><strong>Public execution</strong>: Suitable for transactions where transparency is desired.</li>
<li><strong>Private execution</strong>: Used when transaction details need to be confidential.</li>
<li><strong>Shielded execution</strong>: Hides the receiver's identity.</li>
<li><strong>Deshielded execution</strong>: Hides the sender's identity.</li>
</ul>
</li>
<li><strong>ZkVM requirement</strong>: If the execution involves private, shielded, or deshielded types, the user must call the zkVM to handle these confidential transactions.
For purely public executions, the zkVM is not needed, and the user can directly transmit the transaction code to the sequencer.</li>
</ul>
<p><strong>Step 3</strong>: <strong>Calling zkVM for proof generation</strong></p>
<ul>
<li><strong>ZkVM compilation</strong>: The user calls the zkVM to compile the smart contract with both public and private inputs.<!-- -->
<ul>
<li><strong>Kernel circuit proofs</strong>: The zkVM generates individual proofs for each execution type through kernel circuits.</li>
<li><strong>Proof aggregation</strong>: The zkVM aggregates these individual proofs into a single comprehensive proof, combining both private and public inputs.</li>
</ul>
</li>
</ul>
<p><strong>Step 4</strong>: <strong>Transmitting public inputs and retaining private inputs</strong></p>
<ul>
<li><strong>Retaining private inputs</strong>: The user keeps the private inputs secure and does not transmit them.</li>
<li><strong>Revealing public inputs</strong>: The user transmits the following public inputs to the sequencer:<!-- -->
<ul>
<li>Public inputs of the recursive proof</li>
<li>Hashes of UTXOs</li>
<li>Updates to the public state</li>
<li>Transaction signature</li>
<li>Nullifiers (to prevent double spending)</li>
</ul>
</li>
</ul>
<p>After completing these steps, the user's part of the execution is done, and the sequencer takes over the process.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="sequencer-actions">Sequencer actions<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#sequencer-actions" class="hash-link" aria-label="Direct link to Sequencer actions" title="Direct link to Sequencer actions"></a></h3>
<li>For private, shielded, and deshielded executions, the sequencer verifies the proof using the provided public data.</li>
<li>For public executions, the sequencer reruns the smart contract code with the provided inputs to check the results.</li>
</ul>
</li>
<li><strong>Validation</strong>: If both the zkVM proofs and public execution results are verified successfully, the sequencer collects the proof and public data to proceed.
If verification fails, the process is aborted, and the transaction is rejected.</li>
</ul>
<p><strong>Step 6</strong>: <strong>Aggregating proofs and finalizing the block</strong></p>
<ul>
<li><strong>Proof aggregation</strong>: The sequencer calls the zkVM again to aggregate all received proofs into one comprehensive proof to finalize the block.</li>
<li><strong>Finalizing the block</strong>:<!-- -->
<ul>
<li><strong>Public state update</strong>: The sequencer updates the public state with the new transaction data.</li>
<li><strong>Nullifier tree update</strong>: Updates the nullifier tree to reflect the new state and prevent double spending.</li>
<li><strong>Synchronization mechanism</strong>: Runs synchronization mechanisms to ensure fairness and consistency across the network.</li>
<li><strong>UTXO validation</strong>: Validates the exchanged UTXOs to complete the transaction process.</li>
</ul>
</li>
</ul>
<p>This comprehensive process ensures that transactions are executed securely, with the appropriate level of privacy and state updates synchronized across the network.</p>
<p>Below, we outline the execution process of the four different execution types within NSSA:</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="3-execution-processes-and-utxo-management">3. Execution processes and UTXO management<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#3-execution-processes-and-utxo-management" class="hash-link" aria-label="Direct link to 3. Execution processes and UTXO management" title="Direct link to 3. Execution processes and UTXO management"></a></h2>
<p>In Nescience state-separation architecture, UTXOs are key components for managing private data and assets. They serve as private entities that hold both storage and assets,
and deshielded executions. This section explores the lifecycle of UTXOs, detailing their generation, transfer, encryption, and eventual consumption within the private execution framework.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="a-components-of-a-nescience-utxo">a) Components of a Nescience UTXO<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#a-components-of-a-nescience-utxo" class="hash-link" aria-label="Direct link to a) Components of a Nescience UTXO" title="Direct link to a) Components of a Nescience UTXO"></a></h3>
It carries essential information that ensures its proper functionality within private execution, such as the owner, value, private storage slot, non-fungibles,
and other cryptographic components. Below is a detailed breakdown of each component and its role in maintaining the integrity, security, and privacy of the system:</p>
The owner component represents the public key of the entity that controls the UTXO. Only the owner can spend this UTXO, ensuring its security and privacy through public key cryptography.
This means that the UTXO remains secure as only the rightful owner, using their private key, can generate valid signatures to authorize the transaction. For example,
if Alice owns a UTXO linked to her public key, she must sign any transaction to spend it using her private key. This cryptographic protection ensures that only Alice can authorize
The value in a UTXO represents the balance or asset contained within it. This could be cryptocurrency, tokens, or other digital assets. The value ensures accurate accounting,
preventing double spending and maintaining the overall integrity of the system. For instance, if Alice's UTXO has a value of 10 tokens, this represents her ownership of that amount
The private storage slot is an arbitrary and flexible storage space within the UTXO for Nescience applications. It allows users and smart contracts to store additional private data
that is only accessible by the owner. This could be used to hold metadata, smart contract states, or user-specific information. For example, if a smart contract is holding private user data,
Non-fungibles within the UTXO represent unique assets, such as NFTs (Non-Fungible Tokens). Each non-fungible asset is assigned a unique serial number or identifier within the UTXO,
ensuring its distinctiveness and traceability. For example, if Alice owns a digital artwork represented as an NFT, the non-fungible component of the UTXO will store the unique identifier
The random commitment key (RCK) is a randomly generated number used to create a cryptographic commitment to the contents of the UTXO. This commitment ensures the integrity of the data
without revealing any private information. By generating a random key for the commitment, the system ensures that even if someone observes the commitment, they cannot infer any details
The Nullifier key is another randomly generated number, used to ensure that a UTXO is only spent once. When a UTXO is spent, its nullifier key is recorded in a nullifier set to prevent
double spending. This key guarantees that once a UTXO is spent, it cannot be reused in another transaction, effectively nullifying it from future use. This mechanism is crucial for
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="b-utxo-lifecycle-from-generation-to-consumption">b) UTXO lifecycle: From generation to consumption<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#b-utxo-lifecycle-from-generation-to-consumption" class="hash-link" aria-label="Direct link to b) UTXO lifecycle: From generation to consumption" title="Direct link to b) UTXO lifecycle: From generation to consumption"></a></h3>
<p>UTXOs in NSSA are created when a transaction outputs a specific value, asset, or data intended for future use. Once generated, these UTXOs become private entities
owned by specific users, containing sensitive information such as balances, private data, or unique assets like NFTs.</p>
<p>To maintain the required level of confidentiality, UTXOs are encrypted and transferred anonymously across the network. This encryption process ensures that the data within each UTXO
remains hidden from network participants, including the sequencer, while still allowing for verification and validation through ZKPs. These proofs enable the network
to ensure that UTXOs are valid, prevent double spending, and maintain security, all without revealing any sensitive information.</p>
<p>When a user wishes to spend or transfer a UTXO, the lifecycle progresses towards its consumption. The user must prove ownership and validity of the UTXO through a ZKP,
which is then verified by the sequencer. This process occurs in private, shielded, and deshielded executions, where confidentiality is a priority. Once the proof is validated,
the UTXO is consumed, meaning it is marked as spent and cannot be reused, ensuring the integrity of the transaction and preventing double spending.</p>
<p>UTXOs are central to the private, shielded, and deshielded execution types in Nescience. In private executions, UTXOs are transferred securely between parties without revealing any
details to the public state. In shielded executions, UTXOs are used to receive assets from the public state while keeping the recipient's identity confidential. Finally,
in deshielded executions, UTXOs are used to send assets from the private state to the public state, while preserving the sender's anonymity.</p>
<p>Since UTXOs are not exchanged in public executions, this lifecycle analysis is focused solely on private, shielded, and deshielded executions, where privacy and confidentiality are essential.
In these contexts, the careful management and transfer of UTXOs ensure that the users' private data and assets remain secure, while still allowing for seamless and confidential transactions
<p>At this point, it's crucial to introduce two key components that will play a significant role in the next section: the ephemeral key and the nillifier.</p>
<ul>
<li>
<p><strong>Ephemeral key:</strong> The ephemeral key is embedded in the transaction message and plays a crucial role in maintaining privacy. It is used by the sender, alongside the receiver's public key,
in a key agreement protocol to derive a shared secret. This shared secret is then employed to encrypt the transaction details, ensuring that only those with the receiver's viewing key can
decrypt the transaction. By using the ephemeral key, the receiver can regenerate the shared secret, granting access to the transaction's contents. The sender generates the ephemeral key
using their spending key and the UTXO's nullifier, reinforcing the security of the transaction. (more details in <a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#key">key management and addresses section</a>)</p>
<p><strong>Nullifier:</strong> A nullifier is a unique value tied to a specific UTXO, ensuring that it has not been spent before. Its uniqueness is essential, as a nullifier must never correspond to more
than one UTXO—otherwise, even if both UTXOs are valid, only one could be spent. This would undermine the integrity of the system. To spend a UTXO, a proof must be provided showing that
the nullifier does not already exist in the Nullifier Tree. Once the transaction is confirmed and included in the blockchain, the nullifier is added to the Nullifier Tree, preventing any
future reuse of the same UTXO. A UTXO's nullifier is generated by combining the receiver's nullifier key with the transaction note's commitment, further ensuring its distinctiveness
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="-i-utxos-in-private-executions"><a id="pe"></a> I) UTXOs in private executions<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#-i-utxos-in-private-executions" class="hash-link" aria-label="Direct link to -i-utxos-in-private-executions" title="Direct link to -i-utxos-in-private-executions"></a></h4>
This approach is particularly useful for confidential payments, where the identities of the sender and receiver, as well as the transaction amounts, must remain hidden.
The process is powered by ZKPs, ensuring that only the involved parties have access to the transaction details while maintaining the integrity of the network.</p>
<ul>
<li>
<p><strong>Stages of private execution</strong>: Private executions operate in two key stages: UTXO consumption and UTXO creation. In the first stage, UTXOs from the private state are used
as inputs for the transaction. In the second stage, new UTXOs are generated as outputs and stored back in the private state. Throughout this process, the details of the
transaction are kept confidential and only shared between the sender and receiver.</p>
</li>
<li>
<p><strong>Private transaction workflow (transaction initialization)</strong>: The user initiates a private transaction by selecting the input UTXOs that will be spent and determining the
output UTXOs to be created. This involves specifying the amounts to be transferred and the recipient’s private address (a divestified address that hides the recipient's public
address from the network). The nullifier key and random number for commitments (RCK) are also generated at this stage to define how these UTXOs can be spent or nullified in the
<p><strong>Proof generation and verification</strong>: Next, the zkVM generates a ZKP to validate the transaction. This proof includes both a membership proof for the input UTXOs,
confirming their presence in the hashed UTXO tree, and a non-membership proof to ensure that the input UTXOs have not already been spent (i.e., they are not in the nullifier tree).
The proof also confirms that the total input value matches the total output value, ensuring no discrepancies. The user then submits the proof, along with the necessary metadata, to the sequencer.</p>
</li>
<li>
<p><strong>Shared secret and encryption</strong>: To maintain confidentiality, the sender uses the receiver’s divestified address to generate an ephemeral public key.
This allows the creation of a shared secret between the sender and receiver. Using a key derivation function, a symmetric encryption key is generated from the shared secret.
The input and output UTXOs are then encrypted using this symmetric key, ensuring that only the intended recipient can decrypt the data.</p>
</li>
<li>
<p><strong>Broadcasting the transaction</strong>: The user broadcasts the encrypted UTXOs to the network, along with a commitment to the output UTXOs using Pedersen hashes.
These committed UTXOs are sent to the sequencer, which updates the hashed UTXO tree without knowing the transaction details.</p>
</li>
<li>
<p><strong>Decryption by the receiver</strong>: After the broadcast, the receiver attempts to decrypt the broadcast UTXOs using their symmetric key, derived from the ephemeral public key.
If the receiver successfully decrypts a UTXO, it confirms ownership of that UTXO. The receiver then computes the nullifier for the UTXO and verifies its presence in the hashed
UTXO tree and its absence from the nullifier tree, ensuring it has not been spent. Finally, the new UTXO is added to the receiver’s locally stored UTXO tree for future transactions.</p>
</li>
</ul>
<p>Throughout the private execution process, the identities of both the sender and receiver, as well as all transaction details, remain hidden from the public.
the network guarantees that no participant, aside from the sender and receiver, can deduce any details about the transaction or the involved parties.</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="ii-utxos-in-shielded-executions">II) UTXOs in shielded executions<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#ii-utxos-in-shielded-executions" class="hash-link" aria-label="Direct link to II) UTXOs in shielded executions" title="Direct link to II) UTXOs in shielded executions"></a></h4>
<p>In shielded executions, the interaction between public and private states provides a hybrid privacy model that balances transparency and confidentiality.
This model is suitable for scenarios where the initial step, such as a public transaction, requires visibility, while subsequent actions, such as private asset management,
need to remain confidential. One common use case is asset conversion—where a public token is converted into a private token. The conversion is visible on the public ledger,
<h5 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="a-how-shielded-executions-work">a) How shielded executions work<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#a-how-shielded-executions-work" class="hash-link" aria-label="Direct link to a) How shielded executions work" title="Direct link to a) How shielded executions work"></a></h5>
<p>Shielded executions operate in two distinct stages: first, there is a modification of the public state, and then new UTXOs are created and stored in the private state.
Importantly, shielded executions do not consume UTXOs but instead mint them, as new UTXOs are created to reflect the changes in the private state. This structure demands
ZKPs to ensure that the newly minted UTXOs are consistent with the modifications in the public state. Here’s a step-by-step breakdown of how the shielded
<p><strong>Transaction initiation:</strong> The user initiates a transaction that modifies the public state, such as converting a public token to a private token.
The transaction alters the public state (e.g., balances or smart contract storage) while simultaneously preparing to mint new UTXOs in the private state.</p>
</li>
<li>
<p><strong>Generating UTXOs:</strong> After modifying the public state, the system mints new UTXOs in the private state. These UTXOs must be securely created, ensuring their integrity
and consistency with the initial public state modification. A ZKP is generated by the user to prove that these new UTXOs align with the changes made in the public state.</p>
</li>
<li>
<p><strong>Key setup for privacy</strong>: The sender retrieves the receiver's address and uses it to create a shared secret through an ephemeral public key. This shared secret is then used
to derive a symmetric key, which encrypts the output UTXOs. This encryption ensures that only the intended receiver can decrypt and access the UTXOs.</p>
</li>
<li>
<p><strong>Broadcasting and verifying UTXOs</strong>: After encrypting the UTXOs, the sender broadcasts them to the network. The new hashed UTXOs are sent to the sequencer,
which verifies the validity of the UTXOs and attaches them to the hashed UTXO tree within the private state. The public inputs for the ZKP circuits consist of the
Pedersen-hashed UTXOs and the modifications in the public state.</p>
</li>
<li>
<p><strong>Receiver's role</strong>: Once the UTXOs are broadcast, the receiver attempts to decrypt each UTXO using the symmetric key derived from the shared secret. If the decryption is successful,
the UTXO belongs to the receiver. The receiver then verifies the UTXO’s validity by checking its inclusion in the hashed UTXO tree and ensuring that its nullifier has not yet been used.</p>
</li>
<li>
<p><strong>Nullifier check and integration</strong>: To prevent double spending, the receiver computes the nullifier for the received UTXO and verifies that it is not already present in the nullifier tree.
Once verified, the receiver adds the UTXO to their locally stored UTXO tree for future use in private transactions.</p>
</li>
</ol>
<p>While shielded executions offer privacy, certain information is still exposed to the public state, such as the sender's identity. To further enhance privacy,
the sender can create empty UTXOs—UTXOs that don’t belong to anyone but are included in the transaction to obfuscate the true details of the transaction.
<h5 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="b-summary-of-shielded-execution-flow">b) Summary of shielded execution flow<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#b-summary-of-shielded-execution-flow" class="hash-link" aria-label="Direct link to b) Summary of shielded execution flow" title="Direct link to b) Summary of shielded execution flow"></a></h5>
<li><strong>Stage 1 (public modification):</strong> The user modifies public state data, such as converting tokens from public to private. This stage is visible to the public.</li>
<li><strong>Stage 2 (UTXO minting and privacy):</strong> New UTXOs are minted in the private state, encrypted, and broadcast to the network. The transaction remains private from this point forward,
secured by ZKPs and cryptographic keys.</li>
<li><strong>Receiver’s role:</strong> The receiver decrypts the UTXOs and verifies their validity, ensuring the UTXOs are not double spent and are ready for future transactions.</li>
</ul>
<p>In summary, shielded executions enable a hybrid privacy model in Nescience, balancing public transparency and private confidentiality. They are well-suited for
transactions requiring initial public visibility, such as asset conversions, while ensuring that subsequent actions remain secure and private within the network.</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="iii-utxos-in-deshielded-executions">III) UTXOs in deshielded executions<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#iii-utxos-in-deshielded-executions" class="hash-link" aria-label="Direct link to III) UTXOs in deshielded executions" title="Direct link to III) UTXOs in deshielded executions"></a></h4>
information in a controlled and verifiable manner. This type of execution allows for selective disclosure, ensuring transparency when needed while still maintaining
the security and privacy of critical details through cryptographic techniques like ZKPs. Deshielded executions are particularly valuable for use cases
such as regulatory compliance reporting, where specific transaction details must be revealed to meet legal requirements, while other sensitive transactions remain private.</p>
<h5 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="a-stages-of-deshielded-executions">a) Stages of deshielded executions<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#a-stages-of-deshielded-executions" class="hash-link" aria-label="Direct link to a) Stages of deshielded executions" title="Direct link to a) Stages of deshielded executions"></a></h5>
<p><strong>Stage 1 (UTXO consumption):</strong> The process begins in the private state, where UTXOs are consumed as inputs for the transaction. This involves gathering all necessary
UTXOs that contain the assets or balances to be made public, as well as any associated private data stored in memory slots.</p>
</li>
<li>
<p><strong>Stage 2 (public state modification):</strong> After the UTXOs are consumed, the transaction details are made public by modifying the public state. This update includes changes
to the public balances, storage data, and any necessary public records. While the public state is updated, the sender’s identity and other sensitive information remain hidden,
thanks to the privacy-preserving properties of ZKPs.</p>
</li>
</ul>
<p>This model ensures that private data can be selectively revealed when needed, offering both flexibility and transparency. It is particularly useful for scenarios requiring
auditing or compliance reporting, where specific details must be made publicly verifiable without exposing the entire history or contents of private transactions.</p>
<h5 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="b-how-deshielded-executions-work">b) How deshielded executions work<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#b-how-deshielded-executions-work" class="hash-link" aria-label="Direct link to b) How deshielded executions work" title="Direct link to b) How deshielded executions work"></a></h5>
<p>The deshielded execution process starts when a user initiates a transaction using private UTXOs. The Nescience zkVM is called to generate a ZKP,
which validates the transaction without revealing sensitive details such as the sender's identity or the specifics of the Nescience application being executed.</p>
<p>During the transaction, the UTXOs from the private state are consumed, meaning they are used up as inputs and will no longer be available for future transactions.
Instead of generating new UTXOs, the transaction modifies the public state, updating the necessary balances or memory slots related to the transaction.
Here’s a step-by-step breakdown of how the deshielded execution process unfolds:</p>
<ol>
<li>
<p><strong>Get receiver's public address:</strong> The sender first identifies the public address of the receiver, to which the information or assets will be made public.</p>
</li>
<li>
<p><strong>Determine input UTXOs and public state modifications:</strong> The sender gathers all the input UTXOs needed for the transaction and determines the public state modifications
necessary for the Nescience applications and token transfers involved.</p>
</li>
<li>
<p><strong>Calculate nullifiers:</strong> Nullifiers are generated for each input UTXO, ensuring that these UTXOs cannot be reused or double spent. The nullifiers are derived from the
corresponding UTXO commitments.</p>
</li>
<li>
<p><strong>Call zkVM with deshielded circuits:</strong> The sender invokes the zkVM with deshielded kernel circuits, which generates the proof. The proof ensures that all input UTXOs
are valid by verifying their membership in the UTXO tree and their non-membership in the nullifier tree, ensuring they haven’t been spent.</p>
</li>
<li>
<p><strong>Generate and submit proof:</strong> The zkVM generates a ZKP that verifies the correctness of the transaction without revealing private details.
The proof includes the nullifiers and the planned modifications to the public state.</p>
</li>
<li>
<p><strong>Send proof to sequencer:</strong> The sender then sends the proof and any relevant public information to the sequencer. The sequencer is responsible for verifying the proof,
updating the public state accordingly, and adding the nullifiers to the nullifier tree.</p>
</li>
</ol>
<p>Once the proof and public information have been broadcast to the network, the receiver does not need to take any further action.
The sequencer manages the public state updates and ensures that the transaction is properly executed. By the end of the deshielded execution,
specific transaction details become publicly visible, such as the identity of the receiver and the outcome of the transaction.
This allows participants in the public state to extract information about the transaction, including the receiver's identity and some details about the execution.
While the receiver's identity is revealed, the sender's identity and sensitive transaction details remain hidden, thanks to the use of ZKPs.
This makes deshielded executions ideal for cases where transparency is needed, but complete privacy is still a priority for certain elements of the transaction.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="summary-of-utxo-consumption-in-nssa">Summary of UTXO consumption in NSSA<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#summary-of-utxo-consumption-in-nssa" class="hash-link" aria-label="Direct link to Summary of UTXO consumption in NSSA" title="Direct link to Summary of UTXO consumption in NSSA"></a></h3>
<p>In NSSA, consuming UTXOs is a critical step in maintaining the security and integrity of the blockchain by preventing double spending.
When a UTXO is consumed, it is used as an input in a transaction, effectively marking it as spent. This ensures that the UTXO cannot be reused, preserving the integrity of the blockchain.</p>
<ol>
<li><strong>The process of consuming UTXOs:</strong> The process of consuming a UTXO begins when a user selects a UTXO from their private state. The user verifies the UTXO’s existence and
ownership using their viewing key, ensuring that they are the legitimate owner of the UTXO. Once verified, the user generates two key cryptographic proofs:<!-- -->
<ul>
<li><strong>Membership proof:</strong> This proof confirms that the UTXO exists within the hashed UTXO tree, ensuring its validity within the system.</li>
<li><strong>Non-membership proof:</strong> This proof ensures that the UTXO has not been previously consumed by checking its absence in the nullifier tree, which tracks spent UTXOs.</li>
</ul>
</li>
</ol>
<p>To mark the UTXO as spent, a <strong>nullifier</strong> is generated. This nullifier is a unique cryptographic hash derived from the UTXO, which is then added to the nullifier tree in the public state.
Adding the nullifier to the tree prevents the UTXO from being reused in future transactions, thus preventing double spending.</p>
<p>After generating the membership and non-membership proofs, the user compiles the transaction using the zkVM. The zkVM is responsible for generating the necessary ZKPs,
which validate the transaction without revealing sensitive details. The compiled transaction, along with the proofs, is then submitted to the sequencer for verification.</p>
<ol start="2">
<li><strong>The role of the sequencer:</strong> Once the transaction is submitted, the sequencer verifies the ZKPs to confirm that the transaction is valid. If the proofs are verified
successfully, the sequencer updates both the private and public states to reflect the transaction. This includes updating the nullifier tree with the newly generated nullifier,
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="example-alice-sending-tokens-to-bob">Example: Alice sending tokens to Bob<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#example-alice-sending-tokens-to-bob" class="hash-link" aria-label="Direct link to Example: Alice sending tokens to Bob" title="Direct link to Example: Alice sending tokens to Bob"></a></h4>
<p>Consider an example where Alice wants to send 5 Nescience tokens to Bob using a private execution. Alice selects a UTXO from her private state that contains 5 Nescience tokens.
She generates the necessary membership and non-membership proofs, ensuring that her UTXO exists in the system and has not been previously spent. Alice then creates a nullifier by
hashing the UTXO and compiles the transaction with the zkVM.</p>
<p>Once Alice submits the transaction, the sequencer verifies the proofs and updates the blockchain by adding the nullifier to the nullifier tree and recording the transaction details.
This ensures that Alice’s UTXO is marked as spent and cannot be used again, while Bob receives the 5 tokens.</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-importance-of-nullifiers">The importance of nullifiers<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#the-importance-of-nullifiers" class="hash-link" aria-label="Direct link to The importance of nullifiers" title="Direct link to The importance of nullifiers"></a></h4>
<p>Nullifiers are a key mechanism in preventing double spending. By marking consumed UTXOs as spent and tracking them in the nullifier tree, NSSA ensures that
once a UTXO is used in a transaction, it cannot be reused in any future transactions. This process is fundamental to maintaining the integrity and security of the blockchain,
as it guarantees that assets are only spent once and prevents potential attacks on the system.</p>
<p>In conclusion, the process of consuming UTXOs in NSSA combines cryptographic proofs, nullifiers, and ZKPs to ensure that transactions
are secure, confidential, and free from the risks of double spending.</p>
<h1>C. Cryptographic primitives in NSSA</h1>
<p>In the NSSA, cryptographic primitives are the foundational elements that ensure the security, privacy, and efficiency of the state separation model.
These cryptographic tools enable private transactions, secure data management, and robust verification processes across both public and private states.
The architecture leverages a wide range of cryptographic mechanisms, including advanced hash functions, key management systems, tree structures, and ZKPs,
to safeguard user data and maintain the integrity of transactions.</p>
<p>Cryptographic hash functions play a pivotal role in concealing UTXO details, generating nullifiers, and constructing sparse Merkle trees, which organize and verify
data efficiently within the network. Key management and address generation further enhance the security of user assets and identity, ensuring that only authorized
<p>The architecture also relies on specialized tree structures for organizing data, verifying the existence of UTXOs, and tracking nullifiers, which prevent double spending.
Additionally, Nescience features a privacy-preserving zero-knowledge virtual machine (zk-zkVM), which allows users to prove the correctness of an execution without
disclosing sensitive information. This enables private transactions and maintains confidentiality across the network.</p>
<p>As Nescience evolves, optional cryptographic mechanisms such as multi-party computation (MPC) may be integrated to enhance synchronization across privacy levels.
This MPC-based synchronization mechanism is still under development and under review for potential inclusion in the system. Together, these cryptographic primitives
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="a-hash-functions-in-nescience">a) Hash functions in Nescience<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#a-hash-functions-in-nescience" class="hash-link" aria-label="Direct link to a) Hash functions in Nescience" title="Direct link to a) Hash functions in Nescience"></a></h2>
<p>Hash functions are a foundational element of Nescience’s cryptographic framework, serving multiple critical roles that ensure the security, privacy, and efficiency of the system.
One of the primary uses of hash functions in Nescience is to conceal sensitive details of UTXOs by converting them into fixed-size hashes. This process allows UTXO details
to remain private, ensuring that sensitive information is not directly exposed on the blockchain, while still enabling their existence and integrity to be verified. Hashing
the UTXO details allows the actual data to remain confidential, with the hashes stored in a global tree structure for efficient management and retrieval.</p>
<p>Additionally, hash functions are essential for generating <strong>nullifiers</strong>, which play a crucial role in preventing double spending. Nullifiers are created by hashing UTXOs
and are used to mark them as spent, ensuring that they cannot be reused in subsequent transactions. These nullifiers are stored in a nullifier tree, and each transaction
must prove that its UTXO’s nullifier is not already present in the tree before it can be processed. This ensures that the UTXO has not been spent before, maintaining the
<p>Hash functions are also vital in the construction of <strong>sparse Merkle trees</strong>, which provide an efficient and secure method for verifying data within the blockchain.
Sparse Merkle trees enable quick and reliable proofs of membership and non-membership, making them essential for verifying both UTXOs and nullifiers. By using hash functions
to build these trees, Nescience can ensure the integrity of the data, as any tampering with the data would result in a change in the hash, making the manipulation detectable.</p>
<p>Another critical consideration in Nescience is the compatibility of hash functions with <strong>ZKPs</strong>. ZK-friendly hash functions are optimized for efficient
computation within the constraints of ZK circuits, ensuring that they do not become a bottleneck in the proof generation or verification process. These hash functions
maintain strong cryptographic security properties while enabling efficient computations in ZKP systems, which is essential for maintaining privacy and
<p>The primary advantage of using hash functions in Nescience is their ability to ensure that transaction details remain private while still allowing for verification
of their validity. Furthermore, by integrating hash functions into Merkle trees, the blockchain data becomes tamper-proof, enabling quick and efficient verification
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="use-case-how-to-use-the-pedersen-hash-to-create-the-utxo-commitment">Use case: How to use the Pedersen hash to create the UTXO commitment<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#use-case-how-to-use-the-pedersen-hash-to-create-the-utxo-commitment" class="hash-link" aria-label="Direct link to Use case: How to use the Pedersen hash to create the UTXO commitment" title="Direct link to Use case: How to use the Pedersen hash to create the UTXO commitment"></a></h3>
<p>As mentioned in the <a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#pe">UTXOs in private executions section</a>, the user broadcasts the encrypted UTXOs to the network, along with a commitment to the output UTXOs
using <strong>Pedersen hashes</strong>. The Pedersen hash is used to create the UTXO commitment. The Pedersen hash is a homomorphic commitment scheme that allows secure commitments
<p>In this formula, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">g</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>h</mi></mrow><annotation encoding="application/x-tex">h</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal">h</span></span></span></span> are two generators of a cryptographic group where no known relationship exists between them. This ensures that the commitment is secure
and computationally infeasible to reverse or manipulate without knowing the original UTXO components. The random number <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>R</mi><mi>C</mi><mi>K</mi></mrow><annotation encoding="application/x-tex">RCK</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07153em">RC</span><span class="mord mathnormal" style="margin-right:0.07153em">K</span></span></span></span> adds an additional layer of security
by blinding the UTXO's contents, ensuring that the commitment doesn't leak any information about the underlying data.</p>
<p><strong>Importance of homomorphic commitments</strong></p>
<p>It is essential to use a homomorphic commitment like the Pedersen commitment for UTXOs because it allows for the verification of important properties in transactions,
such as ensuring that the total input value of a transaction equals the total output value. This balance is crucial for preventing the unauthorized creation of funds or d
discrepancies in transactions. A homomorphic commitment enables these proofs because of its additive properties. Specifically, the exponents in the commitment formula are additive,
meaning that commitments can be combined and verified without revealing the individual components. For instance, if you have two UTXOs with commitments <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi><mo stretchy="false">(</mo><mi>U</mi><mi>T</mi><mi>X</mi><msub><mi>O</mi><mn>1</mn></msub><mo separator="true">,</mo><mi>R</mi><mi>C</mi><msub><mi>K</mi><mn>1</mn></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">C(UTXO_1,RCK_1)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord mathnormal" style="margin-right:0.07153em">C</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.10903em">U</span><span class="mord mathnormal" style="margin-right:0.07847em">TX</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.02778em">O</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em"></span><span class="mord mathnormal" style="margin-right:0.07153em">RC</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07153em">K</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>
and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi><mo stretchy="false">(</mo><mi>U</mi><mi>T</mi><mi>X</mi><msub><mi>O</mi><mn>2</mn></msub><mo separator="true">,</mo><mi>R</mi><mi>C</mi><msub><mi>K</mi><mn>2</mn></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">C(UTXO_2,RCK_2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord mathnormal" style="margin-right:0.07153em">C</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.10903em">U</span><span class="mord mathnormal" style="margin-right:0.07847em">TX</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.02778em">O</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em"></span><span class="mord mathnormal" style="margin-right:0.07153em">RC</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07153em">K</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>, you can combine them and verify that the resulting commitment is valid without exposing the actual amounts.</p>
<p>This capability is leveraged through a modified version of the Schnorr protocol, which is used in conjunction with the Pedersen hash to verify the correctness of transactions.
The Schnorr protocol allows users to prove, without revealing the actual values, that the sum of inputs equals the sum of outputs, ensuring that no funds are created or lost in the transaction.</p>
<p><strong>Limitations of standard cryptographic hashes</strong></p>
<p>Standard cryptographic hash functions, such as SHA-256, are not suitable for this purpose because they lack the algebraic structure needed for homomorphic properties.
In particular, while SHA-256 provides strong security for general hashing purposes, it does not allow the additive properties that are required to perform the type of
ZKPs used in Nescience for UTXO commitments. This is why the Pedersen hash is preferred, as it enables the secure and private execution of transactions
while allowing for balance verification and other critical proofs.</p>
<p><strong>Conclusion</strong></p>
<p>By using homomorphic commitments like the Pedersen hash, NSSA ensures that UTXOs can be securely committed and validated without exposing sensitive information.
The random component (RCK) adds an additional layer of security, and the additive properties of the Pedersen commitment enable powerful ZKPs that maintain the
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="-b-key-management-and-addresses-in-nescience"><a id="key"></a> b) Key management and addresses in Nescience<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#-b-key-management-and-addresses-in-nescience" class="hash-link" aria-label="Direct link to -b-key-management-and-addresses-in-nescience" title="Direct link to -b-key-management-and-addresses-in-nescience"></a></h2>
the exchange of UTXOs. These schemes rely on a structured set of cryptographic keys, each serving a specific purpose in maintaining privacy, security, and control over assets.
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="i-spending-key">I. Spending key<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#i-spending-key" class="hash-link" aria-label="Direct link to I. Spending key" title="Direct link to I. Spending key"></a></h3>
<p>The spending key is the fundamental secret key in NSSA, acting as the primary control mechanism for a user’s UTXOs and other digital assets.
It plays a critical role in the cryptographic security of the system, ensuring that only the rightful owner can authorize and spend their assets.</p>
<ul>
<li>
<p><strong>Role of the spending key</strong>: The spending key is responsible for generating the user’s private keys, which are used in various cryptographic operations such as
signing transactions and creating commitments. This hierarchical relationship means that the spending key sits at the root of a user’s key structure, safeguarding
access to all associated private keys and, consequently, to the user’s assets. In Nescience’s privacy-focused model, the spending key is never exposed or shared outside
the user’s control. Unlike other keys, it does not interact with the public state, kernel circuits, or even the ZKP system. This isolation ensures that
the spending key remains completely private and inaccessible to external entities. By keeping the spending key separate from the operational aspects of the network,
Nescience minimizes the risk of key leakage or compromise.</p>
</li>
<li>
<p><strong>Generation and security of the spending key</strong>: The spending key is generated randomly from the scalar field, a large mathematical space that ensures uniqueness
and cryptographic strength. This randomness is crucial because it prevents attackers from predicting or replicating the key, thereby safeguarding the user’s assets
from unauthorized access: it is computationally infeasible for an attacker to guess or brute-force the key. Once the spending key is generated, it is securely stored
by the user, typically in a hardware wallet or another secure storage mechanism that prevents unauthorized access.</p>
</li>
<li>
<p><strong>Spending UTXOs with the spending key</strong>: The spending key’s primary function is to authorize the spending of UTXOs in private transactions. When a user initiates
a transaction, the spending key is used to generate the necessary cryptographic proofs and signatures, ensuring that the transaction is valid and originates from
the rightful owner. However, even though the spending key generates these proofs, it is never directly exposed during the transaction process. Instead, derived
private keys handle the operational aspects while the spending key remains secure in the background. For example, when Alice decides to spend a UTXO in a
private execution, her spending key generates the required private keys that will sign the transaction and ensure its validity. However, the spending key itself
never appears in any public state or transaction data, preserving its confidentiality.</p>
</li>
<li>
<p><strong>Ensuring security through isolation</strong>: One of the key security principles of the spending key is its isolation from the network. Since it never interacts with
public-facing elements, such as the public state or kernel circuits, the risk of exposure is significantly reduced. This isolation ensures that even if other parts
of the cryptographic infrastructure are compromised, the spending key remains protected, preventing unauthorized spending of UTXOs.</p>
</li>
</ul>
<p>In summary, the spending key in Nescience is a powerful and carefully guarded element of the cryptographic system. It is the root key from which other private keys
are derived, allowing users to spend their UTXOs securely and privately. Its isolation from the public state and its random generation from a secure scalar field ensures
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="ii-private-keys">II. Private keys<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#ii-private-keys" class="hash-link" aria-label="Direct link to II. Private keys" title="Direct link to II. Private keys"></a></h3>
<p>In Nescience, the private key is an essential cryptographic element responsible for facilitating various secure operations, such as generating commitments and signing
transactions. While the spending key plays a foundational role in safeguarding access to UTXOs and assets, the private keys handle the operational aspects of transactions
its cryptographic security and unpredictability. This seed is generated using a random number generator, making it virtually impossible to predict or replicate.
The random seed is essential because it is used to derive the other two components of the private key. By leveraging a secure random seed, Nescience ensures that
the entire private key structure is rooted in randomness, preventing external entities from guessing or deriving the key through brute-force attacks.
The strength of the random seed ensures the overall security of the private key and, consequently, the integrity of the user's transactions and commitments.</p>
adding a layer of security to commitments made by the user. The <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>p</mi><mi>r</mi><mi>i</mi><mi>v</mi><mi>a</mi><mi>t</mi><mi>e</mi></mrow><mrow><mi>k</mi><mi>e</mi><mi>y</mi></mrow></msub><mi mathvariant="normal">.</mi><mi>r</mi><mi>c</mi><mi>m</mi></mrow><annotation encoding="application/x-tex">{private}_{key}.rcm</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0398em;vertical-align:-0.3802em"></span><span class="mord"><span class="mord"><span class="mord mathnormal">p</span><span class="mord mathnormal" style="margin-right:0.02778em">r</span><span class="mord mathnormal">i</span><span class="mord mathnormal" style="margin-right:0.03588em">v</span><span class="mord mathnormal">a</span><span class="mord mathnormal">t</span><span class="mord mathnormal">e</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.242em"><span style="top:-2.4559em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em">k</span><span class="mord mathnormal mtight" style="margin-right:0.03588em">ey</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.3802em"><span></span></span></span></span></span></span><span class="mord">.</span><span class="mord mathnormal">rc</span><span class="mord mathnormal">m</span></span></span></span> value is also drawn from the scalar field and is used to ensure that the commitment
to any UTXO or other sensitive data remains confidential. The commitment scheme in Nescience requires the use of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>p</mi><mi>r</mi><mi>i</mi><mi>v</mi><mi>a</mi><mi>t</mi><mi>e</mi></mrow><mrow><mi>k</mi><mi>e</mi><mi>y</mi></mrow></msub><mi mathvariant="normal">.</mi><mi>r</mi><mi>c</mi><mi>m</mi></mrow><annotation encoding="application/x-tex">{private}_{key}.rcm</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0398em;vertical-align:-0.3802em"></span><span class="mord"><span class="mord"><span class="mord mathnormal">p</span><span class="mord mathnormal" style="margin-right:0.02778em">r</span><span class="mord mathnormal">i</span><span class="mord mathnormal" style="margin-right:0.03588em">v</span><span class="mord mathnormal">a</span><span class="mord mathnormal">t</span><span class="mord mathnormal">e</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.242em"><span style="top:-2.4559em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em">k</span><span class="mord mathnormal mtight" style="margin-right:0.03588em">ey</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.3802em"><span></span></span></span></span></span></span><span class="mord">.</span><span class="mord mathnormal">rc</span><span class="mord mathnormal">m</span></span></span></span> to create cryptographic commitments
that bind the user to specific data (such as UTXO details) without revealing the actual data. The role of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>p</mi><mi>r</mi><mi>i</mi><mi>v</mi><mi>a</mi><mi>t</mi><mi>e</mi></mrow><mrow><mi>k</mi><mi>e</mi><mi>y</mi></mrow></msub><mi mathvariant="normal">.</mi><mi>r</mi><mi>c</mi><mi>m</mi></mrow><annotation encoding="application/x-tex">{private}_{key}.rcm</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0398em;vertical-align:-0.3802em"></span><span class="mord"><span class="mord"><span class="mord mathnormal">p</span><span class="mord mathnormal" style="margin-right:0.02778em">r</span><span class="mord mathnormal">i</span><span class="mord mathnormal" style="margin-right:0.03588em">v</span><span class="mord mathnormal">a</span><span class="mord mathnormal">t</span><span class="mord mathnormal">e</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.242em"><span style="top:-2.4559em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em">k</span><span class="mord mathnormal mtight" style="margin-right:0.03588em">ey</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.3802em"><span></span></span></span></span></span></span><span class="mord">.</span><span class="mord mathnormal">rc</span><span class="mord mathnormal">m</span></span></span></span> is to ensure that these commitments are
non-malleable and secure, preventing anyone from modifying the committed data without detection. For instance, when Alice commits to a UTXO, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>p</mi><mi>r</mi><mi>i</mi><mi>v</mi><mi>a</mi><mi>t</mi><mi>e</mi></mrow><mrow><mi>k</mi><mi>e</mi><mi>y</mi></mrow></msub><mi mathvariant="normal">.</mi><mi>r</mi><mi>c</mi><mi>m</mi></mrow><annotation encoding="application/x-tex">{private}_{key}.rcm</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0398em;vertical-align:-0.3802em"></span><span class="mord"><span class="mord"><span class="mord mathnormal">p</span><span class="mord mathnormal" style="margin-right:0.02778em">r</span><span class="mord mathnormal">i</span><span class="mord mathnormal" style="margin-right:0.03588em">v</span><span class="mord mathnormal">a</span><span class="mord mathnormal">t</span><span class="mord mathnormal">e</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.242em"><span style="top:-2.4559em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em">k</span><span class="mord mathnormal mtight" style="margin-right:0.03588em">ey</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.3802em"><span></span></span></span></span></span></span><span class="mord">.</span><span class="mord mathnormal">rc</span><span class="mord mathnormal">m</span></span></span></span> is used
to generate a Pedersen commitment that ensures the UTXO details are hidden but can still be verified cryptographically. This means that even though the actual UTXO details
Schnorr signatures that are used to authenticate transactions, ensuring that only the rightful owner of the private key can authorize the spending of UTXOs. Schnorr
signatures are important as they provide a secure and non-repudiable method of verifying that a transaction was initiated by the legitimate owner of the assets.
without revealing her private key. This verification process ensures that all transactions are legitimate and prevents unauthorized entities from forging transactions
private key is compromised. This resilience is achieved through the integrity of the spending key, which is never exposed in the process of signing or committing.
The spending key acts as the ultimate safeguard, ensuring that even if a private key component is compromised, the attacker cannot access or spend the user's assets
<p>The architecture’s design, where private keys handle operational tasks but rely on the spending key for ultimate control, ensures a layered approach to security.
This way, the system can mitigate the damage of a compromised private key by maintaining the inviolability of the user's assets.</p>
<p><strong>Conclusion</strong></p>
<p>In summary, the private key in Nescience consists of three interrelated components that together ensure secure transaction signing, commitment creation, and the
protection of user data. The <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>p</mi><mi>r</mi><mi>i</mi><mi>v</mi><mi>a</mi><mi>t</mi><mi>e</mi></mrow><mrow><mi>k</mi><mi>e</mi><mi>y</mi></mrow></msub><mi mathvariant="normal">.</mi><mi>r</mi><mi>s</mi><mi>d</mi></mrow><annotation encoding="application/x-tex">{private}_{key}.rsd</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0747em;vertical-align:-0.3802em"></span><span class="mord"><span class="mord"><span class="mord mathnormal">p</span><span class="mord mathnormal" style="margin-right:0.02778em">r</span><span class="mord mathnormal">i</span><span class="mord mathnormal" style="margin-right:0.03588em">v</span><span class="mord mathnormal">a</span><span class="mord mathnormal">t</span><span class="mord mathnormal">e</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.242em"><span style="top:-2.4559em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em">k</span><span class="mord mathnormal mtight" style="margin-right:0.03588em">ey</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.3802em"><span></span></span></span></span></span></span><span class="mord">.</span><span class="mord mathnormal">rs</span><span class="mord mathnormal">d</span></span></span></span> serves as the root from which the other key components are derived, ensuring randomness and security.
Together, these components enable users to engage in private, secure transactions while preserving the integrity of their assets, even in the face of potential key compromise.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="iii-public-keys">III. Public keys<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#iii-public-keys" class="hash-link" aria-label="Direct link to III. Public keys" title="Direct link to III. Public keys"></a></h3>
<p>Public keys in Nescience serve as the user's interface with the network, allowing for secure interaction and verification without exposing the user's private keys.
Derived directly from the user's private keys, public keys play a crucial role in enabling cryptographic operations such as transaction verification, commitment schemes,
and deterministic computations. The public key components correspond to their private key counterparts and ensure that transactions and commitments are securely processed
Schnorr signatures are used to authenticate transactions, ensuring that they have been signed by the legitimate owner of the private key. This public key is
essentially a verification key, allowing others in the network to confirm that a specific transaction was indeed authorized by the user. When a transaction is
needing access to the private key itself. This mechanism prevents forgeries as only the legitimate owner with access to the private key can generate a valid Schnorr signature.
that underpin Nescience’s privacy-preserving architecture. Commitments are a crucial cryptographic technique that allows users to commit to a piece of data (such as a UTXO)
where it functions as a public commitment to certain transaction details. Even though the actual values are hidden (thanks to the private key component), the commitment can
still be verified by other network participants using <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>p</mi><mi>u</mi><mi>b</mi><mi>l</mi><mi>i</mi><mi>c</mi></mrow><mrow><mi>k</mi><mi>e</mi><mi>y</mi></mrow></msub><mi mathvariant="normal">.</mi><mi>r</mi><mi>c</mi><mi>m</mi></mrow><annotation encoding="application/x-tex">{public}_{key}.rcm</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0747em;vertical-align:-0.3802em"></span><span class="mord"><span class="mord"><span class="mord mathnormal">p</span><span class="mord mathnormal">u</span><span class="mord mathnormal">b</span><span class="mord mathnormal" style="margin-right:0.01968em">l</span><span class="mord mathnormal">i</span><span class="mord mathnormal">c</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.242em"><span style="top:-2.4559em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em">k</span><span class="mord mathnormal mtight" style="margin-right:0.03588em">ey</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.3802em"><span></span></span></span></span></span></span><span class="mord">.</span><span class="mord mathnormal">rc</span><span class="mord mathnormal">m</span></span></span></span>. This enables secure and private transactions while maintaining the ability to verify that commitments
are consistent with the original data. For instance, when Alice commits to a UTXO, she uses her private key to generate the commitment, and the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>p</mi><mi>u</mi><mi>b</mi><mi>l</mi><mi>i</mi><mi>c</mi></mrow><mrow><mi>k</mi><mi>e</mi><mi>y</mi></mrow></msub><mi mathvariant="normal">.</mi><mi>r</mi><mi>c</mi><mi>m</mi></mrow><annotation encoding="application/x-tex">{public}_{key}.rcm</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0747em;vertical-align:-0.3802em"></span><span class="mord"><span class="mord"><span class="mord mathnormal">p</span><span class="mord mathnormal">u</span><span class="mord mathnormal">b</span><span class="mord mathnormal" style="margin-right:0.01968em">l</span><span class="mord mathnormal">i</span><span class="mord mathnormal">c</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.242em"><span style="top:-2.4559em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em">k</span><span class="mord mathnormal mtight" style="margin-right:0.03588em">ey</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.3802em"><span></span></span></span></span></span></span><span class="mord">.</span><span class="mord mathnormal">rc</span><span class="mord mathnormal">m</span></span></span></span> is available
to others to verify the commitment’s validity without revealing the underlying details.</p>
This PRF is essential for producing deterministic outputs based on the user’s keys and transaction data while ensuring that these outputs are unique to the user and cannot be
predicted or replicated by others. The PRF is crucial in scenarios where the user needs to derive unique identifiers or values that are tied to their specific account,
Nescience ensures that certain operations, like generating addresses or computing deterministic transaction outcomes, remain both private and cryptographically secure. The public key’s
role in this process is to maintain consistency in these outputs while preventing unauthorized parties from reverse engineering the associated private keys or transaction data.</p>
<p><strong>Summary</strong></p>
<p>Public keys in Nescience are essential for secure interactions within the network. "<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>p</mi><mi>u</mi><mi>b</mi><mi>l</mi><mi>i</mi><mi>c</mi></mrow><mrow><mi>k</mi><mi>e</mi><mi>y</mi></mrow></msub><mi mathvariant="normal">.</mi><mi>s</mi><mi>i</mi><mi>g</mi></mrow><annotation encoding="application/x-tex">{public}_{key}.sig</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0747em;vertical-align:-0.3802em"></span><span class="mord"><span class="mord"><span class="mord mathnormal">p</span><span class="mord mathnormal">u</span><span class="mord mathnormal">b</span><span class="mord mathnormal" style="margin-right:0.01968em">l</span><span class="mord mathnormal">i</span><span class="mord mathnormal">c</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.242em"><span style="top:-2.4559em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em">k</span><span class="mord mathnormal mtight" style="margin-right:0.03588em">ey</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.3802em"><span></span></span></span></span></span></span><span class="mord">.</span><span class="mord mathnormal">s</span><span class="mord mathnormal">i</span><span class="mord mathnormal" style="margin-right:0.03588em">g</span></span></span></span>" allows others to verify that transactions were signed by the legitimate owner,
and secure throughout various transactions. Together, these public key components facilitate privacy, security, and trust within NSSA, enabling seamless interactions while safeguarding user data.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="iv-viewing-key">IV. Viewing key<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#iv-viewing-key" class="hash-link" aria-label="Direct link to IV. Viewing key" title="Direct link to IV. Viewing key"></a></h3>
<p>The <strong>viewing key</strong> in NSSA is a specialized cryptographic key that allows a user to decrypt both incoming and outgoing transactions associated with their account.
This key is designed to offer a degree of transparency to the user, enabling them to view the details of their transactions without compromising the security of their assets or granting
<p><strong>Role of the viewing key</strong>: The primary function of the viewing key is to provide visibility into transaction details while maintaining the integrity of private, shielded,
or deshielded transactions. It enables the user to see the specifics of the transactions they are involved in—such as amounts transferred, asset types, and metadata—without
exposing the sensitive transaction data to the broader network. For instance, if Alice has executed a private transaction with Bob, her viewing key allows her to decrypt and
review the details of the transaction, ensuring that everything was processed correctly. This ability to audit her own transactions helps Alice maintain confidence in the integrity
of her private interactions on the blockchain.</p>
</li>
<li>
<p><strong>Security considerations</strong>: Despite its utility, the viewing key must be handled with care as its exposure could potentially compromise the user’s privacy.
Although possessing the viewing key does <strong>not</strong> provide the ability to spend or sign transactions (that authority remains strictly with the spending key and private keys),
it does allow anyone with access to the viewing key to decrypt the details of the user’s private transactions. This means that if the viewing key is leaked or stolen,
the privacy guarantees of Nescience’s private, shielded, and deshielded executions could be undermined. Specifically, the viewing key could be used to link various transactions,
breaking the unlinkability of private transactions. For example, an attacker with access to the viewing key could decrypt past and future transactions, exposing the relationships
between different parties and transaction flows. To mitigate this risk, Nescience recommends that users treat their viewing key with the same level of protection as their private keys.
It should be stored securely in encrypted hardware wallets or other secure storage solutions to prevent unauthorized access.</p>
</li>
<li>
<p><strong>Balancing privacy and transparency</strong>: The viewing key provides an essential balance between privacy and transparency in NSSA. While it ensures that users
can monitor their transaction history and verify the details of their private transactions, it does so without compromising the control of their funds. This allows users to maintain
a transparent view of their interactions while keeping their assets secure. For example, if Alice is using shielded execution to transfer assets, her viewing key enables her to
audit the transaction without allowing anyone else, including Bob or external observers, to see the specific details unless they also have access to the viewing key. Moreover,
since the viewing key does not grant signing or spending authority, even if it were exposed, an attacker would still not be able to manipulate the user’s assets. However,
to maintain the unlinkability and confidentiality of private transactions, the viewing key must be kept secure at all times.</p>
</li>
<li>
<p><strong>Protecting transaction unlinkability</strong>: In private transactions, unlinkability is one of the core privacy guarantees. This property ensures that individual
transactions cannot be correlated with each other or linked to the same user unless that user chooses to reveal the connection. The viewing key must be carefully
protected to preserve this unlinkability, as its compromise could allow someone to map out a user’s private transaction history. For instance, in deshielded transactions,
the viewing key allows the user to see which private UTXOs were consumed and how the public state was modified. If the viewing key is compromised, an attacker could potentially
link private UTXOs across multiple transactions, unraveling the user’s privacy.</p>
</li>
</ul>
<p><strong>Conclusion</strong></p>
<p>The viewing key in Nescience is a powerful tool for providing insight into both incoming and outgoing transactions without granting control over assets. It allows users
to decrypt and verify their transaction details, maintaining transparency in their interactions. However, due to its potential to compromise privacy if exposed, the viewing
key must be handled with great care. Proper security measures are necessary to protect the viewing key, ensuring that the unlinkability of private, shielded, and deshielded
transactions remains intact. In this way, the viewing key offers a crucial balance between privacy and transparency within the Nescience ecosystem.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="-v-ephemeral-key"><a id="key"></a> V. Ephemeral key<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#-v-ephemeral-key" class="hash-link" aria-label="Direct link to -v-ephemeral-key" title="Direct link to -v-ephemeral-key"></a></h3>
<p>The ephemeral key is generated using a combination of the sender’s spending key and the UTXO's nullifier, ensuring that the key is unique to each transaction.
The process can be informally described as follows:</p>
which is derived from the receiver’s private key, to compute an <strong>ephemeral secret key (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>e</mi><mi>s</mi><mi>k</mi></mrow><annotation encoding="application/x-tex">esk</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal">es</span><span class="mord mathnormal" style="margin-right:0.03148em">k</span></span></span></span>)</strong>. The computation is based on the nullifier <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ρ</mi></mrow><annotation encoding="application/x-tex">\rho</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal">ρ</span></span></span></span> and a base value:</li>
This formula binds the secret key to the specific transaction, leveraging the receiver’s cryptographic identity and the unique properties of the UTXO being spent.</p>
<ol start="2">
<li><strong>Deriving the ephemeral public key</strong><br>
<!-- -->After computing the ephemeral secret key (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>e</mi><mi>s</mi><mi>k</mi></mrow><annotation encoding="application/x-tex">esk</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal">es</span><span class="mord mathnormal" style="margin-right:0.03148em">k</span></span></span></span>), the next step is to derive the corresponding <strong>ephemeral public key (epk)</strong>. This is done using the Key Agreement
Protocol's <strong>DerivePublic algorithm</strong>, which generates the public key associated with the shared secret key. The ephemeral public key is computed as:</li>
<p>Here, (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi><mi>d</mi></mrow><annotation encoding="application/x-tex">gd</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">g</span><span class="mord mathnormal">d</span></span></span></span>) is the <strong>diversifier address</strong> associated with the receiver’s account. The diversifier address is computed from the receiver’s
account using the <strong>DiversifierHash</strong> function:</p>
<p>The diversifier (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi></mrow><annotation encoding="application/x-tex">d</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal">d</span></span></span></span>) is a random value selected by the sender to add randomness to the process. This diversifier ensures that even if a single receiver is involved
in multiple transactions, the derived keys remain distinct for each transaction. The value (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi></mrow><annotation encoding="application/x-tex">d</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal">d</span></span></span></span>) is included in the transaction note for transparency and reproducibility.</p>
<ol start="3">
<li><strong>Establishing the shared secret</strong><br>
<!-- -->The shared secret, used to encrypt the transaction details, is derived from the key agreement between the sender’s ephemeral key and the receiver’s viewing key.
Any party possessing the receiver’s viewing key can use it in conjunction with the ephemeral key to compute the shared secret, which is then used to decrypt the transaction.
This ensures that only the intended recipient (or anyone with their viewing key) can access the transaction details.</li>
</ol>
<p><strong>Key components and protocol</strong></p>
<p>The formal protocol for generating ephemeral keys closely follows this informal description but involves additional intermediate steps for converting values to
The protocol uses the following key components:</p>
<ul>
<li><strong>Nullifier (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ρ</mi></mrow><annotation encoding="application/x-tex">\rho</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal">ρ</span></span></span></span>):</strong> Ensures that the ephemeral key is tied to the specific UTXO being consumed, preventing reuse of the key in future transactions.</li>
<li><strong>Diversifier (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi></mrow><annotation encoding="application/x-tex">d</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal">d</span></span></span></span>):</strong> Adds randomness to the transaction, ensuring that keys remain unique across different transactions involving the same receiver.</li>
</ul>
<p>The end result is an ephemeral key system that provides strong cryptographic guarantees for transaction privacy, leveraging key agreement protocols and secure
cryptographic primitives to prevent unauthorized access to sensitive transaction data.</p>
<p><strong>Conclusion</strong></p>
<p>The ephemeral key in Nescience is a critical element for maintaining transaction confidentiality. It facilitates a secure key agreement between the sender and the receiver,
allowing for the encryption of transaction details with a shared secret that can only be derived by the intended recipient. By incorporating the nullifier, receiver's public key,
and diversifier address, the ephemeral key ensures that transaction privacy is preserved while preventing unauthorized access to transaction information, even in a complex,
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="vi-nescience-addresses">VI. Nescience addresses<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#vi-nescience-addresses" class="hash-link" aria-label="Direct link to VI. Nescience addresses" title="Direct link to VI. Nescience addresses"></a></h3>
<p>Nescience’s dual address system is a core component of its privacy-focused architecture, designed to balance transparency and confidentiality across different types of transactions.
The architecture provides each user or smart contract with both public addresses and private addresses, allowing them to participate in both open and confidential activities on the blockchain.</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="a-public-addresses">a) Public addresses<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#a-public-addresses" class="hash-link" aria-label="Direct link to a) Public addresses" title="Direct link to a) Public addresses"></a></h4>
<p>Public addresses in Nescience are visible to all participants on the network and reside within the public state. These addresses are essential for engaging in
transparent and verifiable interactions, such as sending tokens or invoking smart contracts that are meant to be publicly auditable. Public addresses serve as
the interface for users who need to engage with the transparent elements of the system, including public transactions or smart contracts that require public access.</p>
<p>They are analogous to traditional blockchain addresses seen in systems like Ethereum or Bitcoin, where every participant can see the address and the transactions associated with it.
For example, when Alice wants to receive tokens from Bob in a public transaction, she can provide her public address, allowing Bob to send the tokens transparently.
Anyone on the network can verify the transaction, providing accountability and trust in the public state.</p>
<p>Because public addresses are visible and auditable, they are typically used for interactions where privacy is not a concern or where transparency is desirable.
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="b-private-addresses">b) Private addresses<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#b-private-addresses" class="hash-link" aria-label="Direct link to b) Private addresses" title="Direct link to b) Private addresses"></a></h4>
<p>In contrast, private addresses are designed for confidentiality and are not visible onchain. These addresses are used exclusively for private transactions and executions,
ensuring that sensitive details—such as the sender, receiver, or amount transferred—remain hidden from the public state. Private addresses are a key feature of
Nescience’s private, shielded, and deshielded execution models, where preserving the confidentiality of participants is crucial.</p>
<p>Users can generate an unlimited number of private addresses using their private keys. This flexibility allows users to compartmentalize their interactions,
giving them the ability to provide different private addresses to different parties. For instance, Alice could create a unique private address for each entity
she interacts with, thereby ensuring that her transactions remain isolated and difficult to trace. This feature enhances privacy by preventing any direct linkage
between different transactions or activities associated with a single user.</p>
<p>Private addresses are not tied to the public state and are only accessible through the user’s private key infrastructure. Transactions involving private addresses
are conducted within the confines of the private state and are only decrypted by the intended participants. For example, when Alice sends tokens to Bob using
a private address, the details of that transaction remain confidential, accessible only to Alice and Bob, unless they choose to reveal it.</p>
<p><strong>Role of the viewing key in private addresses</strong>: A key feature of Nescience’s private address system is the viewing key, which allows users to decrypt any transaction
involving their private addresses. This capability provides oversight and transparency into the user’s private transactions, ensuring that they can monitor their own
activity without exposing the details to the public. The viewing key does not compromise the security of the user's assets as it does not grant spending or signing authority.
However, it does allow the user to audit and verify the accuracy of their private transactions, ensuring that everything proceeds as expected. For instance, Alice can use her
viewing key to review the details of a private transaction she conducted with Bob, ensuring that the correct amount was transferred and that the transaction was properly processed.
This functionality is critical for users who want to maintain control over their private interactions while still benefiting from transparency into their transaction history.
The ability to generate multiple private addresses and decrypt them with the viewing key ensures that users can maintain compartmentalized privacy without sacrificing oversight.</p>
<p><strong>Summary</strong></p>
<p>Nescience’s dual address system—comprising public and private addresses—provides users with the flexibility to engage in both transparent and confidential transactions.
Public addresses are visible onchain and are used for open, public interactions that require accountability and auditability. In contrast, private addresses are
invisible onchain and are used for confidential transactions, enhancing privacy and security.</p>
<p>By allowing users to generate multiple private addresses, Nescience gives individuals control over the visibility of their transactions. Combined with the viewing
key’s ability to decrypt transactions involving private addresses, the system ensures that users can maintain transparency over their private transactions without
exposing sensitive information to the public state. This dual-address approach enables users to seamlessly switch between public and private interactions depending on their needs,
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="vii-conclusion">VII. Conclusion<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#vii-conclusion" class="hash-link" aria-label="Direct link to VII. Conclusion" title="Direct link to VII. Conclusion"></a></h3>
The architecture’s hierarchical structure, with distinct roles for the spending key, private keys, and public keys, ensures that users retain full control
over their assets while maintaining the integrity of their transactions. The spending key, as the root of security, provides unassailable control over the
user's UTXOs and assets, ensuring that only the rightful owner can authorize spending. Private keys, derived from the spending key, enable users to engage
in cryptographic operations such as signing transactions and generating commitments without exposing sensitive information to the network.</p>
<p>The viewing key adds another layer of transparency, allowing users to decrypt and review their transactions without compromising their authority over their assets.
While it provides a window into transaction history, the viewing key does not grant spending power, preserving the critical separation between visibility and control.</p>
<p>The dual system of public and private addresses gives users the flexibility to navigate between open, transparent transactions and confidential, privacy-protected activities.
Public addresses allow users to engage in verifiable, public interactions while private addresses enable compartmentalized, secure transactions that remain hidden
from the public eye. This dual-address framework ensures that users can seamlessly adapt to different privacy requirements, whether they are participating in public
dapps or conducting sensitive financial operations.</p>
<p>Overall, Nescience’s cryptographic infrastructure is designed to empower users to engage confidently in both transparent and confidential activities.
By providing flexible, secure key management and address systems, Nescience ensures that users can fully participate in the blockchain ecosystem without
compromising their privacy or control. The architecture supports the nuanced needs of modern blockchain users, who require both the transparency of public
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="c-trees-in-nssa">c) Trees in NSSA<a href="https://research.logos.co/rlog/Nescience-state-separation-architecture#c-trees-in-nssa" class="hash-link" aria-label="Direct link to c) Trees in NSSA" title="Direct link to c) Trees in NSSA"></a></h2>
<p>Trees in NSSA serve as verifiable databases, essential for maintaining privacy and security. Different types of trees are used for various purposes:</p>
<ol>
<li>
<p><strong>Global state tree:</strong> The global state tree is a single, public tree that holds all public assets and storage information. It acts as a central repository for all
publicly accessible data on the blockchain. By organizing this data in a Merkle tree structure, the Global State Tree allows for efficient and secure verification of public information.</p>
</li>
<li>
<p><strong>Hashed UTXO tree:</strong> The hashed UTXO tree is a public tree that contains hashes of all created UTXOs. When users wish to consume a UTXO, they provide a membership
proof to demonstrate that the UTXO exists within this tree. This process ensures that only valid and existing UTXOs can be spent, maintaining the integrity of transactions.
In fact, users generate membership proofs that verify the presence of specific UTXOs in the tree without revealing their actual data. The benefit here is that the Merkle
tree structure allows for quick and efficient verification of UTXO existence.</p>
</li>
<li>
<p><strong>UTXO trees (private states):</strong> Each user or smart contract has its private state stored in UTXO trees. These trees are kept as plaintext on the client’s
local system (off-chain), ensuring privacy as sensitive information remains confidential. The private state includes all UTXOs owned by the user or the smart contract, and these
are not directly exposed to the public blockchain. For instance, users have full control over their private state, which is not visible to other participants in the network.</p>
</li>
</ol>
<p>In conclusion, the tree structures enable efficient verification of transaction validity without compromising privacy. By using Merkle trees,
Nescience ensures that any tampering with the data can be easily detected. The efficient structure of these trees supports the scalability of the architecture,
allowing it to handle a large number of transactions and data entries. By leveraging different types of trees, Nescience ensures efficient and secure management
<p>##<a id="nul"></a> d) Nullifier tree in Nescience</p>
<p>The <strong>nullifier tree</strong> is a fundamental component of NSSA, designed to prevent double spending by securely tracking all consumed UTXOs.
This tree acts as a public ledger of spent UTXOs, ensuring that once a UTXO is consumed in a transaction, it cannot be reused in future transactions.</p>
<p>The primary function of the nullifier Tree is to store the <strong>nullifiers</strong> of all consumed UTXOs. By recording the nullifiers in a public tree,
the system ensures that each UTXO is spent only once, thereby safeguarding the integrity of the entire network.</p>
<ul>
<li>
<p><strong>Ensuring non-membership and preventing double spending</strong>
Before a user can consume a UTXO in a transaction, they must provide a <strong>non-membership proof</strong>. This proof demonstrates that the UTXO’s nullifier
does not already exist in the Nullifier Tree, proving that the UTXO has not been spent before. If the UTXO’s nullifier is found in the tree,
the system will reject the transaction, preventing double spending. The non-membership proof ensures that users cannot attempt to spend the
same UTXO in multiple transactions. This mechanism is critical for maintaining the security and reliability of NSSA.
The tree structure, which is typically built using a cryptographic tree like a Merkle tree, allows for efficient verification of nullifiers.
The nullifier tree is likely structured as a <strong>Merkle tree</strong>, which is a cryptographic binary tree where each node represents the hash of its child nodes.
This structure allows for efficient storage and verification of large sets of nullifiers as only the root hash of the tree needs to be stored on the blockchain.
When a new nullifier is added to the tree, the tree is recalculated, and the root hash is updated. This process ensures that all consumed UTXOs are securely recorded.
Each time a transaction consumes a UTXO, the nullifier is added to the Nullifier Tree, and the tree is updated to reflect this new entry. To verify that a
UTXO has not been double spent, verifiers can use the tree’s root hash and a proof of inclusion or exclusion (membership or non-membership proof) to check whether the
nullifier is present in the tree. For example, if Alice wants to spend a UTXO, she must prove that the nullifier associated with that UTXO is not already in the Nullifier Tree.
She generates a non-membership proof that shows her nullifier is not recorded in the tree, and the transaction is allowed to proceed. Once the transaction is completed,
The Nullifier Tree is a crucial element of Nescience's security. By recording all consumed UTXOs and ensuring that nullifiers are unique, the tree prevents double spending
and maintains the integrity of the blockchain. The non-membership proof mechanism guarantees that every transaction is validated against the tree. This structure supports
<p>The development of the zk-zkVM in Nescience is a work in progress, as the architecture continues to evolve to support privacy-preserving transactions
proven zkVM technologies while enhancing them with the unique privacy and state-separation capabilities that Nescience requires.</p>
<ul>
<li>
<p><strong>Privacy-preserving features</strong>: At its core, the zk-zkVM is designed with privacy in mind. One of the zk-zkVM’s standout privacy features is <strong>selective disclosure</strong>,
which allows users to reveal only specific details of a transaction as needed. For example, a user could disclose the transaction amount while concealing the identities
of the participants. The zk-zkVM employs advanced encryption techniques to protect this sensitive data. All transaction data is encrypted before being stored on the blockchain,
so even if the data is intercepted, it cannot be deciphered without the appropriate decryption keys. Another of the crucial privacy-preserving features is the support
for <strong>confidential transactions</strong>. Only the parties involved in the transaction can access the encrypted data. Furthermore, the zk-zkVM supports <strong>verifiable encryption</strong>,
a powerful capability that allows encrypted data to be included in ZKPs without needing to decrypt it. This ensures that transaction details remain private
<p><strong>Lightweight design for accessibility</strong>: The zk-zkVM is being designed to be lightweight and efficient, enabling it to run on standard consumer-grade hardware.
This makes it accessible to a wide range of users without requiring specialized equipment or significant computational resources.</p>
</li>
<li>
<p><strong>Faster proving time</strong>: To maintain a seamless user experience, especially during high transaction volumes, the zk-zkVM is being optimized for <strong>fast proving times</strong>.
Fast proof generation is particularly important for ensuring that the system remains usable during periods of peak activity, preventing bottlenecks and maintaining the fluidity of the network.</p>
</li>
<li>
<p><strong>Recursive-friendly operations</strong>: One of the most advanced features of the zk-zkVM will be its support for <strong>recursive operations</strong>. Recursion enables the aggregation
of multiple proofs into a single proof, improving efficiency on both the client and sequencer sides of the network.</p>
</li>
<li>
<p><strong>Client-side recursion (batch processing):</strong> When a single transaction involves multiple executions, each requiring its own ZKP, these individual
proofs can be recursively aggregated before being sent to the sequencer. This reduces the overall data transmitted, enhancing the efficiency of the transaction process
by compressing multiple proofs into a single package.</p>
</li>
<li>
<p><strong>Sequencer-side recursion (reduced redundancy):</strong> The sequencer, which is responsible for processing transactions and creating verifiable blocks, collects transactions
containing aggregated proofs. These proofs are further merged into a single comprehensive proof, ensuring that all transactions within a block are validated collectively.
This process reduces redundancy and optimizes the blockchain’s efficiency by minimizing the size and complexity of the proofs required for verification.</p>
</li>
<li>
<p><strong>Developer-friendly language</strong>: To foster widespread adoption and innovation within the Nescience ecosystem, the zk-zkVM would include a <strong>developer-friendly language</strong>.
This high-level language simplifies the process of building applications that leverage state separation and privacy-preserving transactions. The language should offer extensive
support for modular design, APIs, and SDKs, enabling developers to integrate their applications with the zk-zkVM more easily. By lowering the barrier to entry, Nescience encourages
innovation and helps expand the range of privacy-preserving applications that can be built on its platform.</p>
</li>
</ul>
<p><strong>Conclusion</strong></p>
<p>The zk-zkVM in Nescience is a powerful and versatile virtual machine that embodies the principles of privacy, efficiency, and scalability. By supporting ZKPs
and integrating with advanced privacy technologies like homomorphic encryption. Its lightweight design allows it to run efficiently on standard hardware, promoting decentralization,
and its recursive operations further enhance the system's scalability. With its developer-friendly language and fast proving times, the zk-zkVM is positioned as a key component in
<p>Nescience is developing an <strong>MPC-based</strong> synchronization mechanism to balance privacy and fairness between public and private execution types.
This mechanism extracts common information from encrypted UTXOs without revealing private details, ensuring privacy and preventing UTXO linkage to users or specific transactions.
to secure data during synchronization. This ensures a consistent and fair environment for all users, regardless of their chosen privacy level. Currently,
One of the primary goals is to integrate the <strong>zk-zkVM</strong> and the <strong>Nescience state-separation architecture</strong> into a fully functioning node,
enabling efficient private transactions while maintaining network integrity.</p>
<ul>
<li><strong>Addressing scalability challenges</strong>: A key challenge facing Nescience is the increasing size of nullifier and hashed UTXO trees, which could impact
network performance and scalability over time. To mitigate this, Nescience plans to adopt state-of-the-art scalable privacy techniques such as:<!-- -->
<ul>
<li><strong>Mutator sets:</strong> Dynamically adjusting data structures to manage the growth of the nullifier set efficiently.</li>
<li><strong>SNARK-based accumulators:</strong> Compressing data in a verifiable way to ensure that only relevant information is stored while maintaining cryptographic security.</li>
<li><strong>Pruning techniques:</strong> Periodically trimming unnecessary data from trees to maintain optimal size and performance, ensuring that the network scales logarithmically
rather than exponentially as more transactions occur.</li>
</ul>
</li>
</ul>
<p>By implementing these approaches, Nescience aims to keep the size of its data structures manageable, ensuring that scalability does not come at the cost of performance or privacy.</p>
<ul>
<li>
<p><strong>Enhanced key management</strong>: Another critical focus for Nescience is improving key management to streamline operations and enhance security.
The plan is to integrate the different keys used for signatures, addresses, UTXO encryption, and SNARK verification into a unified system.
This integration will simplify key management for users while reducing the risk of security breaches caused by complex, disparate key systems.
Nescience also plans to implement <strong>Hierarchical Deterministic (HD) keys</strong>, which allow users to derive multiple keys from a single seed,
enhancing both security and usability. This approach reduces the complexity of managing multiple keys across various functions and provides an additional
layer of protection for private transactions. Additionally, <strong>multi-signature schemes</strong> will be introduced, requiring multiple parties to authorize transactions.
This feature increases security by reducing the likelihood of unauthorized access, ensuring that a single compromised key cannot lead to malicious transactions.</p>
</li>
<li>
<p><strong>Integrating advanced cryptographic techniques</strong>: Nescience will integrate advanced cryptographic techniques, enhancing both privacy and scalability. Among these are:</p>
<ul>
<li><strong>Homomorphic encryption:</strong> Allowing computations to be performed on encrypted data without the need to decrypt it, preserving privacy while enabling secure, complex data processing.</li>
<li><strong>Zero-knowledge rollups:</strong> Bundling multiple transactions into a single proof to reduce the amount of data processed and stored on the blockchain,
significantly improving scalability without sacrificing security.</li>
</ul>
</li>
</ul>
<p>These cryptographic enhancements will ensure that Nescience can support a growing network while continuing to protect user privacy and maintaining high transaction throughput.</p>
<ul>
<li><strong>Long-term vision</strong></li>
</ul>
<p>The ultimate goal for Nescience is to deploy a fully operational <strong>node powered by zk-zkVM</strong> and the <strong>Nescience state-separation architecture</strong>.
Nescience aims to provide users with an infrastructure that balances privacy, security, and efficiency, ensuring the network remains resilient and capable of handling future demands.</p>
<p>By pursuing these future plans, Nescience is poised to not only address current challenges around scalability and key management but also lead the way in
applying advanced cryptography to decentralized systems. This vision will help secure the long-term integrity and performance of the Nescience state-separation
<p>[1] Nakamoto, S. (2008). Bitcoin: A Peer-to-Peer Electronic Cash System. Retrieved from <a href="https://bitcoin.org/bitcoin.pdf" target="_blank" rel="noopener noreferrer">https://bitcoin.org/bitcoin.pdf</a></p>
<p>[2] Sanchez, F. (2021). Cardano’s Extended UTXO accounting model. Retrieved from <a href="https://iohk.io/en/blog/posts/2021/03/11/cardanos-extended-utxo-accounting-model/" target="_blank" rel="noopener noreferrer">https://iohk.io/en/blog/posts/2021/03/11/cardanos-extended-utxo-accounting-model/</a></p>
<p>[3] Morgan, D. (2020). HD Wallets Explained: From High Level to Nuts and Bolts. Retrieved from <a href="https://medium.com/mycrypto/the-journey-from-mnemonic-phrase-to-address-6c5e86e11e14" target="_blank" rel="noopener noreferrer">https://medium.com/mycrypto/the-journey-from-mnemonic-phrase-to-address-6c5e86e11e14</a></p>
<p>[4] Wuille, P. (2012). Bitcoin Improvement Proposal (BIP) 32. Retrieved from <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank" rel="noopener noreferrer">https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki</a></p>
<p>[5] Sin7y Tech Review (29): Design Principles of Private Transactions in Aleo & Zcash. Retrieved from <a href="https://hackmd.io/@sin7y/rkxFXLkgs" target="_blank" rel="noopener noreferrer">https://hackmd.io/@sin7y/rkxFXLkgs</a></p>
<p>[6] Sin7y Tech Review (33): Principles of private transactions and regulatory compliance issues. Retrieved from <a href="https://hackmd.io/@sin7y/S16RyFzZn" target="_blank" rel="noopener noreferrer">https://hackmd.io/@sin7y/S16RyFzZn</a></p>
<p>[8] Anatomy of a Zcash Transaction. Retrieved from <a href="https://electriccoin.co/blog/anatomy-of-zcash" target="_blank" rel="noopener noreferrer">https://electriccoin.co/blog/anatomy-of-zcash</a></p>
<p>[9] The Penumbra Protocol: Notes, Nullifiers, and Trees. Retrieved from <a href="https://protocol.penumbra.zone/main/concepts/notes_nullifiers_trees.html" target="_blank" rel="noopener noreferrer">https://protocol.penumbra.zone/main/concepts/notes_nullifiers_trees.html</a></p>
<p>[11] What's a Sparse Merkle tree?. Retrieved from <a href="https://medium.com/@kelvinfichter/whats-a-sparse-merkle-tree-acda70aeb837" target="_blank" rel="noopener noreferrer">https://medium.com/@kelvinfichter/whats-a-sparse-merkle-tree-acda70aeb837</a></p>
<p>[12] Lecture 10: Accounts Model and Merkle Trees. Retrieved from <a href="https://web.stanford.edu/class/ee374/lec_notes/lec10.pdf" target="_blank" rel="noopener noreferrer">https://web.stanford.edu/class/ee374/lec_notes/lec10.pdf</a></p>
<p>[13] The UTXO vs Account Model. Retrieved from <a href="https://www.horizen.io/academy/utxo-vs-account-model/" target="_blank" rel="noopener noreferrer">https://www.horizen.io/academy/utxo-vs-account-model/</a></p>
<p>[14] Addresses and Value Pools in Zcash. Retrieved from <a href="https://zcash.readthedocs.io/en/latest/rtd_pages/addresses.html" target="_blank" rel="noopener noreferrer">https://zcash.readthedocs.io/en/latest/rtd_pages/addresses.html</a></p>]]></content:encoded>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="membership-with-bloom-filters-and-cuckoo-filters">Membership with Bloom Filters and Cuckoo Filters<a href="https://research.logos.co/rlog/vac101-membership-with-bloom-filters-and-cuckoo-filters#membership-with-bloom-filters-and-cuckoo-filters" class="hash-link" aria-label="Direct link to Membership with Bloom Filters and Cuckoo Filters" title="Direct link to Membership with Bloom Filters and Cuckoo Filters"></a></h2>
In certain applications, it is more important to output a result quickly than to have a 'perfect' result.
In particular, false positives may be an acceptable tradeoff for speed.
In this blog, we examine <a href="https://dl.acm.org/doi/10.1145/362686.362692" target="_blank" rel="noopener noreferrer">Bloom</a> and <a href="https://www.cs.cmu.edu/~dga/papers/cuckoo-conext2014.pdf" target="_blank" rel="noopener noreferrer">Cuckoo</a> data filters.
That is, it is sufficient to have a probabilistic check for membership.</p>
<p><strong>Bloom filters</strong> and <strong>Cuckoo filters</strong> are data structures that can be used to accumulate data with a fixed amount of space.
The associated filter <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>F</mi></mrow><annotation encoding="application/x-tex">F</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.13889em">F</span></span></span></span> for a digest of data <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> can be queried to determine whether an element is (possibly) a member of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span>:</p>
<ul>
<li><strong>0:</strong> The queried element is definitely not a member of digest <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span>.</li>
<li><strong>1:</strong> The entry is possibly a member of the digest <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span>.</li>
</ul>
<p>The algorithms associated with Bloom filters and Cuckoo filters, which we will discuss shortly, are deterministic.
The possibility of false positives arises from the query algorithm.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="bloom-filters">Bloom filters<a href="https://research.logos.co/rlog/vac101-membership-with-bloom-filters-and-cuckoo-filters#bloom-filters" class="hash-link" aria-label="Direct link to Bloom filters" title="Direct link to Bloom filters"></a></h2>
We note that each hash function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>h</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">h_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8444em;vertical-align:-0.15em"></span><span class="mord"><span class="mord mathnormal">h</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em"><span></span></span></span></span></span></span></span></span></span> is used to determine an index of our binary string <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">v</mi></mrow><annotation encoding="application/x-tex">{\bf{v}}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4444em"></span><span class="mord"><span class="mord"><span class="mord"><span class="mord mathbf" style="margin-right:0.01597em">v</span></span></span></span></span></span></span> to flip the associated bit to 1.
The binary string <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">v</mi></mrow><annotation encoding="application/x-tex">{\bf{v}}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4444em"></span><span class="mord"><span class="mord"><span class="mord"><span class="mord mathbf" style="margin-right:0.01597em">v</span></span></span></span></span></span></span> is initialized with every entry as 0.
The hash functions do not need to be cryptographic hash functions.</p>
<ul>
<li>
<p><strong>Append:</strong> Suppose that we wish to add the element <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">x</span></span></span></span> to the Bloom filter.</p>
<p><strong>Query:</strong> Suppose that we wish to query the Bloom filter for element <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">y</span></span></span></span>.</p>
<p>The algorithm <strong>Query</strong> will output 1 for every element <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">y</span></span></span></span> that has been added to the Bloom filter.
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="complexity">Complexity<a href="https://research.logos.co/rlog/vac101-membership-with-bloom-filters-and-cuckoo-filters#complexity" class="hash-link" aria-label="Direct link to Complexity" title="Direct link to Complexity"></a></h3>
<p>The storage of a Bloom filter requires constant space.
Specifically, the Bloom filter uses <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span> bits regardless of the size of the digest.
So, regardless of the number of elements that we append, the Bloom filter will use <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span> bits.
Further, if we assume that each of the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal" style="margin-right:0.03148em">k</span></span></span></span> hash functions runs in constant time, then we can append/query an entry in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>O</mi><mo stretchy="false">(</mo><mi>k</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">O(k)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord mathnormal" style="margin-right:0.02778em">O</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03148em">k</span><span class="mclose">)</span></span></span></span>.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="example">Example<a href="https://research.logos.co/rlog/vac101-membership-with-bloom-filters-and-cuckoo-filters#example" class="hash-link" aria-label="Direct link to Example" title="Direct link to Example"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="probability-of-false-positives">Probability of false positives<a href="https://research.logos.co/rlog/vac101-membership-with-bloom-filters-and-cuckoo-filters#probability-of-false-positives" class="hash-link" aria-label="Direct link to Probability of false positives" title="Direct link to Probability of false positives"></a></h3>
<p>For our analysis, we will assume that the probabilities that arise in our analysis are independent.
However, this assumption can be removed to gain the same approximation.</p>
<p>We note that for a single hash function, the probability that a specific bit is flipped to 1 is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mi>n</mi></mrow><annotation encoding="application/x-tex">1/n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord">1/</span><span class="mord mathnormal">n</span></span></span></span>.
So, the probability that the specific bit is not flipped by the hash function is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>−</mo><mn>1</mn><mi mathvariant="normal">/</mi><mi>n</mi></mrow><annotation encoding="application/x-tex">1-1/n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em"></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord">1/</span><span class="mord mathnormal">n</span></span></span></span>.
Applying our assumption that the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal" style="margin-right:0.03148em">k</span></span></span></span> hash functions are 'independent,'
That is, as we increase the number of bits that our Bloom filter uses, the approximate probability that a given bit is not flipped by any of the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal" style="margin-right:0.03148em">k</span></span></span></span> hash functions is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>e</mi><mrow><mo>−</mo><mi>k</mi><mi mathvariant="normal">/</mi><mi>n</mi></mrow></msup></mrow><annotation encoding="application/x-tex">e^{-k/n}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.888em"></span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.888em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">−</span><span class="mord mathnormal mtight" style="margin-right:0.03148em">k</span><span class="mord mtight">/</span><span class="mord mathnormal mtight">n</span></span></span></span></span></span></span></span></span></span></span></span>.</p>
<p>Suppose that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">ℓ</mi></mrow><annotation encoding="application/x-tex">\ell</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord">ℓ</span></span></span></span> entries have been added to the Bloom filter.
The probability that a specific bit is still 0 after the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">ℓ</mi></mrow><annotation encoding="application/x-tex">\ell</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord">ℓ</span></span></span></span> entries have been added is approximately <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>e</mi><mrow><mo>−</mo><mi mathvariant="normal">ℓ</mi><mi>k</mi><mi mathvariant="normal">/</mi><mi>n</mi></mrow></msup></mrow><annotation encoding="application/x-tex">e^{-\ell k/n}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.888em"></span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.888em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">−</span><span class="mord mtight">ℓ</span><span class="mord mathnormal mtight" style="margin-right:0.03148em">k</span><span class="mord mtight">/</span><span class="mord mathnormal mtight">n</span></span></span></span></span></span></span></span></span></span></span></span>.
<p>Notice that the probability of false positives increases as the number of elements (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">ℓ</mi></mrow><annotation encoding="application/x-tex">\ell</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord">ℓ</span></span></span></span>) that have been added to the digest increases.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="sliding-window-bloom-filter">Sliding-Window Bloom filter<a href="https://research.logos.co/rlog/vac101-membership-with-bloom-filters-and-cuckoo-filters#sliding-window-bloom-filter" class="hash-link" aria-label="Direct link to Sliding-Window Bloom filter" title="Direct link to Sliding-Window Bloom filter"></a></h3>
<p>Our toy example and table illustrated an issue concerning Bloom filters.
The number of entries that can be added to a Bloom filter is restricted by our choice of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal" style="margin-right:0.03148em">k</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span>.
but it is possible that our vector <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">v</mi></mrow><annotation encoding="application/x-tex">{\bf{v}}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4444em"></span><span class="mord"><span class="mord"><span class="mord"><span class="mord mathbf" style="margin-right:0.01597em">v</span></span></span></span></span></span></span> can be a string of all 1s.
<a href="https://eprint.iacr.org/2023/1208.pdf" target="_blank" rel="noopener noreferrer">Szepieniec and Værge</a> proposed a modification to Bloom filters to handle this.</p>
<p>Instead of having a fixed number of bits for our Bloom filter, we dynamically allot memory based on the number of entries that have been added to the filter.
Given a predetermined threshold (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal">b</span></span></span></span>) for the number of entries, we shift our 'window' of flipping bits by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">s</span></span></span></span> bits.
This means that querying the Sliding-Window Bloom filter will yield different results when different timestamps are used.</p>
<p>This can be done with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal" style="margin-right:0.03148em">k</span></span></span></span> hash functions as we used earlier.
Alternatively, Szepieniec and Værge proposed using the same hash function but to produce <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal" style="margin-right:0.03148em">k</span></span></span></span> entries in the current window.
Specifically, we obtain the bits we wish to flip to 1s by computing <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>h</mi><mo stretchy="false">(</mo><mi>X</mi><mi mathvariant="normal">∣</mi><mi mathvariant="normal">∣</mi><mi>i</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">h(X || i)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord mathnormal">h</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.07847em">X</span><span class="mord">∣∣</span><span class="mord mathnormal">i</span><span class="mclose">)</span></span></span></span> for each <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>i</mi><mo>∈</mo><mo stretchy="false">{</mo><mn>0</mn><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><mi>k</mi><mo>−</mo><mn>1</mn><mo stretchy="false">}</mo></mrow><annotation encoding="application/x-tex">i \in \{0,\dots, k-1\}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6986em;vertical-align:-0.0391em"></span><span class="mord mathnormal">i</span><span class="mspace" style="margin-right:0.2778em"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mopen">{</span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em"></span><span class="minner">…</span><span class="mspace" style="margin-right:0.1667em"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em"></span><span class="mord mathnormal" style="margin-right:0.03148em">k</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mord">1</span><span class="mclose">}</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi></mrow><annotation encoding="application/x-tex">X</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07847em">X</span></span></span></span> as we will define next.
For Sliding-Window Bloom filters, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi></mrow><annotation encoding="application/x-tex">X</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07847em">X</span></span></span></span> is more than just the element we wish to append to the filter.
Instead, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi></mrow><annotation encoding="application/x-tex">X</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07847em">X</span></span></span></span> consists of the element <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">x</span></span></span></span> and a timestamp <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi></mrow><annotation encoding="application/x-tex">t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6151em"></span><span class="mord mathnormal">t</span></span></span></span>.
The timestamp <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi></mrow><annotation encoding="application/x-tex">t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6151em"></span><span class="mord mathnormal">t</span></span></span></span> is used to locate the correct window for bits, as we see below:</p>
<ul>
<li>
<p><strong>Append:</strong> Suppose that we wish to add the element <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">x</span></span></span></span> with timestamp <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi></mrow><annotation encoding="application/x-tex">t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6151em"></span><span class="mord mathnormal">t</span></span></span></span> to the Sliding-Window Bloom filter.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="cuckoo-filters">Cuckoo filters<a href="https://research.logos.co/rlog/vac101-membership-with-bloom-filters-and-cuckoo-filters#cuckoo-filters" class="hash-link" aria-label="Direct link to Cuckoo filters" title="Direct link to Cuckoo filters"></a></h2>
If the maximum number of entries that a Cuckoo filter can hold is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">n</span></span></span></span> and a fingerprint occupies <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi></mrow><annotation encoding="application/x-tex">f</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.10764em">f</span></span></span></span> bits,
<p><strong>Append:</strong> Suppose that we wish to add the element <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">x</span></span></span></span> to the Cuckoo filter.</p>
In the case that we have a fingerprint that cannot be inserted, then the Cuckoo filter is overfilled.</li>
</ul>
</li>
<li>
<p><strong>Query:</strong> Suppose that we wish to query the Cuckoo filter for element <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">y</span></span></span></span>.</p>
<p><strong>Delete:</strong> Suppose that we wish to delete the element <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.03588em">y</span></span></span></span> from the Cuckoo filter.</p>
<p>We note that false positives in Cuckoo filters only occur when an element shares a fingerprint and hash with a value that has already been added to the Cuckoo filter.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="example-1">Example<a href="https://research.logos.co/rlog/vac101-membership-with-bloom-filters-and-cuckoo-filters#example-1" class="hash-link" aria-label="Direct link to Example" title="Direct link to Example"></a></h3>
<p>In this example, we will append the words <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mi>d</mi><mi>d</mi></mrow><annotation encoding="application/x-tex">add</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal">a</span><span class="mord mathnormal">dd</span></span></span></span>, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mi>u</mi><mi>m</mi></mrow><annotation encoding="application/x-tex">sum</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">s</span><span class="mord mathnormal">u</span><span class="mord mathnormal">m</span></span></span></span>, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>e</mi><mi>q</mi><mi>u</mi><mi>a</mi><mi>l</mi></mrow><annotation encoding="application/x-tex">equal</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em"></span><span class="mord mathnormal">e</span><span class="mord mathnormal" style="margin-right:0.03588em">q</span><span class="mord mathnormal">u</span><span class="mord mathnormal">a</span><span class="mord mathnormal" style="margin-right:0.01968em">l</span></span></span></span> to a Cuckoo filter with 8 slots.</p>
<p>For each word <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">x</span></span></span></span>, we compute two indices:
<p>Notice that both of the buckets (2 and 5) that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>e</mi><mi>q</mi><mi>u</mi><mi>a</mi><mi>l</mi></mrow><annotation encoding="application/x-tex">equal</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em"></span><span class="mord mathnormal">e</span><span class="mord mathnormal" style="margin-right:0.03588em">q</span><span class="mord mathnormal">u</span><span class="mord mathnormal">a</span><span class="mord mathnormal" style="margin-right:0.01968em">l</span></span></span></span> can map to are occupied.
So, we select one of these buckets (say 2) to insert <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>e</mi><mi>q</mi><mi>u</mi><mi>a</mi><mi>l</mi></mrow><annotation encoding="application/x-tex">equal</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em"></span><span class="mord mathnormal">e</span><span class="mord mathnormal" style="margin-right:0.03588em">q</span><span class="mord mathnormal">u</span><span class="mord mathnormal">a</span><span class="mord mathnormal" style="margin-right:0.01968em">l</span></span></span></span> into.
Then, we have to insert <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mi>d</mi><mi>d</mi></mrow><annotation encoding="application/x-tex">add</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em"></span><span class="mord mathnormal">a</span><span class="mord mathnormal">dd</span></span></span></span> to its possible bucket (1).
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="complexity-1">Complexity<a href="https://research.logos.co/rlog/vac101-membership-with-bloom-filters-and-cuckoo-filters#complexity-1" class="hash-link" aria-label="Direct link to Complexity" title="Direct link to Complexity"></a></h3>
<p>Notice that deletions and queries to Cuckoo filters are done in constant time.
Specifically, only two locations need to be checked for any data <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em"></span><span class="mord mathnormal">x</span></span></span></span>.
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="bloom-filters-vs-cuckoo-filters">Bloom filters vs Cuckoo filters<a href="https://research.logos.co/rlog/vac101-membership-with-bloom-filters-and-cuckoo-filters#bloom-filters-vs-cuckoo-filters" class="hash-link" aria-label="Direct link to Bloom filters vs Cuckoo filters" title="Direct link to Bloom filters vs Cuckoo filters"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="combining-filters-with-rln">Combining Filters with RLN<a href="https://research.logos.co/rlog/vac101-membership-with-bloom-filters-and-cuckoo-filters#combining-filters-with-rln" class="hash-link" aria-label="Direct link to Combining Filters with RLN" title="Direct link to Combining Filters with RLN"></a></h2>
In <a href="https://research.logos.co/rlog/rln-light-verifiers" target="_blank" rel="noopener noreferrer">Verifying RLN Proofs in Light Clients with Subtrees</a>,
The two <a href="https://rate-limiting-nullifier.github.io/rln-docs/rln_in_details.html" target="_blank" rel="noopener noreferrer">parts of RLN</a> that we will focus on are user registration and deletion.</p>
<p>Both Bloom and Cuckoo filters support user registration as this is can be done as an append.
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="references">References<a href="https://research.logos.co/rlog/vac101-membership-with-bloom-filters-and-cuckoo-filters#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References"></a></h3>
<li><a href="https://eprint.iacr.org/2023/1208" target="_blank" rel="noopener noreferrer">Mutator Sets and their Application to Scalable Privacy</a></li>
<li><a href="https://www.cs.cmu.edu/~dga/papers/cuckoo-conext2014.pdf" target="_blank" rel="noopener noreferrer">Cuckoo Filter: Practically Better than Bloom</a></li>
<li><a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention" target="_blank" rel="noopener noreferrer">Strengthening Anonymous DoS Prevention with Rate Limiting Nullifiers in Waku</a></li>
<li><a href="https://research.logos.co/rlog/rln-v3/" target="_blank" rel="noopener noreferrer">RLN-v3: Towards a Flexible and Cost-Efficient Implementation</a></li>
<li><a href="https://research.logos.co/rlog/rln-light-verifiers" target="_blank" rel="noopener noreferrer">Verifying RLN Proofs in Light Clients with Subtrees</a></li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="introduction">Introduction<a href="https://research.logos.co/rlog/rln-v3#introduction" class="hash-link" aria-label="Direct link to Introduction" title="Direct link to Introduction"></a></h2>
Other participants can choose different time intervals fitting their specific needs.</p>
<p>Practically, this is <code>x msg/y seconds</code></p>
</li>
</ul>
<p>RLN-v3 allows higher flexibility and ease of payment/stake for users who have more predictable usage patterns and therefore,
more predictable bandwidth usage on a p2p network (Waku, etc.).</p>
<p>For example:</p>
<ul>
<li>An AMM that broadcasts bids, asks, and fills over Waku may require a lot of throughput in the smallest epoch possible and hence may register an RLN-v3 membership of <code>10000 msg/1 second</code>.
They could do this with RLN-v2, too.</li>
<li>Alice, a casual user of a messaging app built on Waku, who messages maybe 3-4 people infrequently during the day, may register an RLN-v3 membership of <code>100 msg/hour</code>,
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="theory">Theory<a href="https://research.logos.co/rlog/rln-v3#theory" class="hash-link" aria-label="Direct link to Theory" title="Direct link to Theory"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="modification-to-leaves-set-in-the-membership-merkle-tree">Modification to leaves set in the membership Merkle tree<a href="https://research.logos.co/rlog/rln-v3#modification-to-leaves-set-in-the-membership-merkle-tree" class="hash-link" aria-label="Direct link to Modification to leaves set in the membership Merkle tree" title="Direct link to Modification to leaves set in the membership Merkle tree"></a></h3>
<p>To ensure that a user’s epoch size (<code>user_epoch_limit</code>) is included within their membership we must modify the user’s commitment/leaf in the tree to contain it.
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="modification-to-circuit-inputs">Modification to circuit inputs<a href="https://research.logos.co/rlog/rln-v3#modification-to-circuit-inputs" class="hash-link" aria-label="Direct link to Modification to circuit inputs" title="Direct link to Modification to circuit inputs"></a></h3>
but we maintain the <code>user_epoch_limit</code> as a private input to the circuit so that the user is not deanonymized by the anonymity set connected to that <code>user_epoch_limit</code>.
Since <code>user_epoch_limit</code> is kept private,
can generate <code>user_message_limit</code> proofs without being slashed.</li>
</ul>
<p>Since we perform operations on the <code>epoch</code>, we must include it as a circuit input (previously, it was removed from the circuit inputs to RLN-v2).</p>
<p>Therefore, the new circuit inputs are as follows:</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="additional-circuit-constraints">Additional circuit constraints<a href="https://research.logos.co/rlog/rln-v3#additional-circuit-constraints" class="hash-link" aria-label="Direct link to Additional circuit constraints" title="Direct link to Additional circuit constraints"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="modifications-to-external-epoch-validation-waku-etc">Modifications to external epoch validation (Waku, etc.)<a href="https://research.logos.co/rlog/rln-v3#modifications-to-external-epoch-validation-waku-etc" class="hash-link" aria-label="Direct link to Modifications to external epoch validation (Waku, etc.)" title="Direct link to Modifications to external epoch validation (Waku, etc.)"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="modifications-to-double-signaling-detection-scheme-waku-etc">Modifications to double signaling detection scheme (Waku, etc.)<a href="https://research.logos.co/rlog/rln-v3#modifications-to-double-signaling-detection-scheme-waku-etc" class="hash-link" aria-label="Direct link to Modifications to double signaling detection scheme (Waku, etc.)" title="Direct link to Modifications to double signaling detection scheme (Waku, etc.)"></a></h3>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-implementation">The implementation<a href="https://research.logos.co/rlog/rln-v3#the-implementation" class="hash-link" aria-label="Direct link to The implementation" title="Direct link to The implementation"></a></h2>
<p>An implementation of the RLN-v3 scheme in <a href="https://docs.gnark.consensys.io/" target="_blank" rel="noopener noreferrer">gnark</a> can be found <a href="https://github.com/vacp2p/gnark-rln/blob/9b05eddc89901a06d8f41b093ce8ce12fd0bb4e0/rln/rln.go" target="_blank" rel="noopener noreferrer">here</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="comments-on-performance">Comments on performance<a href="https://research.logos.co/rlog/rln-v3#comments-on-performance" class="hash-link" aria-label="Direct link to Comments on performance" title="Direct link to Comments on performance"></a></h2>
<li>Elliptic curve: <a href="https://eprint.iacr.org/2013/879.pdf" target="_blank" rel="noopener noreferrer"><code>bn254</code></a> (aka bn128) (not to be confused with the 254-bit Weierstrass curve)</li>
<li>Finite field: Prime-order subgroup of the group of points on the <code>bn254</code> curve</li>
<li>Default Merkle tree height: <code>20</code></li>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="proving">Proving<a href="https://research.logos.co/rlog/rln-v3#proving" class="hash-link" aria-label="Direct link to Proving" title="Direct link to Proving"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="verification">Verification<a href="https://research.logos.co/rlog/rln-v3#verification" class="hash-link" aria-label="Direct link to Verification" title="Direct link to Verification"></a></h3>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="conclusion">Conclusion<a href="https://research.logos.co/rlog/rln-v3#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="future-work">Future work<a href="https://research.logos.co/rlog/rln-v3#future-work" class="hash-link" aria-label="Direct link to Future work" title="Direct link to Future work"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="references">References<a href="https://research.logos.co/rlog/rln-v3#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References"></a></h2>
<li><a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention" target="_blank" rel="noopener noreferrer">Strengthening Anonymous DoS Prevention with Rate Limiting Nullifiers in Waku</a></li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="introduction">Introduction<a href="https://research.logos.co/rlog/rln-light-verifiers#introduction" class="hash-link" aria-label="Direct link to Introduction" title="Direct link to Introduction"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="constraints-and-requirements">Constraints and requirements<a href="https://research.logos.co/rlog/rln-light-verifiers#constraints-and-requirements" class="hash-link" aria-label="Direct link to Constraints and requirements" title="Direct link to Constraints and requirements"></a></h2>
However, this approach increases gas costs for inserting new memberships and <em>may</em> not be feasible until it is optimized further with batching mechanisms, etc.</p>
<p>The other methods have been explored in more depth <a href="https://hackmd.io/@rymnc/rln-tree-storages" target="_blank" rel="noopener noreferrer">here</a>.</p>
<p>Following are the requirements and constraints for the solution proposed in this post:</p>
<ol>
<li>Cheap membership insertions.</li>
<li>As few RPC calls as possible to reduce startup time.</li>
<li>Merkle root of the tree is available on-chain.</li>
<li>No centralized services to sequence membership insertions.</li>
<li>Map inserted commitments to the block in which they were inserted.</li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="metrics-on-sync-time-for-a-tree-with-2653-leaves">Metrics on sync time for a tree with 2,653 leaves<a href="https://research.logos.co/rlog/rln-light-verifiers#metrics-on-sync-time-for-a-tree-with-2653-leaves" class="hash-link" aria-label="Direct link to Metrics on sync time for a tree with 2,653 leaves" title="Direct link to Metrics on sync time for a tree with 2,653 leaves"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="test-bench">Test bench<a href="https://research.logos.co/rlog/rln-light-verifiers#test-bench" class="hash-link" aria-label="Direct link to Test bench" title="Direct link to Test bench"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="metrics">Metrics<a href="https://research.logos.co/rlog/rln-light-verifiers#metrics" class="hash-link" aria-label="Direct link to Metrics" title="Direct link to Metrics"></a></h3>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="proposed-solution">Proposed solution<a href="https://research.logos.co/rlog/rln-light-verifiers#proposed-solution" class="hash-link" aria-label="Direct link to Proposed solution" title="Direct link to Proposed solution"></a></h2>
it is not possible to compute the root of the tree in a single call.</p>
<p>Acknowledging that <a href="https://polygon.technology/blog/polygon-miden-state-model" target="_blank" rel="noopener noreferrer">Polygon Miden</a> and <a href="https://penumbra.zone/blog/tiered-commitment-tree/" target="_blank" rel="noopener noreferrer">Penumbra</a> both make use of a tiered commitment tree,
we propose a similar approach for RLN.</p>
<p>A tiered commitment tree is a tree which is sharded into multiple smaller subtrees,
as well as reducing state bloat by just storing the root of a subtree when it is full instead of all its leaves.</p>
<p>Here, the question arises:
What is the maximum number of leaves in a subtree with which the root can be computed in a single call?</p>
<p>It costs approximately 217M gas to compute the root of a Merkle tree with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mn>10</mn></msup></mrow><annotation encoding="application/x-tex">2^{10}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8141em"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">10</span></span></span></span></span></span></span></span></span></span></span></span> leaves.</p>
<p>This is a feasible number for a single call,
and hence we propose a tiered commitment tree with a maximum of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mn>10</mn></msup></mrow><annotation encoding="application/x-tex">2^{10}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8141em"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">10</span></span></span></span></span></span></span></span></span></span></span></span> leaves in a subtree and the number of subtrees is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mn>10</mn></msup></mrow><annotation encoding="application/x-tex">2^{10}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8141em"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">10</span></span></span></span></span></span></span></span></span></span></span></span>.
Therefore, the maximum number of leaves in the tree is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mn>20</mn></msup></mrow><annotation encoding="application/x-tex">2^{20}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8141em"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">20</span></span></span></span></span></span></span></span></span></span></span></span> (the same as the current implementation).</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="insertion">Insertion<a href="https://research.logos.co/rlog/rln-light-verifiers#insertion" class="hash-link" aria-label="Direct link to Insertion" title="Direct link to Insertion"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="syncing">Syncing<a href="https://research.logos.co/rlog/rln-light-verifiers#syncing" class="hash-link" aria-label="Direct link to Syncing" title="Direct link to Syncing"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="gas-costs">Gas costs<a href="https://research.logos.co/rlog/rln-light-verifiers#gas-costs" class="hash-link" aria-label="Direct link to Gas costs" title="Direct link to Gas costs"></a></h3>
<p>The gas costs for inserting a commitment into the tree are the same as the current implementation except it consists of an extra SSTORE operation to store the <code>shardIndex</code> of the commitment.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="events">Events<a href="https://research.logos.co/rlog/rln-light-verifiers#events" class="hash-link" aria-label="Direct link to Events" title="Direct link to Events"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="proof-of-concept">Proof of concept<a href="https://research.logos.co/rlog/rln-light-verifiers#proof-of-concept" class="hash-link" aria-label="Direct link to Proof of concept" title="Direct link to Proof of concept"></a></h3>
<p>A proof of concept implementation of the tiered commitment tree is available <a href="https://github.com/vacp2p/rln-contract/pull/37" target="_blank" rel="noopener noreferrer">here</a>,
and is deployed on Sepolia at <a href="https://sepolia.etherscan.io/address/0xE7987c70B54Ff32f0D5CBbAA8c8Fc1cAf632b9A5" target="_blank" rel="noopener noreferrer">0xE7987c70B54Ff32f0D5CBbAA8c8Fc1cAf632b9A5</a>.</p>
<p>It is compatible with the current implementation of the RLN verifier.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="future-work">Future work<a href="https://research.logos.co/rlog/rln-light-verifiers#future-work" class="hash-link" aria-label="Direct link to Future work" title="Direct link to Future work"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="conclusion">Conclusion<a href="https://research.logos.co/rlog/rln-light-verifiers#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion"></a></h2>
<p>The tiered commitment tree is a promising approach to reduce the number of RPC calls required to sync the tree and reduce the gas costs associated with computing the root of the tree.
Consequently, it allows for a more scalable and efficient RLN verifier.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="references">References<a href="https://research.logos.co/rlog/rln-light-verifiers#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References"></a></h2>
<li><a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention" target="_blank" rel="noopener noreferrer">Strengthening Anonymous DoS Prevention with Rate Limiting Nullifiers in Waku</a></li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="introduction">Introduction<a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention#introduction" class="hash-link" aria-label="Direct link to Introduction" title="Direct link to Introduction"></a></h2>
The actual proof is done by a <a href="https://ethereum.org/en/developers/tutorials/merkle-proofs-for-offline-data-integrity/" target="_blank" rel="noopener noreferrer">Merkle Inclusion Proof</a>, which is a type of ZK proof.</p>
<p>The circuit ensures that the user's secret does indeed hash to a leaf in the tree,
This mechanism is further described in <a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention#malicious-user-secret-interpolation-mechanism">malicious User secret interpolation mechanism</a></p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="rln-protocol-parameters">RLN Protocol parameters<a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention#rln-protocol-parameters" class="hash-link" aria-label="Direct link to RLN Protocol parameters" title="Direct link to RLN Protocol parameters"></a></h2>
<li>Elliptic Curve: <a href="https://eprint.iacr.org/2013/879.pdf" target="_blank" rel="noopener noreferrer"><code>bn254</code></a> (aka bn128) (not to be confused with the 254 bit Weierstrass curve)</li>
<li>Finite Field: Prime-order subgroup of the group of points on the <code>bn254</code> curve</li>
<li>Default Merkle Tree Height: <code>20</code></li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="malicious-user-secret-interpolation-mechanism">Malicious User secret interpolation mechanism<a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention#malicious-user-secret-interpolation-mechanism" class="hash-link" aria-label="Direct link to Malicious User secret interpolation mechanism" title="Direct link to Malicious User secret interpolation mechanism"></a></h2>
<div class="language-text codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">identitySecret: the randomly generated secret of the user</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">identityPathIndex: the index of the commitment derived from the secret</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">pathElements: elements included in the path to the index of the commitment</span><br></span></code></pre></div></div>
<div class="language-text codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">x: hash of the signal to the finite field</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">rlnIdentifier: application-specific identifier which this proof is being generated for</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">epoch: the timestamp which this proof is being generated for</span><br></span></code></pre></div></div>
<p>To interpolate the secret of a user who has sent multiple signals during the same epoch to the same rln-based application, we may make use of the following formula -</p>
<p>This enables RLN to be used for rate limiting with a <em>global</em> limit. For arbitrary limits,
please refer to an article written by @curryrasul, <a href="https://mirror.xyz/privacy-scaling-explorations.eth/iCLmH1JVb7fDqp6Mms2NR001m2_n5OOSHsLF2QrxDnQ" target="_blank" rel="noopener noreferrer">rln-v2</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="wakus-problem-with-dos">Waku's problem with DoS<a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention#wakus-problem-with-dos" class="hash-link" aria-label="Direct link to Waku's problem with DoS" title="Direct link to Waku's problem with DoS"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="dos-prevention-with-user-metadata">DoS prevention with user metadata<a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention#dos-prevention-with-user-metadata" class="hash-link" aria-label="Direct link to DoS prevention with user metadata" title="Direct link to DoS prevention with user metadata"></a></h3>
<p>There are a couple of ways a user can be rate-limited, either -</p>
<ol>
<li>IP Logging</li>
<li>KYC Logging</li>
</ol>
<p>Both IP and KYC logging prevent systems from being truly anonymous, and hence, cannot be used as a valid DoS prevention mechanism for Waku.</p>
<p>RLN can be used as an alternative, which provides the best of both worlds, i.e a permissioned membership set, as well as anonymous signaling.
However, we are bound by k-anonymity rules of the membership set.</p>
<p><a href="https://rfc.vac.dev/waku/standards/core/17/rln-relay" target="_blank" rel="noopener noreferrer">Waku-RLN-Relay</a> is a <a href="https://libp2p.io/" target="_blank" rel="noopener noreferrer">libp2p</a> pubsub validator that verifies if a proof attached to a given message is valid.
In case the proof is valid, the message is relayed.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="performance-analysis">Performance analysis<a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention#performance-analysis" class="hash-link" aria-label="Direct link to Performance analysis" title="Direct link to Performance analysis"></a></h2>
<p>This simulation was conducted by @alrevuelta, and is described in more detail <a href="https://github.com/waku-org/research/issues/23" target="_blank" rel="noopener noreferrer">here</a>.</p>
<p>The simulation included 100 waku nodes running in parallel.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="security-analysis">Security analysis<a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention#security-analysis" class="hash-link" aria-label="Direct link to Security analysis" title="Direct link to Security analysis"></a></h2>
since the circuit does not make use of pairings.</p>
<p><a href="https://github.com/vacp2p/research/issues/155" target="_blank" rel="noopener noreferrer">An analysis</a> on the number of rounds in the Poseidon hash function was done,
which concluded that the hashing rounds should <em>not</em> be reduced,</p>
<p>The <a href="https://github.com/vacp2p/rln-contract" target="_blank" rel="noopener noreferrer">smart contracts</a> have <em>not</em> been audited, and are not recommended for real world deployments <em>yet</em>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="storage-analysis">Storage analysis<a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention#storage-analysis" class="hash-link" aria-label="Direct link to Storage analysis" title="Direct link to Storage analysis"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-bare-minimum-requirements-to-run-rln">The bare minimum requirements to run RLN<a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention#the-bare-minimum-requirements-to-run-rln" class="hash-link" aria-label="Direct link to The bare minimum requirements to run RLN" title="Direct link to The bare minimum requirements to run RLN"></a></h2>
<p>With proof generation time in sub-second latency, along with low storage overhead for the tree,
it is possible for end users to generate and verify RLN proofs on a modern smartphone.</p>
<p>Following is a demo provided by @rramos that demonstrates
<a href="https://drive.google.com/file/d/1ITLYrDOQrHQX2_3Q6O5EqKPYJN8Ye2gF/view?usp=sharing" target="_blank" rel="noopener noreferrer">waku-rln-relay used in react native</a>.</p>
<blockquote>
<p>Warning: The react native sdk will be deprecated soon, and the above demo should serve as a PoC for RLN on mobiles</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="rln-usage-guide">RLN usage guide<a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention#rln-usage-guide" class="hash-link" aria-label="Direct link to RLN usage guide" title="Direct link to RLN usage guide"></a></h2>
<p><a href="https://github.com/vacp2p/zerokit" target="_blank" rel="noopener noreferrer">Zerokit</a> implements api's that allow users to handle operations to the tree,
as well as generate/verify RLN proofs.</p>
<p>Our main implementation of RLN can be accessed via this Rust <a href="https://crates.io/crates/rln" target="_blank" rel="noopener noreferrer">crate</a>,
which is documented <a href="https://docs.rs/rln/0.4.1/rln/public/struct.RLN.html" target="_blank" rel="noopener noreferrer">here</a>.
It can used in other langugages via the FFI API, which is documented <a href="https://docs.rs/rln/0.4.1/rln/ffi/index.html" target="_blank" rel="noopener noreferrer">here</a>.
The usage of RLN in Waku is detailed in our <a href="https://hackmd.io/7cBCMU5hS5OYv8PTaW2wAQ?view" target="_blank" rel="noopener noreferrer">RLN Implementers guide</a>,
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="future-work">Future work<a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention#future-work" class="hash-link" aria-label="Direct link to Future work" title="Direct link to Future work"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="references">References<a href="https://research.logos.co/rlog/rln-anonymous-dos-prevention#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References"></a></h2>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="motivitation">Motivitation<a href="https://research.logos.co/rlog/GossipSub%20Improvements#motivitation" class="hash-link" aria-label="Direct link to Motivitation" title="Direct link to Motivitation"></a></h2>
as in the case of Ethereum Improvement Proposal <a href="https://eips.ethereum.org/EIPS/eip-4844" target="_blank" rel="noopener noreferrer">EIP-4844</a>.
This work led to a comprehensive study of unstructured P2P networks.
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="introduction">Introduction<a href="https://research.logos.co/rlog/GossipSub%20Improvements#introduction" class="hash-link" aria-label="Direct link to Introduction" title="Direct link to Introduction"></a></h2>
<p>Nodes in an unstructured p2p network form self-organizing overlay(s) on top of the IP infrastructure to facilitate different services like information dissemination,
query propagation, file sharing, etc. The overlay(s) can be as optimal as a tree-like structure or as enforcing as a fully connected mesh.</p>
<p>Due to peer autonomy and a trustless computing environment, some peers may deviate from the expected operation or even leave the network.
At the same time, the underlying IP layer is unreliable.</p>
<p>Therefore, tree-like overlays are not best suited for reliable information propagation.
Moreover, tree-based solutions usually result in significantly higher message dissemination latency due to suboptimal branches.</p>
<p>Flooding-based solutions, on the other hand, result in maximum resilience against adversaries and achieve minimal message dissemination latency because the message propagates through all (including the optimal) paths.
Redundant transmissions help maintain the integrity and security of the network in the presence of adversaries and high node failure but significantly increase network-wide bandwidth utilization, cramming the bottleneck links.</p>
<p>An efficient alternative is to lower the number of redundant transmissions by D-regular broadcasting, where a peer will likely receive (or relay) a message from up to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> random peers.
<p>GossipSub [<a href="https://arxiv.org/pdf/2007.02754.pdf" target="_blank" rel="noopener noreferrer">1</a>] benefits from full-message (D-regular) and metadata-only (k-regular) overlays.
Alternatively, a metadata-only overlay can be used, requiring a pull-based operation that significantly minimizes bandwidth utilization at the cost of increased latency.</p>
<p>Striking the right balance between parameters like <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi><mo separator="true">,</mo><mi>K</mi></mrow><annotation encoding="application/x-tex">D, K</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8778em;vertical-align:-0.1944em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em"></span><span class="mord mathnormal" style="margin-right:0.07153em">K</span></span></span></span>, pull-based operation, etc., can yield application-specific performance tuning, but scalability remains a problem.</p>
<p>At the same time, many other aspects can significantly contribute to the network's performance and scalability.
One option is to realize peers' suitability and continuously changing capabilities while forming overlays.</p>
<p>For instance, a low-bandwidth link near a publisher can significantly demean the entire network's performance.
Reshuffling of peering links according to the changing network conditions can lead to superior performance.</p>
<p>Laying off additional responsibilities to more capable nodes (super nodes) can alleviate peer cramming, but it makes the network susceptible to adversaries/peer churn.
Grouping multiple super nodes to form virtual node(s) can solve this problem.</p>
<p>Similarly, flat (single-tier) overlays cannot address the routing needs in large (geographically dispersed) networks.</p>
<p>Hierarchical (Multi-tier) overlays with different intra/inter-overlay routing solutions can better address these needs.
Moreover, using message aggregation schemes for grouping multiple messages can save bandwidth and provide better resilience against adversaries/peer churn.</p>
<p>This article's primary objective is to investigate the possible choices that can empower an unstructured P2P network to achieve superior performance for the broadest set of applications.
We look into different constraints imposed by application-specific needs (performance goals) and investigate various choices that can augment the network's performance.
We explore overlay designs/freshness, peer selection approaches, message-relaying mechanisms, and resilience against adversaries/peer churn.
We consider GossipSub a baseline protocol to explore various possibilities and decisively commit to the ones demonstrating superior performance.
An early message delivery in applications like live streaming can further enhance the viewing quality.</p>
<p>The properties and nature of the overlay network topology significantly impact the performance of services and applications executed on top of them.
Studying and devising mechanisms for better overlay design and message dissemination is paramount to achieving superior performance.</p>
<p>Interestingly, shortest-path message delivery trees have many limitations:</p>
<ol>
<li>Changing network dynamics requires a quicker and continuous readjustment of the multicast tree.</li>
<li>The presence of resource-constrained (bandwidth/compute, etc.) nodes in the overlay can result in congestion.</li>
<li>Node failure can result in partitions, making many segments unreachable.</li>
<li>Assuring a shortest-path tree-like structure requires a detailed view of the underlying (and continuously changing) network topology.</li>
</ol>
<p>Solutions involve creating multiple random trees to add redundancy [<a href="https://ieeexplore.ieee.org/abstract/document/6267905" target="_blank" rel="noopener noreferrer">2</a>].
Alternatives involve building an overlay mesh and forwarding messages through the multicast delivery tree (eager push).</p>
<p>Metadata is shared through the overlay links so that the nodes can ask for missing messages (lazy push or pull-based operation) through the overlay links.
New nodes are added from the overlay on node failure, but it requires non-faulty node selection.</p>
A smaller value for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> results in higher latency due to increased rounds, whereas a higher <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> reduces latency on the cost of increased bandwidth.
At the same time, keeping <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> independent of the growing network size (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">N</span></span></span></span>) may increase network-wide message dissemination latency.
Adjusting <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.10903em">N</span></span></span></span> maintains similar latency on the cost of increased workload for peers.
Authors in [<a href="https://infoscience.epfl.ch/record/83478/files/EugGueKerMas04IEEEComp.pdf" target="_blank" rel="noopener noreferrer">3</a>] suggest only a logarithmic increase in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> to maintain a manageable workload for peers.
In [<a href="https://inria.hal.science/tel-02375909/document" target="_blank" rel="noopener noreferrer">4</a>], it is reported that the average mesh degree should not exceed <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>D</mi><mrow><mi>a</mi><mi>v</mi><mi>g</mi></mrow></msub><mo>=</mo><mi>ln</mi><mo></mo><mo stretchy="false">(</mo><mi>N</mi><mo stretchy="false">)</mo><mo>+</mo><mi>C</mi></mrow><annotation encoding="application/x-tex">D_{avg} = \ln(N) + C</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.02778em">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">a</span><span class="mord mathnormal mtight" style="margin-right:0.03588em">vg</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em"></span><span class="mop">ln</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.10903em">N</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07153em">C</span></span></span></span> for an optimal operation,
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi></mrow><annotation encoding="application/x-tex">C</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.07153em">C</span></span></span></span> is a small constant.</p>
<p>Moreover, quicker shuffling of peers results in better performance in the presence of resource-constrained nodes or node failure [<a href="https://inria.hal.science/tel-02375909/document" target="_blank" rel="noopener noreferrer">4</a>].</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="goal2-considering-heterogeneity-in-overlay-design">GOAL2: Considering Heterogeneity In Overlay Design<a href="https://research.logos.co/rlog/GossipSub%20Improvements#goal2-considering-heterogeneity-in-overlay-design" class="hash-link" aria-label="Direct link to GOAL2: Considering Heterogeneity In Overlay Design" title="Direct link to GOAL2: Considering Heterogeneity In Overlay Design"></a></h2>
<p>Random peering connections in P2P overlays represent a stochastic process. It is inherently difficult to precisely model the performance of such systems.
A better solution involves a two-phased operation:</p>
<ol>
<li>
<p>Every node computes its available bandwidth and selects a node degree <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> proportional to its available bandwidth [<a href="https://inria.hal.science/tel-02375909/document" target="_blank" rel="noopener noreferrer">4</a>].
Different bandwidth estimation approaches are suggested in literature [<a href="https://ieeexplore.ieee.org/abstract/document/1224454" target="_blank" rel="noopener noreferrer">5</a>,<a href="https://ieeexplore.ieee.org/abstract/document/1248658" target="_blank" rel="noopener noreferrer">6</a>].
Simple bandwidth estimation approaches like variable packet size probing [<a href="https://ieeexplore.ieee.org/abstract/document/1248658" target="_blank" rel="noopener noreferrer">6</a>] yield similar results with less complexity.
It is also worth mentioning that many nodes may want to allocate only a capped share of their bandwidth to the network.
Lowering <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> according to the available bandwidth can still prove helpful.
To further conform to the suggested mesh-degree average <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>D</mi><mrow><mi>a</mi><mi>v</mi><mi>g</mi></mrow></msub></mrow><annotation encoding="application/x-tex">D_{avg}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.02778em">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">a</span><span class="mord mathnormal mtight" style="margin-right:0.03588em">vg</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em"><span></span></span></span></span></span></span></span></span></span>, every node tries achieving this average within its neighborhood, resulting in an overall similar <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>D</mi><mrow><mi>a</mi><mi>v</mi><mi>g</mi></mrow></msub></mrow><annotation encoding="application/x-tex">D_{avg}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.02778em">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">a</span><span class="mord mathnormal mtight" style="margin-right:0.03588em">vg</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em"><span></span></span></span></span></span></span></span></span></span>.</p>
</li>
<li>
<p>From the available local view, every node tries connecting peers with the lowest latency until <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> connections are made.
We suggest referring to the peering solution discussed in GOAL5 to avoid network partitioning.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="goal3-bandwidth-optimization">GOAL3: Bandwidth Optimization<a href="https://research.logos.co/rlog/GossipSub%20Improvements#goal3-bandwidth-optimization" class="hash-link" aria-label="Direct link to GOAL3: Bandwidth Optimization" title="Direct link to GOAL3: Bandwidth Optimization"></a></h2>
<p>Redundant message transmissions are essential for handling adversaries/node failure. However, these transmissions result in traffic bursts, cramming many overlay links.
This not only adds to the network-wide message dissemination latency but a significant share of the network's bandwidth is wasted on (usually) unnecessary transmissions.
These solutions include multicast delivery trees, metadata sharing to enable pull-based operation, in-network information caching, etc. [<a href="https://dl.acm.org/doi/abs/10.1145/945445.945473" target="_blank" rel="noopener noreferrer">7</a>,<a href="https://link.springer.com/chapter/10.1007/11558989_12" target="_blank" rel="noopener noreferrer">8</a>].
GossipSub employs a hybrid of eager push (message dissemination through the overlay) and lazy push (a pull-based operation by the nodes requiring information through IWANT messages).</p>
<p>A better alternative to simple redundant transmission is to use message aggregation [<a href="https://ieeexplore.ieee.org/abstract/document/8737576" target="_blank" rel="noopener noreferrer">9</a>,<a href="https://dl.acm.org/doi/abs/10.1145/1993636.1993676" target="_blank" rel="noopener noreferrer">10</a>,<a href="https://ieeexplore.ieee.org/abstract/document/4276446" target="_blank" rel="noopener noreferrer">11</a>] for the GossipSub protocol.
and devising techniques to identify all messages belonging to each interval.
In addition, combining messages from different publishers requires more complex arrangements,
involving embedding publisher/message IDs, delayed forwarding (to accommodate more messages), and mechanisms to ensure the decoding of messages at all peers.
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="goal4-handling-large-messages">GOAL4: Handling Large Messages<a href="https://research.logos.co/rlog/GossipSub%20Improvements#goal4-handling-large-messages" class="hash-link" aria-label="Direct link to GOAL4: Handling Large Messages" title="Direct link to GOAL4: Handling Large Messages"></a></h2>
<p>Many applications require transferring large messages for their successful operation. For instance, database/blockchain transactions [<a href="https://eips.ethereum.org/EIPS/eip-4844" target="_blank" rel="noopener noreferrer">12</a>].
This introduces two challenges:</p>
<ol>
<li>Redundant large message transmissions result in severe network congestion.</li>
<li>Message transmissions follow a store/forward process at all peers, which is inefficient in the case of large messages.</li>
</ol>
<p>The above-mentioned challenges result in a noticeable increase in message dissemination latency and bandwidth wastage.
Therefore, using the IDontWant message with staggered sending can yield better results by allowing timely reception and processing of IDontWant messages.</p>
</li>
<li>
<p>Message transmissions follow a store/forward process at all peers that is inefficient in the case of large messages.
We can parallelize message transmission by partitioning large messages into smaller fragments, letting intermediate peers relay these fragments as soon as they receive them.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="goal5-scalability">GOAL5: Scalability<a href="https://research.logos.co/rlog/GossipSub%20Improvements#goal5-scalability" class="hash-link" aria-label="Direct link to GOAL5: Scalability" title="Direct link to GOAL5: Scalability"></a></h2>
<p>P2P networks are inherently scalable because every incoming node brings in bandwidth and compute resources.
In other words, we can keep adding nodes to the network as long as every incoming node brings at-least <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>R</mi><mo>×</mo><mi>D</mi></mrow><annotation encoding="application/x-tex">R \times D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7667em;vertical-align:-0.0833em"></span><span class="mord mathnormal" style="margin-right:0.00773em">R</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">×</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> bandwidth,
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>R</mi></mrow><annotation encoding="application/x-tex">R</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.00773em">R</span></span></span></span> is average data arrival rate.
Hierarchical overlay designs, on the other hand, are less explored.</p>
<p>Placing a logical structure in unstructured P2P systems can help scale P2P networks.</p>
<p>One possible solution is to use a hierarchical overlay inspired by the approaches [<a href="https://link.springer.com/article/10.1007/s12083-016-0460-5" target="_blank" rel="noopener noreferrer">14</a>,<a href="https://link.springer.com/chapter/10.1007/978-3-030-19223-5_16" target="_blank" rel="noopener noreferrer">15</a>,<a href="https://ieeexplore.ieee.org/abstract/document/9826458" target="_blank" rel="noopener noreferrer">16</a>].
An abstract operation of such overlay design is provided below:</p>
<ol>
<li>
<p>Clustering nodes based on locality, assuming that such peers will have relatively lower intra-cluster latency and higher bandwidth.
For this purpose, every node tries connecting peers with the lowest latency until <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.02778em">D</span></span></span></span> connections are made or the cluster limit is reached.</p>
</li>
<li>
<p>A small subset of nodes having the highest bandwidth and compute resources is selected from each cluster.
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="summary">Summary<a href="https://research.logos.co/rlog/GossipSub%20Improvements#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary"></a></h2>
<p>Overlay acts as a virtual backbone for a P2P network. A flat overlay is more straightforward and allows effortless readjustment to application needs.
On the other hand, a hierarchical overlay can bring scalability at the cost of increased complexity.
Regardless of the overlay design, a continuous readjustment to appropriate peering links is essential for superior performance.
At the same time, bandwidth preservation (through message aggregation, caching at strategic locations, metadata sharing, pull-based operation, etc.) can help minimize latency.
However, problems like peer churn and in-network adversaries can be best alleviated through balanced redundant coverage, and frequent reshuffling of the peering links.</p>
<h1>References</h1>
<ul>
<li>[1] D. Vyzovitis, Y. Napora, D. McCormick, D. Dias, and Y. Psaras, “Gossipsub: Attack-resilient message propagation in the filecoin and eth2. 0 networks,” arXiv preprint arXiv:2007.02754, 2020. Retrieved from <a href="https://arxiv.org/pdf/2007.02754.pdf" target="_blank" rel="noopener noreferrer">https://arxiv.org/pdf/2007.02754.pdf</a></li>
<li>[2] M. Matos, V. Schiavoni, P. Felber, R. Oliveira, and E. Riviere, “Brisa: Combining efficiency and reliability in epidemic data dissemination,” in 2012 IEEE 26th International Parallel and Distributed Processing Symposium. IEEE, 2012, pp. 983–994. Retrieved from <a href="https://ieeexplore.ieee.org/abstract/document/6267905" target="_blank" rel="noopener noreferrer">https://ieeexplore.ieee.org/abstract/document/6267905</a></li>
<li>[3] P. T. Eugster, R. Guerraoui, A. M. Kermarrec, and L. Massouli, “Epidemic information dissemination in distributed systems,” IEEE Computer, vol. 37, no. 5, 2004. Retrieved from <a href="https://infoscience.epfl.ch/record/83478/files/EugGueKerMas04IEEEComp.pdf" target="_blank" rel="noopener noreferrer">https://infoscience.epfl.ch/record/83478/files/EugGueKerMas04IEEEComp.pdf</a></li>
<li>[4] D. Frey, “Epidemic protocols: From large scale to big data,” Ph.D. dissertation, Universite De Rennes 1, 2019. Retrieved from <a href="https://inria.hal.science/tel-02375909/document" target="_blank" rel="noopener noreferrer">https://inria.hal.science/tel-02375909/document</a></li>
<li>[5] M. Jain and C. Dovrolis, “End-to-end available bandwidth: measurement methodology, dynamics, and relation with tcp throughput,” IEEE/ACM Transactions on networking, vol. 11, no. 4, pp. 537–549, 2003. Retrieved from <a href="https://ieeexplore.ieee.org/abstract/document/1224454" target="_blank" rel="noopener noreferrer">https://ieeexplore.ieee.org/abstract/document/1224454</a></li>
<li>[6] R. Prasad, C. Dovrolis, M. Murray, and K. Claffy, “Bandwidth estimation: metrics, measurement techniques, and tools,” IEEE network, vol. 17, no. 6, pp. 27–35, 2003. Retrieved from <a href="https://ieeexplore.ieee.org/abstract/document/1248658" target="_blank" rel="noopener noreferrer">https://ieeexplore.ieee.org/abstract/document/1248658</a></li>
<li>[7] D. Kostic, A. Rodriguez, J. Albrecht, and A. Vahdat, “Bullet: High bandwidth data dissemination using an overlay mesh,” in Proceedings of the nineteenth ACM symposium on Operating systems principles, 2003, pp. 282–297. Retrieved from <a href="https://dl.acm.org/doi/abs/10.1145/945445.945473" target="_blank" rel="noopener noreferrer">https://dl.acm.org/doi/abs/10.1145/945445.945473</a></li>
<li>[8] V. Pai, K. Kumar, K. Tamilmani, V. Sambamurthy, and A. E. Mohr, “Chainsaw: Eliminating trees from overlay multicast,” in Peer-to-Peer Systems IV: 4th International Workshop, IPTPS 2005, Ithaca, NY, USA, February 24-25, 2005. Revised Selected Papers 4. Springer, 2005, pp. 127–140. Retrieved from <a href="https://link.springer.com/chapter/10.1007/11558989_12" target="_blank" rel="noopener noreferrer">https://link.springer.com/chapter/10.1007/11558989_12</a></li>
<li>[9] Y.-D. Bromberg, Q. Dufour, and D. Frey, “Multisource rumor spreading with network coding,” in IEEE INFOCOM 2019-IEEE Conference on Computer Communications. IEEE, 2019, pp. 2359–2367. Retrieved from <a href="https://ieeexplore.ieee.org/abstract/document/8737576" target="_blank" rel="noopener noreferrer">https://ieeexplore.ieee.org/abstract/document/8737576</a></li>
<li>[10] B. Haeupler, “Analyzing network coding gossip made easy,” in Proceedings of the forty-third annual ACM symposium on Theory of computing, 2011, pp. 293–302. Retrieved from <a href="https://dl.acm.org/doi/abs/10.1145/1993636.1993676" target="_blank" rel="noopener noreferrer">https://dl.acm.org/doi/abs/10.1145/1993636.1993676</a></li>
<li>[11] S. Yu and Z. Li, “Massive data delivery in unstructured peer-to-peer networks with network coding,” in 6th IEEE/ACIS International Conference on Computer and Information Science (ICIS 2007). IEEE, 2007, pp. 592–597. Retrieved from <a href="https://ieeexplore.ieee.org/abstract/document/4276446" target="_blank" rel="noopener noreferrer">https://ieeexplore.ieee.org/abstract/document/4276446</a></li>
<li>[12] V. Buterin, D. Feist, D. Loerakker, G. Kadianakis, M. Garnett, M. Taiwo, and A. Dietrichs, “Eip-4844: Shard blob transactions scale data-availability of ethereum in a simple, forwards-compatible manner,” 2022. Retrieved from <a href="https://eips.ethereum.org/EIPS/eip-4844" target="_blank" rel="noopener noreferrer">https://eips.ethereum.org/EIPS/eip-4844</a></li>
<li>[13] A. Manning, “Gossipsub extension for epidemic meshes (v1.2.0),” 2022. Retrieved from <a href="https://github.com/libp2p/specs/pull/413" target="_blank" rel="noopener noreferrer">https://github.com/libp2p/specs/pull/413</a></li>
<li>[14] Z. Duan, C. Tian, M. Zhou, X. Wang, N. Zhang, H. Du, and L. Wang, “Two-layer hybrid peer-to-peer networks,” Peer-to-Peer Networking and Applications, vol. 10, pp. 1304–1322, 2017. Retrieved from <a href="https://link.springer.com/article/10.1007/s12083-016-0460-5" target="_blank" rel="noopener noreferrer">https://link.springer.com/article/10.1007/s12083-016-0460-5</a></li>
<li>[15] W. Hao, J. Zeng, X. Dai, J. Xiao, Q. Hua, H. Chen, K.-C. Li, and H. Jin, “Blockp2p: Enabling fast blockchain broadcast with scalable peer-to-peer network topology,” in Green, Pervasive, and Cloud Computing: 14th International Conference, GPC 2019, Uberlandia, Brazil, May 26–28, 2019, Proceedings 14. Springer, 2019, pp. 223–237. Retrieved from <a href="https://link.springer.com/chapter/10.1007/978-3-030-19223-5_16" target="_blank" rel="noopener noreferrer">https://link.springer.com/chapter/10.1007/978-3-030-19223-5_16</a></li>
<li>[16] H. Qiu, T. Ji, S. Zhao, X. Chen, J. Qi, H. Cui, and S. Wang, “A geography-based p2p overlay network for fast and robust blockchain systems,” IEEE Transactions on Services Computing, 2022. Retrieved from <a href="https://ieeexplore.ieee.org/abstract/document/9826458" target="_blank" rel="noopener noreferrer">https://ieeexplore.ieee.org/abstract/document/9826458</a></li>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="introduction">Introduction<a href="https://research.logos.co/rlog/Nescience-A-zkVM-leveraging-hiding-properties#introduction" class="hash-link" aria-label="Direct link to Introduction" title="Direct link to Introduction"></a></h2>
<p>Nescience is a privacy-first blockchain project that aims to enable private transactions and provide a general-purpose execution environment for classical applications.
while also enabling the development of privacy-centric protocols such as private staking and private DEXs.</p>
<p>To ensure minimal trust assumptions and prevent information leakage, Nescience proposes a proof system that allows users to create proofs for private state updates,
while the verification of the proofs and the execution of the public functions inside the virtual machine can be delegated to an external incentivised prover.</p>
<p>It also aims to implement a seamless interaction between public and private state, enabling composability between contracts, and private and public functions.
and developers will be able to use and modify the code without any restriction.</p>
<p>Our primary objective is the construction of the Zero-Knowledge Virtual Machine (zkVM). This document serves as a detailed exploration of the multifaceted challenges,
we not only reinforce the foundation of our project but also ensure its scalability and robustness in the ever-evolving landscape of blockchain technology.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="goal-1-create-a-state-separation-architecture">Goal 1: Create a State Separation Architecture<a href="https://research.logos.co/rlog/Nescience-A-zkVM-leveraging-hiding-properties#goal-1-create-a-state-separation-architecture" class="hash-link" aria-label="Direct link to Goal 1: Create a State Separation Architecture" title="Direct link to Goal 1: Create a State Separation Architecture"></a></h2>
<p>The concept of blending an account-based structure with a UTXO-based model for differentiating between public and private states is intriguing.
It seeks to leverage the strengths of both models: the simplicity and directness of the account-based model with the privacy enhancements of the UTXO model.</p>
<p>Here's a breakdown and a potential strategy for harmonizing these models:</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="-rationale-behind-the-dual-architecture-"><ins> Rationale Behind the Dual Architecture: </ins><a href="https://research.logos.co/rlog/Nescience-A-zkVM-leveraging-hiding-properties#-rationale-behind-the-dual-architecture-" class="hash-link" aria-label="Direct link to -rationale-behind-the-dual-architecture-" title="Direct link to -rationale-behind-the-dual-architecture-"></a></h3>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="-harmonizing-the-two-systems-"><ins> Harmonizing the Two Systems: </ins><a href="https://research.logos.co/rlog/Nescience-A-zkVM-leveraging-hiding-properties#-harmonizing-the-two-systems-" class="hash-link" aria-label="Direct link to -harmonizing-the-two-systems-" title="Direct link to -harmonizing-the-two-systems-"></a></h3>
<p><em>Account-to-UTXO Adapter:</em> When an account wishes to make a private transaction,
it would initiate a process converting a part of its balance to a UTXO, facilitating a privacy transaction.</p>
</li>
</ul>
</li>
<li>
<p>Unified Identity Management</p>
<ul>
<li>
<p>Role: Maintain a unified identity (or address) system that works across both state models,
allowing users to easily manage their public and private states without requiring separate identities.</p>
</li>
<li>
<p><em>Deterministic Wallets:</em> Use Hierarchical Deterministic (HD) wallets [<a href="https://medium.com/mycrypto/the-journey-from-mnemonic-phrase-to-address-6c5e86e11e14" target="_blank" rel="noopener noreferrer">3</a>,<a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank" rel="noopener noreferrer">4</a>], enabling users to generate multiple addresses (both UTXO and account-based) from a single seed.
This ensures privacy while keeping management centralized for the user.</p>
</li>
</ul>
</li>
<li>
<p>State Commitments</p>
<ul>
<li>
<p>Role: Use cryptographic commitments to commit to the state of both models. This can help in efficiently validating cross-model transactions.</p>
</li>
<li>
<p><em>Verkle Trees:</em> Verkle Trees combine Vector Commitment and the KZG polynomial commitment scheme to produce a structure that's efficient in terms of both proofs and verification.
Verkle proofs are considerably small in size (less data to store and transmit), where Transaction and state verifications can be faster due to the smaller proof sizes and computational efficiencies.</p>
</li>
<li>
<p><em>Mimblewimble-style Aggregation</em> [<a href="https://github.com/mimblewimble/grin/blob/master/doc/intro.md" target="_blank" rel="noopener noreferrer">5</a>]: For UTXOs, techniques similar to those used in Mimblewimble can be used to aggregate transactions, keeping the state compact and enhancing privacy.</p>
</li>
</ul>
</li>
<li>
<p>Batch Processing & Anonymity Sets</p>
<ul>
<li>
<p>Role: Group several UTXO-based private transactions into a single public account-based transaction.
This can provide a level of obfuscation and can make synchronization between the two models more efficient.</p>
</li>
<li>
<p><em>CoinJoin Technique</em> [<a href="https://en.bitcoin.it/wiki/CoinJoin" target="_blank" rel="noopener noreferrer">6</a>]: As seen in Bitcoin, multiple users can combine their UTXO transactions into one, enhancing privacy.</p>
</li>
<li>
<p><em>Tornado Cash Principle</em> [<a href="https://github.com/tornadocash/tornado-classic-ui" target="_blank" rel="noopener noreferrer">7</a>]: For account-based systems wanting to achieve privacy, methods like those used in Tornado Cash can be implemented,
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="-challenges-and-solutions-"><ins> Challenges and Solutions </ins><a href="https://research.logos.co/rlog/Nescience-A-zkVM-leveraging-hiding-properties#-challenges-and-solutions-" class="hash-link" aria-label="Direct link to -challenges-and-solutions-" title="Direct link to -challenges-and-solutions-"></a></h3>
<p>Challenge: Combining two distinct transaction models creates an inherent synchronization challenge.</p>
</li>
<li>
<p>State Channels: By allowing transactions to be conducted off-chain between participants, state channels can alleviate synchronization stresses.
Only the final state needs to be settled on-chain, drastically reducing the amount of data and frequency of updates required.</p>
</li>
<li>
<p>Sidechains: These act as auxiliary chains to the main blockchain. Transactions can be processed on the sidechain and then periodically synced with the main chain.
This structure helps reduce the immediate load on the primary system.</p>
</li>
<li>
<p>Checkpointing: Introduce periodic checkpoints where the two systems' states are verified and harmonized.
This can ensure consistency without constant synchronization.</p>
</li>
</ul>
</li>
<li>
<p>Double Spending</p>
<ul>
<li>
<p>Challenge: With two models operating in tandem, there's an increased risk of double-spending attacks.</p>
</li>
<li>
<p>Multi-Signature Transactions: Implementing transactions that require signatures from both systems can prevent unauthorized movements.</p>
</li>
<li>
<p>Cross-Verification Mechanisms: Before finalizing a transaction, it undergoes verification in both UTXO and account-based systems.
If discrepancies arise, the transaction can be halted.</p>
</li>
<li>
<p>Timestamping: By attaching a timestamp to each transaction, it's possible to order them sequentially, making it easier to spot and prevent double spending.</p>
</li>
</ul>
</li>
<li>
<p>Complexity in User Experience</p>
<ul>
<li>
<p>Challenge: The dual model, while powerful, is inherently complex.</p>
</li>
<li>
<p>Abstracted User Interfaces: Design UIs that handle the complexity behind the scenes,
allowing users to make transactions without needing to understand the nuances of the dual model.</p>
</li>
<li>
<p>Guided Tutorials: Offer onboarding tutorials to acquaint users with the system's features,
especially emphasizing when and why they might choose one transaction type over the other.</p>
</li>
<li>
<p>Feedback Systems: Implement systems where users can provide feedback on any complexities or challenges they encounter.
This real-time feedback can be invaluable for iterative design improvements.</p>
</li>
</ul>
</li>
<li>
<p>Security</p>
<ul>
<li>
<p>Challenge: Merging two systems can introduce unforeseen vulnerabilities.</p>
Each layer can act as a fail-safe if a potential threat bypasses another.</p>
</li>
<li>
<p>Decentralized Watchtowers: These are third-party services that monitor the network for malicious activities.
If any suspicious activity is detected, they can take corrective measures or raise alerts.</p>
</li>
</ul>
</li>
<li>
<p>Gas & Fee Management:</p>
<ul>
<li>
<p>Challenge: A dual model can lead to convoluted fee structures.</p>
</li>
<li>
<p>Dynamic Fee Adjustment: Implement algorithms that adjust fees based on network congestion and transaction type.
This can ensure fairness and prevent network abuse.</p>
</li>
<li>
<p>Fee Estimation Tools: Provide tools that can estimate fees before a transaction is initiated.
This helps users understand potential costs upfront.</p>
</li>
<li>
<p>Unified Gas Stations: Design platforms where users can purchase or allocate gas for both transaction types simultaneously,
simplifying the gas acquisition process.</p>
</li>
</ul>
</li>
</ol>
<p>By addressing these challenges head-on with a detailed and systematic approach, it's possible to unlock the full potential of a dual-architecture system,
combining the strengths of both UTXO and account-based models without their standalone limitations.</p>
<table><thead><tr><th>Aspect</th><th>Details</th></tr></thead><tbody><tr><td><strong>Harmony</strong></td><td>- <strong>Advanced VM Development:</strong> Design tailored for private smart contracts. - <strong>Leverage Established Architectures:</strong> Use WASM or RISC-V to harness their versatile and encompassing nature suitable for zero-knowledge applications. - <strong>Support for UTXO & Account-Based Models:</strong> Enhance adaptability across various blockchain structures.</td></tr><tr><td><strong>Challenges</strong></td><td>- <strong>Adaptation Concerns:</strong> WASM and RISC-V weren't designed with zero-knowledge proofs as a primary focus, posing integration challenges. - <strong>Complexities with Newer Systems:</strong> Systems like (Super)Nova, STARKs, and Sangria are relatively nascent, adding another layer of intricacy to the integration. - <strong>Optimization Concerns:</strong> Ensuring that these systems are optimized for zero-knowledge proofs.</td></tr><tr><td><strong>Proposed Solutions</strong></td><td>- <strong>Integration of Nova:</strong> Consider Nova's proof system for its potential alignment with project goals. - <strong>Comprehensive Testing:</strong> Rigorously test and benchmark against alternatives like Halo2, Plonky, and Starky to validate choices. - <strong>Poseidon Recursion Technique:</strong> To conduct exhaustive performance tests, providing insights into each system's efficiency and scalability.</td></tr></tbody></table>
<p>The second goal entails the creation of an advanced virtual machine by leveraging established mainstream instruction sets like WASM or RISC-V.
Alternatively, the objective involves pioneering a new, specialized instruction set meticulously optimized for Zero-Knowledge applications.</p>
<p>This initiative seeks to foster a versatile and efficient environment for executing computations within the privacy-focused context of the project.
Both WASM and RISC-V exhibit adaptability to both UTXO and account-based models due to their encompassing nature as general-purpose instruction set architectures.</p>
<p><em>WASM</em>, operating as a low-level virtual machine, possesses the capacity to execute code derived from a myriad of high-level programming languages,
and boasts seamless integration across diverse blockchain platforms.</p>
<p>Meanwhile, <em>RISC-V</em> emerges as a versatile option, accommodating both models, and can be seamlessly integrated with secure enclaves like SGX or TEE,
while potentially addressing optimization concerns, necessitate extensive research and testing due to their relatively nascent status within the field.
This accentuates the need for a judicious balance between established options and innovative solutions in pursuit of an architecture harmoniously amalgamating privacy, security, and performance.</p>
<p>The ambition to build a powerful virtual machine tailored to zero-knowledge (ZK) applications is both commendable and intricate.
The combination of two renowned instruction sets, WASM and RISC-V, in tandem with ZK, is an innovation that could redefine privacy standards in blockchain.
Let's dissect the challenges and possibilities inherent in this goal:</p>
<ol>
<li>
<p>Established Mainstream Instruction Sets - WASM and RISC-V</p>
<ul>
<li>
<p>Strengths:</p>
<ul>
<li>
<p><em>WASM</em>: Rooted in its ability to execute diverse high-level language codes, its potential for cross-chain compatibility makes it a formidable contender.
Serving as a low-level virtual machine, its role in the blockchain realm is analogous to that of the Java Virtual Machine in the traditional computing landscape.</p>
</li>
<li>
<p><em>RISC-V</em>: This open-standard instruction set architecture has made waves due to its customizable nature.
Its adaptability to both UTXO and account-based structures coupled with its compatibility with trusted execution environments like SGX and TEE augments its appeal,
especially in domains that prioritize security and privacy.</p>
</li>
</ul>
</li>
<li>
<p>Challenges: Neither WASM nor RISC-V was primarily designed with ZKPs in mind. While they offer flexibility,
they might lack the necessary optimizations for ZK-centric tasks. Adjustments to these architectures might demand intensive R&D efforts.</p>
</li>
</ul>
</li>
<li>
<p>Pioneering a New, Specialized Instruction Set</p>
<ul>
<li>
<p>Strengths: A bespoke instruction set can be meticulously designed from the ground up with ZK in focus,
potentially offering unmatched performance and optimizations tailored to the project's requirements.</p>
</li>
<li>
<p>Challenges: Crafting a new instruction set is a monumental task requiring vast resources, including expertise, time, and capital.
It would also need to garner community trust and support over time.</p>
</li>
</ul>
</li>
<li>
<p>Contemporary Proof Systems - (Super)Nova, STARKs, Sangria</p>
<ul>
<li>
<p>Strengths: These cutting-edge systems, being relatively new, might offer breakthrough cryptographic efficiencies that older systems lack: designed with modern challenges in mind,
they could potentially bridge the gap where WASM and RISC-V might falter in terms of ZKP optimization.</p>
</li>
<li>
<p>Challenges: Their nascent nature implies a dearth of exhaustive testing, peer reviews, and potentially limited community support.
While they could offer optimizations that address challenges presented by WASM and RISC-V, their young status demands rigorous vetting and testing.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="-optimization-concerns-for-wasm-and-risc-v-"><ins> Optimization Concerns for WASM and RISC-V: </ins><a href="https://research.logos.co/rlog/Nescience-A-zkVM-leveraging-hiding-properties#-optimization-concerns-for-wasm-and-risc-v-" class="hash-link" aria-label="Direct link to -optimization-concerns-for-wasm-and-risc-v-" title="Direct link to -optimization-concerns-for-wasm-and-risc-v-"></a></h3>
<p><em>Cryptography Libraries</em>: ZKP applications rely heavily on specific cryptographic primitives. Neither WASM nor RISC-V natively supports all of these primitives.
Thus, a comprehensive library of cryptographic functions, optimized for these platforms, needs to be developed.</p>
</li>
<li>
<p><em>Parallel Execution</em>: Given the heavy computational demands of ZKPs, leveraging parallel processing capabilities can optimize the time taken.
Both WASM and RISC-V would need modifications to handle parallel execution of ZKP processes efficiently.</p>
</li>
<li>
<p><em>Memory Management</em>: ZKP computations can sometimes require significant amounts of memory, especially during the proof generation phase.
Fine-tuned memory management mechanisms are essential to prevent bottlenecks.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="-emerging-zkp-optimized-systems-considerations-"><ins> Emerging ZKP Optimized Systems Considerations: </ins><a href="https://research.logos.co/rlog/Nescience-A-zkVM-leveraging-hiding-properties#-emerging-zkp-optimized-systems-considerations-" class="hash-link" aria-label="Direct link to -emerging-zkp-optimized-systems-considerations-" title="Direct link to -emerging-zkp-optimized-systems-considerations-"></a></h3>
<p><em>Proof Size</em>: Different systems generate proofs of varying sizes. A smaller proof size is preferable for blockchain applications to save on storage and bandwidth.
The trade-offs between proof size, computational efficiency, and security need to be balanced.</p>
</li>
<li>
<p><em>Universality</em>: Some systems can support any computational statement (universal), while others might be tailored to specific tasks.
A universal system can be more versatile for diverse applications on the blockchain.</p>
</li>
<li>
<p><em>Setup Requirements</em>: Certain ZKP systems, like zk-SNARKs, require a trusted setup, which can be a security concern.
Alternatives like zk-STARKs don't have this requirement but come with other trade-offs.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="-strategies-for-integration-"><ins> Strategies for Integration: </ins><a href="https://research.logos.co/rlog/Nescience-A-zkVM-leveraging-hiding-properties#-strategies-for-integration-" class="hash-link" aria-label="Direct link to -strategies-for-integration-" title="Direct link to -strategies-for-integration-"></a></h3>
<p><em>Iterative Development</em>: Given the complexities, an iterative development approach can be beneficial.
Start with a basic integration of WASM or RISC-V for general tasks and gradually introduce specialized ZKP functionalities.</p>
</li>
<li>
<p><em>Benchmarking</em>: Establish benchmark tests specifically for ZKP operations. This will provide continuous feedback on the performance of the system as modifications are made, ensuring optimization.</p>
</li>
<li>
<p><em>External Audits & Research</em>: Regular checks from cryptographic experts and collaboration with academic researchers can help in staying updated and ensuring secure implementations.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="goal-3-proofs-creation-and-verification">Goal 3: Proofs Creation and Verification<a href="https://research.logos.co/rlog/Nescience-A-zkVM-leveraging-hiding-properties#goal-3-proofs-creation-and-verification" class="hash-link" aria-label="Direct link to Goal 3: Proofs Creation and Verification" title="Direct link to Goal 3: Proofs Creation and Verification"></a></h2>
<p>The process of generating proofs for private state updates is vested in the hands of the user, aligning with our commitment to minimizing trust assumptions and enhancing privacy.
Concurrently, the responsibility of verifying these proofs and executing public functions within the virtual machine can be effectively delegated to an external prover,
a role that is incentivized to operate with utmost honesty and integrity. This intricate balance seeks to safeguard against information leakage,
preserving the confidentiality of private transactions. Integral to this mechanism is the establishment of a robust incentivization framework.</p>
<p>To ensure the prover’s steadfast commitment to performing tasks with honesty, we should introduce a mechanism that facilitates both rewards for sincere behavior and penalties for any deviation from the expected standards.
The verification process has been intentionally designed to be more cost-effective than execution.</p>
<p>This strategic approach prevents potential malicious actors from exploiting the system by flooding it with spurious proofs, a scenario that could arise when the costs align favorably.
By maintaining a cost balance that favors verification, we bolster the system’s resilience against fraudulent activities while ensuring its efficiency.
In sum, our multifaceted approach endeavors to strike an intricate equilibrium between user-initiated proof creation, external verification, and incentivization.
external verification, incentivization, and cost-effective verification over execution, several options and mechanisms can be employed:</p>
<ol>
<li>
<p><strong>User-Initiated Proof Creation:</strong> Users are entrusted with the generation of proofs for private state updates, thus ensuring greater privacy and reducing trust dependencies.</p>
<ul>
<li>
<p>Challenges:</p>
<ul>
<li>
<p>Maintaining the quality and integrity of the proofs generated by users.</p>
</li>
<li>
<p>Ensuring that users have the tools and knowledge to produce valid proofs.</p>
</li>
</ul>
</li>
<li>
<p>Solutions:</p>
<ul>
<li>
<p>Offer extensive documentation, tutorials, and user-friendly tools to streamline the proof-generation process.</p>
</li>
<li>
<p>Implement checks at the verifier's end to ensure the quality of proofs.</p>
</li>
</ul>
</li>
</ul>
</li>
<li>
<p><strong>External Verification by Provers:</strong> An external prover verifies the proofs and executes public functions within the virtual machine.</p>
<ul>
<li>
<p>Challenges:</p>
<ul>
<li>
<p>Ensuring that the external prover acts honestly.</p>
</li>
<li>
<p>Avoiding centralized points of failure.</p>
</li>
</ul>
</li>
<li>
<p>Solutions:</p>
<ul>
<li>
<p>Adopt a decentralized verification approach, with multiple provers cross-verifying each other’s work.</p>
</li>
<li>
<p>Use reputation systems to rank provers based on their past performances, creating a trust hierarchy.</p>
</li>
</ul>
</li>
</ul>
</li>
<li>
<p>** Incentivization Framework:** A system that rewards honesty and penalizes dishonest actions, ensuring provers' commitment to the task.</p>
<ul>
<li>
<p>Challenges:</p>
<ul>
<li>
<p>Determining the right balance of rewards and penalties.</p>
</li>
<li>
<p>Ensuring that the system cannot be gamed for undue advantage.</p>
<p>Implement a dynamic reward system that adjusts based on network metrics and provers' performance.</p>
</li>
<li>
<p>Use a staking mechanism where provers need to lock up a certain amount of assets.
Honest behavior earns rewards, while dishonest behavior could lead to loss of staked assets.</p>
</li>
</ul>
</li>
</ul>
</li>
<li>
<p><strong>Economic Viability through Cost Dynamics:</strong> Making verification more cost-effective than execution to deter spamming and malicious attacks.</p>
<ul>
<li>
<p>Challenges:</p>
<ul>
<li>
<p>Setting the right cost metrics for both verification and execution.</p>
</li>
<li>
<p>Ensuring that genuine users aren’t priced out of the system.</p>
</li>
</ul>
</li>
<li>
<p>Solutions:</p>
<ul>
<li>
<p>Use a dynamic pricing model, adjusting costs in real-time based on network demand.</p>
</li>
<li>
<p>Implement gas-like mechanisms to differentiate operation costs and ensure fairness.</p>
</li>
</ul>
</li>
</ul>
</li>
<li>
<p>** Maintaining Trustworthiness:** Create a system that's transparent, holds all actors accountable, and is economically sound.</p>
<ul>
<li>
<p>Challenges:</p>
<ul>
<li>
<p>Keeping the balance where users feel their privacy is intact, while provers feel incentivized.</p>
</li>
<li>
<p>Ensuring the system remains resilient against adversarial attacks.</p>
</li>
</ul>
</li>
<li>
<p>Solutions:</p>
<ul>
<li>
<p>Implement layered checks and balances.</p>
</li>
<li>
<p>Foster community involvement, allowing them to participate in decision-making, potentially through a decentralized autonomous organization (DAO).</p>
</li>
</ul>
</li>
</ul>
</li>
</ol>
<p>Each of these options can be combined or customized to suit the specific requirements of your project, striking a balance between user incentives,
and conducive to the objectives of user-initiated proof creation, incentivized verification, and cost- effective validation.</p>
<center><table><thead><tr><th>Aspect</th><th>Details</th></tr></thead><tbody><tr><td><strong>Design Principle</strong></td><td>- <strong>User Responsibility:</strong> Generating proofs for private state updates. - <strong>External Prover:</strong> Delegated the task of verifying proofs and executing public VM functions.</td></tr><tr><td><strong>Trust & Privacy</strong></td><td>- <strong>Minimized Trust Assumptions:</strong> Place proof generation in users' hands. - <strong>Enhanced Privacy:</strong> Ensure confidentiality of private transactions and prevent information leakage.</td></tr><tr><td><strong>Incentivization Framework</strong></td><td>- <strong>Rewards:</strong> Compensate honest behavior. - <strong>Penalties:</strong> Deter and penalize dishonest behavior.</td></tr><tr><td><strong>Economic Considerations</strong></td><td>- <strong>Verification vs. Execution:</strong> Make verification more cost-effective than execution to prevent spurious proofs flooding. - <strong>Cost Balance:</strong> Strengthen resilience against fraudulent activities and maintain efficiency.</td></tr><tr><td><strong>Outcome</strong></td><td>An ecosystem where: - Users' privacy is paramount. - Incentives are appropriately aligned. - The system is robust against adversarial actions.</td></tr></tbody></table></center>
<p>This goal centers on the establishment of a kernel-based architecture, akin to the model observed in ZEXE, to facilitate the attestation of accurate private function executions.
At its core, this technique harnesses a recursive Succinct Non-Interactive Argument of Knowledge (SNARK) mechanism, where each function call’s proof accumulates within the call stack.</p>
<p>The subsequent verification of this stack’s authenticity leverages recursive SNARK validation.
While this method offers robust verification of private function executions, it’s essential to acknowledge its associated intricacies.</p>
<p>The generation of SNARK proofs necessitates a substantial computational effort, which, in turn, may lead to elevated gas fees for users.
By weaving recursion and iterative recursive computations into the fabric of our system, we aim to establish a mechanism that accentuates the trustworthiness of private function executions,
while conscientiously navigating the computational demands that ensue.</p>
<p>To accomplish the goal of implementing a kernel-based architecture for recursive verification of private function executions,
several strategic steps and considerations can be undertaken: recursion handling and depth management.</p>
<ins> Recursion Handling </ins>
<ul>
<li>
<p><em>Call Stack Management:</em></p>
<ul>
<li>Implement a data structure to manage the call stack, recording each recursive function call’s details, parameters, and state.</li>
</ul>
</li>
<li>
<p>_Proof Accumulation: _</p>
<ul>
<li>
<p>Design a mechanism to accumulate proof data for each function call within the call stack.
This includes cryptographic commitments, intermediate results, and cryptographic challenges.</p>
</li>
<li>
<p>Ensure that the accumulated proof data remains secure and tamper-resistant throughout the recursion process.</p>
</li>
</ul>
</li>
<li>
<p><em>Intermediary SNARK Proofs:</em></p>
<ul>
<li>
<p>Develop an intermediary SNARK proof for each function call’s correctness within the call stack.
This proof should demonstrate that the function executed correctly and produced expected outputs.</p>
</li>
<li>
<p>Ensure that the intermediary SNARK proof for each recursive call can be aggregated and verified together, maintaining the integrity of the entire call stack.</p>
</li>
</ul>
</li>
</ul>
<ins> Depth management </ins>
<ul>
<li>
<p><em>Depth Limitation:</em></p>
<ul>
<li>
<p>Define a threshold for the maximum allowable recursion depth based on the system’s computational capacity, gas limitations, and performance considerations.</p>
</li>
<li>
<p>Implement a mechanism to prevent further recursion beyond the defined depth limit, safeguarding against excessive computational growth.</p>
</li>
</ul>
</li>
<li>
<p><em>Graceful Degradation:</em></p>
<ul>
<li>
<p>Design a strategy for graceful degradation when the recursion depth approaches or reaches the defined limit.
This may involve transitioning to alternative execution modes or optimization techniques.</p>
</li>
<li>
<p>Communicate the degradation strategy to users and ensure that the system gracefully handles scenarios where recursion must be curtailed.</p>
</li>
</ul>
</li>
<li>
<p><em>Resource Monitoring:</em></p>
<ul>
<li>Develop tools to monitor resource consumption (such as gas usage and computational time) as recursion progresses.
Provide real-time feedback to users about the cost and impact of recursive execution.</li>
</ul>
</li>
<li>
<p><em>Dynamic Depth Adjustment:</em></p>
<ul>
<li>
<p>Consider implementing adaptive depth management that dynamically adjusts the recursion depth based on network conditions, transaction fees, and available resources.</p>
</li>
<li>
<p>Utilize algorithms to assess the optimal recursion depth for efficient execution while adhering to gas cost constraints.</p>
</li>
</ul>
</li>
<li>
<p><em>Fallback Mechanisms:</em></p>
<ul>
<li>Create fallback mechanisms that activate if the recursion depth limit is reached or if the system encounters resource constraints.
These mechanisms could involve alternative verification methods or delayed execution.</li>
</ul>
</li>
<li>
<p><em>User Notifications:</em></p>
<ul>
<li>Notify users when the recursion depth limit is approaching, enabling them to make informed decisions about the complexity of their transactions and potential resource usage.</li>
</ul>
</li>
</ul>
<p>Goal 4 underscores the project's ambition to integrate the merits of a kernel-based architecture with recursive verifications to bolster the reliability of private function executions.
While the approach promises robust outcomes, it's pivotal to maneuver through its intricacies with astute strategies, ensuring computational efficiency and economic viability.
<p>Goal 5 revolves around the meticulous design of a seamless interaction between public and private states within the blockchain ecosystem.
This objective envisions achieving not only composability between contracts but also the harmonious integration of private and public functions.</p>
<p>A notable challenge in this endeavor lies in the intricate interplay between public and private states,
wherein the potential linkage of a private transaction to a public one raises concerns about unintended information leakage.</p>
<p>The essence of this goal entails crafting an architecture that facilitates the dynamic interaction of different states while ensuring that the privacy and confidentiality of private transactions remain unbreached.
This involves the formulation of mechanisms that enable secure composability between contracts, guaranteeing the integrity of interactions across different layers of functionality.</p>
<p>A key focus of this goal is to surmount the challenge of information leakage by implementing robust safeguards.
The solution involves devising strategies to mitigate the risk of revealing private transaction details when connected to corresponding public actions.
By creating a nuanced framework that com- partmentalizes private and public interactions, the architecture aims to uphold privacy while facilitating seamless interoperability.</p>
<p>Goal 5 encapsulates a multifaceted undertaking, calling for the creation of an intricate yet transparent framework that empowers users to confidently engage in both public and private functions,
without compromising the confidentiality of private transactions. The successful realization of this vision hinges on a delicate blend of architectural ingenuity, cryptographic sophistication, and user-centric design.</p>
<p>To achieve seamless interaction between public and private states, composability, and privacy preservation, a combination of solutions and approaches can be employed.
In the table below, a comprehensive list of solutions that address these objectives:</p>
<center><table><thead><tr><th style="text-align:center"><strong>Solution Category</strong></th><th style="text-align:center"><strong>Description</strong></th></tr></thead><tbody><tr><td style="text-align:center"><strong>Layer 2 Solutions</strong></td><td style="text-align:center">Employ zk-Rollups, Optimistic Rollups, and state channels to handle private interactions off-chain and settle them on-chain periodically. Boost scalability and cut transaction costs.</td></tr><tr><td style="text-align:center"><strong>Intermediary Smart Contracts</strong></td><td style="text-align:center">Craft smart contracts as intermediaries for secure public-private interactions. Use these to manage data exchange confidentially.</td></tr><tr><td style="text-align:center"><strong>Decentralized Identity & Pseudonymity</strong></td><td style="text-align:center">Implement decentralized identity systems for pseudonymous interactions. Validate identity using cryptographic proofs.</td></tr><tr><td style="text-align:center"><strong>Confidential Sidechains & Cross-Chain</strong></td><td style="text-align:center">Set up confidential sidechains and employ cross-chain protocols to ensure private and composability across blockchains.</td></tr><tr><td style="text-align:center"><strong>Temporal Data Structures</strong></td><td style="text-align:center">Create chronological data structures for secure interactions. Utilize cryptographic methods for data integrity and privacy.</td></tr><tr><td style="text-align:center"><strong>Homomorphic Encryption & MPC</strong></td><td style="text-align:center">Apply homomorphic encryption and MPC for computations on encrypted data and interactions between state layers.</td></tr><tr><td style="text-align:center"><strong>Commit-Reveal Schemes</strong></td><td style="text-align:center">Introduce commit-reveal mechanisms for private transactions, revealing data only post necessary public actions.</td></tr><tr><td style="text-align:center"><strong>Auditability & Verifiability</strong></td><td style="text-align:center">Use on-chain tools for auditing and verifying interactions. Utilize cryptographic commitments for third-party validation.</td></tr><tr><td style="text-align:center"><strong>Data Fragmentation & Sharding</strong></td><td style="text-align:center">Fragment data across shards for private interactions and curtailed data exposure. Bridge shards securely with cryptography.</td></tr><tr><td style="text-align:center"><strong>Ring Signatures & CoinJoin</strong></td><td style="text-align:center">Incorporate ring signatures and CoinJoin protocols to mask transaction details and mix transactions collaboratively.</td></tr></tbody></table></center>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="goal-6-integration-of-defi-protocols-with-a-privacy-preserving-framework">Goal 6: Integration of DeFi Protocols with a Privacy-Preserving Framework<a href="https://research.logos.co/rlog/Nescience-A-zkVM-leveraging-hiding-properties#goal-6-integration-of-defi-protocols-with-a-privacy-preserving-framework" class="hash-link" aria-label="Direct link to Goal 6: Integration of DeFi Protocols with a Privacy-Preserving Framework" title="Direct link to Goal 6: Integration of DeFi Protocols with a Privacy-Preserving Framework"></a></h2>
This endeavor comes with inherent challenges, especially considering the heterogeneity of existing DeFi protocols, predominantly built on Ethereum.
These variations in programming languages and VMs exacerbate the quest for interoperability. Furthermore, the success and functionality of DeFi protocols is closely tied to liquidity,
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="-strategic-roadmap-for-goal-6-"><ins> Strategic Roadmap for Goal 6 </ins><a href="https://research.logos.co/rlog/Nescience-A-zkVM-leveraging-hiding-properties#-strategic-roadmap-for-goal-6-" class="hash-link" aria-label="Direct link to -strategic-roadmap-for-goal-6-" title="Direct link to -strategic-roadmap-for-goal-6-"></a></h2>
<p><em>** Pioneering Privacy-Centric DeFi Models: **</em> Initiate the development of AMMs and staking solutions that are inherently protective of users' transactional privacy and identity.</p>
</li>
<li>
<p><em>** Specialized Smart Contracts with Privacy: **</em> Architect distinct smart contracts infused with privacy elements, setting the stage for secure user interactions within this new, confidential DeFi landscape.</p>
</li>
<li>
<p><em>** Optimized User Interfaces: **</em> Craft interfaces that resonate with user needs, simplifying the journey through the private DeFi space without compromising on security.</p>
</li>
<li>
<p><em>** Tackling Interoperability: **</em></p>
<ul>
<li>
<p>Deploy advanced bridge technologies and middleware tools to foster efficient data exchanges and guarantee operational harmony across a spectrum of programming paradigms and virtual environments.</p>
</li>
<li>
<p>Design and enforce universal communication guidelines that bridge the privacy-centric DeFi entities with the larger DeFi world seamlessly.</p>
</li>
</ul>
</li>
<li>
<p><em>** Enhancing and Sustaining Liquidity: **</em></p>
<ul>
<li>
<p>Unveil innovative liquidity stimuli and yield farming incentives, compelling users to infuse liquidity into the private DeFi space.</p>
</li>
<li>
<p>Incorporate adaptive liquidity frameworks that continually adjust based on the evolving market demands, ensuring consistent liquidity.</p>
</li>
<li>
<p>Forge robust alliances with other DeFi stalwarts, jointly maximizing liquidity stores and honing sustainable token distribution strategies.</p>
</li>
</ul>
</li>
<li>
<p><em>** Amplifying Community Engagement:**</em> Design and roll out enticing incentive schemes to rally users behind privacy-focused AMMs and staking systems,
thereby nurturing a vibrant, privacy-advocating DeFi community.</p>
</li>
</ol>
<p>Through the integration of these approaches, we aim to achieve Goal 6, providing users with a privacy-focused platform for engaging effortlessly in core DeFi functions such as AMMs and staking,
all while effectively overcoming the obstacles related to interoperability and liquidity concerns.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="summary-of-the-architecture">Summary of the Architecture<a href="https://research.logos.co/rlog/Nescience-A-zkVM-leveraging-hiding-properties#summary-of-the-architecture" class="hash-link" aria-label="Direct link to Summary of the Architecture" title="Direct link to Summary of the Architecture"></a></h2>
These proofs ensure that while private state data remains undisclosed, public state transitions can still be carried out and subsequently verified by third parties.
This blend of public and private state is envisaged to be achieved through a state tree representing the public state, while the encrypted state leaves stand for the private state.
Each user's private state indicates validity through the absence of a corresponding nullifier.
A nullifier is a unique cryptographic value generated in privacy-preserving blockchain transactions to prevent double-spending,
Execution-relevant data, like private and public call stacks and additions to the state tree, are incorporated as public inputs.</p>
<p>Our method integrates the verification keys for these functions within a merkle tree. Here's the innovation: a user's ZKP showcases the existence of the verification key in this tree, yet keeps the executed function concealed.
The unique function identifier can be presented as the verification key, with all contracts merkleized for hiding functionalities.</p>
<p>We suggest a nuanced shift from the ZEXE protocol's identity function, which crafts an identity for smart contracts delineating its behavior, access timeframes, and other functionalities.
Instead of the ZEXE protocol's structure, our approach pivots to a method anchored in the
security of a secret combined with the uniqueness from hashing with the contract address.
The underlying rationale is straightforward: the sender, equipped with a unique nonce and salt for the transaction, hashes the secret, payload, nonce, and salt.
This result is then hashed with the contract address for the final value. The hash function's unidirectional nature ensures that the input cannot be deduced easily from its output.
A specific concern, however, is the potential repetition of secret and payload values across transactions, which could jeopardize privacy.
Yet, by embedding the function's hash within the hash of the contract address, users can validate a specific function's execution without divulging the function, navigating this limitation.</p>
<p>Alternative routes do exist: We could employ signature schemes like ECDSA, focusing on uniqueness and authenticity, albeit at the cost of complex key management.
Fully Homomorphic Encryption (FHE) offers another pathway, enabling function execution on encrypted data, or Multi-Party Computation (MPC) which guarantees non-disclosure of function or inputs.
Yet, integrating ZKPs with either FHE or MPC presents a challenge. Combining cryptographic functions like SHA-3 and BLAKE2 can also bolster security and uniqueness.
It's imperative to entertain these alternatives, especially when hashing might not serve large input/output functions effectively or might fall short in guaranteeing uniqueness.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="current-state">Current State<a href="https://research.logos.co/rlog/Nescience-A-zkVM-leveraging-hiding-properties#current-state" class="hash-link" aria-label="Direct link to Current State" title="Direct link to Current State"></a></h2>
our current focus narrows onto the realization of Goal 2 and Goal 3.</p>
<p>Our endeavors to build a powerful virtual machine tailored for Zero-Knowledge applications have led us down the path of rigorous exploration and testing.
We believe that integrating the right proof system is pivotal to our project's success, which brings us to Nova [<a href="https://eprint.iacr.org/2021/370" target="_blank" rel="noopener noreferrer">8</a>].
In our project journey, we have opted to integrate the Nova proof system, recognizing its potential alignment with our overarching goals.
However, as part of our meticulous approach to innovation and optimization, we acknowledge the need to thoroughly examine Nova’s performance capabilities,
particularly due to its status as a pioneering and relatively unexplored proof system.</p>
<p>This critical evaluation entails a comprehensive process of benchmarking and comparative analysis <a href="https://github.com/vacp2p/zk-explorations" target="_blank" rel="noopener noreferrer">[9]</a>,
pitting Nova against other prominent proof systems in the field, including Halo2 [<a href="https://electriccoin.co/blog/explaining-halo-2/" target="_blank" rel="noopener noreferrer">10</a>],
This ongoing and methodical initiative is designed to ensure a fair and impartial assessment, enabling us to draw meaningful conclusions about Nova’s strengths and limitations in relation to its counterparts.
By leveraging the Poseidon recursion technique, we are poised to conduct an exhaustive performance test that delves into intricate details.
Through this testing framework, we aim to discern whether Nova possesses the potential to outshine its contemporaries in terms of efficiency, scalability, and overall performance.
The outcome of this rigorous evaluation will be pivotal in shaping our strategic decisions moving forward.
Armed with a comprehensive understanding of Nova’s performance metrics vis-à-vis other proof systems,
we can confidently chart a course that maximizes the benefits of our project’s optimization efforts.</p>
<p>Moreover, as we ambitiously pursue the establishment of a robust mechanism for proof creation and verification, our focus remains resolute on preserving user privacy,
and tutorials to aid users in this intricate process.</p>
<p>Parallelly, we're looking into decentralized verification processes, harnessing the strength of multiple external provers that cross-verify each other's work.
This intricate balance, while challenging, aims to fortify our system against potential adversarial actions, aligning incentives, and preserving the overall integrity of the project.</p>
<h1>References</h1>
<p>[1] Nakamoto, S. (2008). Bitcoin: A Peer-to-Peer Electronic Cash System. Retrieved from <a href="https://bitcoin.org/bitcoin.pdf" target="_blank" rel="noopener noreferrer">https://bitcoin.org/bitcoin.pdf</a></p>
<p>[2] Sanchez, F. (2021). Cardano’s Extended UTXO accounting model. Retrived from <a href="https://iohk.io/en/blog/posts/2021/03/11/cardanos-extended-utxo-accounting-model/" target="_blank" rel="noopener noreferrer">https://iohk.io/en/blog/posts/2021/03/11/cardanos-extended-utxo-accounting-model/</a></p>
<p>[3] Morgan, D. (2020). HD Wallets Explained: From High Level to Nuts and Bolts. Retrieved from <a href="https://medium.com/mycrypto/the-journey-from-mnemonic-phrase-to-address-6c5e86e11e14" target="_blank" rel="noopener noreferrer">https://medium.com/mycrypto/the-journey-from-mnemonic-phrase-to-address-6c5e86e11e14</a></p>
<p>[4] Wuille, P. (012). Bitcoin Improvement Proposal (BIP) 44. Retrieved from <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank" rel="noopener noreferrer">https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki</a></p>
<p>[5] Jedusor, T. (2020). Introduction to Mimblewimble and Grin. Retrieved from <a href="https://github.com/mimblewimble/grin/blob/master/doc/intro.md" target="_blank" rel="noopener noreferrer">https://github.com/mimblewimble/grin/blob/master/doc/intro.md</a></p>
<p>[6] Bitcoin's official wiki overview of the CoinJoin method. Retrieved from <a href="https://en.bitcoin.it/wiki/CoinJoin" target="_blank" rel="noopener noreferrer">https://en.bitcoin.it/wiki/CoinJoin</a></p>
<p>[7] TornadoCash official Github page. Retrieved from <a href="https://github.com/tornadocash/tornado-classic-ui" target="_blank" rel="noopener noreferrer">https://github.com/tornadocash/tornado-classic-ui</a></p>
<p>[8] Kothapalli, A., Setty, S., Tzialla, I. (2021). Nova: Recursive Zero-Knowledge Arguments from Folding Schemes. Retrieved from <a href="https://eprint.iacr.org/2021/370" target="_blank" rel="noopener noreferrer">https://eprint.iacr.org/2021/370</a></p>
<p>[10] Electric Coin Company (2020). Explaining Halo 2. Retrieved from <a href="https://electriccoin.co/blog/explaining-halo-2/" target="_blank" rel="noopener noreferrer">https://electriccoin.co/blog/explaining-halo-2/</a></p>
<section data-footnotes="true" class="footnotes"><h2 class="anchor anchorWithHideOnScrollNavbar_WYt5 sr-only" id="footnote-label">Footnotes<a href="https://research.logos.co/rlog/Nescience-A-zkVM-leveraging-hiding-properties#footnote-label" class="hash-link" aria-label="Direct link to Footnotes" title="Direct link to Footnotes"></a></h2>
<p>As the world becomes increasingly connected through the internet, the need for secure and reliable communication becomes paramount. In <a href="https://research.logos.co/wakuv2-noise" target="_blank" rel="noopener noreferrer">this article</a> it is described how the Noise protocol can be used as a key-exchange mechanism for Waku.</p>
<p>Recently, this feature was introduced in <a href="https://github.com/waku-org/js-noise" target="_blank" rel="noopener noreferrer">js-waku</a> and <a href="https://github.com/waku-org/go-waku" target="_blank" rel="noopener noreferrer">go-waku</a>, providing a simple API for developers to implement secure communication protocols using the Noise Protocol framework. These open-source libraries provide a solid foundation for building secure and decentralized applications that prioritize data privacy and security.</p>
<p>This functionality is designed to be simple and easy to use, even for developers who are not experts in cryptography. The library offers a clear and concise API that abstracts away the complexity of the Noise Protocol framework and provides an straightforward interface for developers to use. Using this, developers can effortlessly implement secure communication protocols on top of their JavaScript and Go applications, without having to worry about the low-level details of cryptography.</p>
<p>One of the key benefits of using Noise is that it provides end-to-end encryption, which means that the communication between two parties is encrypted from start to finish. This is essential for ensuring the security and privacy of sensitive information</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="device-pairing">Device Pairing<a href="https://research.logos.co/rlog/device-pairing-in-js-waku-and-go-waku#device-pairing" class="hash-link" aria-label="Direct link to Device Pairing" title="Direct link to Device Pairing"></a></h3>
<p>In today's digital world, device pairing has become an integral part of our lives. Whether it's connecting our smartphones with other computers or web applications, the need for secure device pairing has become more crucial than ever. With the increasing threat of cyber-attacks and data breaches, it's essential to implement secure protocols for device pairing to ensure data privacy and prevent unauthorized access.</p>
<p>To demonstrate how device pairing can be achieved using Waku and Noise, we have examples available at <a href="https://examples.waku.org/noise-js/" target="_blank" rel="noopener noreferrer">https://examples.waku.org/noise-js/</a>. You can try pairing different devices, such as mobile and desktop, via a web application. This can be done by scanning a QR code or opening a URL that contains the necessary data for a secure handshake.</p>
<p>The process works as follows:</p>
<p>Actors:</p>
<ul>
<li>Alice the initiator</li>
<li>Bob the responder</li>
</ul>
<ol>
<li>The first step in achieving secure device pairing using Noise and Waku is for Bob generate the pairing information which could be transmitted out-of-band. For this, Bob opens <a href="https://examples.waku.org/noise-js/" target="_blank" rel="noopener noreferrer">https://examples.waku.org/noise-js/</a> and a QR code is generated, containing the data required to do the handshake. This pairing QR code is timeboxed, meaning that after 2 minutes, it will become invalid and a new QR code must be generated</li>
<li>Alice scans the QR code using a mobile phone. This will open the app with the QR code parameters initiating the handshake process which is described in <a href="https://github.com/waku-org/specs/blob/master/standards/application/device-pairing.md/#protocol-flow" target="_blank" rel="noopener noreferrer">WAKU2-DEVICE-PAIRING</a>. These messages are exchanged between two devices over Waku to establish a secure connection. The handshake messages consist of three main parts: the initiator's message, the responder's message, and the final message, which are exchanged to establish a secure connection. While using js-noise, the developer is abstracted of this process, since the messaging happens automatically depending on the actions performed by the actors in the pairing process.</li>
<li>Both Alice and Bob will be asked to verify each other's identity. This is done by confirming if an 8-digits authorization code match in both devices. If both actors confirm that the authorization code is valid, the handshake concludes succesfully</li>
<li>Alice and Bob receive a set of shared keys that can be used to start exchanging encrypted messages. The shared secret keys generated during the handshake process are used to encrypt and decrypt messages sent between the devices. This ensures that the messages exchanged between the devices are secure and cannot be intercepted or modified by an attacker.</li>
</ol>
<p>The above example demonstrates device pairing using js-waku. Additionally, You can also try building and experimenting with other noise implementations like nwaku, or go-waku, with an example available at <a href="https://github.com/waku-org/go-waku/tree/master/examples/noise" target="_blank" rel="noopener noreferrer">https://github.com/waku-org/go-waku/tree/master/examples/noise</a> in which the same flow described before is done with Bob (the receiver) using go-waku instead of js-waku.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="conclusion">Conclusion<a href="https://research.logos.co/rlog/device-pairing-in-js-waku-and-go-waku#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion"></a></h3>
<p>With its easy to use API built on top of the Noise Protocol framework and the LibP2P networking stack, if you are a developer looking to implement secure messaging in their applications that are both decentralized and censorship resistant, Waku is definitely an excellent choice worth checking out!</p>
<p>Waku is also Open source with a MIT and APACHEv2 licenses, which means that developers are encouraged to contribute code, report bugs, and suggest improvements to make it even better.</p>
<p>Don't hesitate to try the live example at <a href="https://examples.waku.org/noise-js" target="_blank" rel="noopener noreferrer">https://examples.waku.org/noise-js</a> and build your own webapp using <a href="https://github.com/waku-org/js-noise" target="_blank" rel="noopener noreferrer">https://github.com/waku-org/js-noise</a>, <a href="https://github.com/waku-org/js-waku" target="_blank" rel="noopener noreferrer">https://github.com/waku-org/js-waku</a> and <a href="https://github.com/waku-org/go-waku" target="_blank" rel="noopener noreferrer">https://github.com/waku-org/go-waku</a>. This will give you a hands-on experience of implementing secure communication protocols using the Noise Protocol framework in a practical setting. Happy coding!</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="references">References<a href="https://research.logos.co/rlog/device-pairing-in-js-waku-and-go-waku#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References"></a></h3>