<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>alex hook</title>
        <link>https://paragraph.com/@alexhook</link>
        <description>Founder of Untron.finance.

change the world. start with money</description>
        <lastBuildDate>Mon, 15 Jun 2026 01:16:10 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>alex hook</title>
            <url>https://storage.googleapis.com/papyrus_images/b03d614231eacc42e8577ac8d89cc2dbce624ea08c96703a62338207be15538f.jpg</url>
            <link>https://paragraph.com/@alexhook</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[Some steps toward rollup interoperability]]></title>
            <link>https://paragraph.com/@alexhook/some-steps-toward-rollup-interoperability</link>
            <guid>XosQsIRmXSjHU0Q3ry5y</guid>
            <pubDate>Tue, 25 Jun 2024 07:21:32 GMT</pubDate>
            <description><![CDATA[As a rollup-centric ecosystem enthusiast, I’ve always been interested in solutions that improve rollup interoperability. Moreover, the sole reason I created this blog was to promote a message of the importance of interoperability in this area. Then, I realized that writing articles is an excellent way to consolidate my understanding of a certain topic and help people understand it, and now I’m here. As every day in crypto is learning new things, it should seem obvious that today, I see the vi...]]></description>
            <content:encoded><![CDATA[<p>As a rollup-centric ecosystem enthusiast, I’ve always been interested in solutions that improve rollup interoperability. Moreover, the sole reason I created this blog was to promote <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/alexhook.eth/g8FifgWnh6w9fIXX4DJrZXFf3nsr0dPgARrdFtzbHNs">a message of the importance of interoperability</a> in this area. Then, I realized that writing articles is an excellent way to consolidate my understanding of a certain topic and help people understand it, and now I’m here.</p><p>As every day in crypto is learning new things, it should seem obvious that today, I see the vision of <em>“Rollup interoperability is crucial for Ethereum future“</em>-era me as pretty outdated. From the POV of philosophy, I still follow the same vision - <strong>rollup interoperability is absolutely crucial for the future of Ethereum</strong>, and the entire ecosystem should work on solutions that improve it. From the POV of technology, however, I learned a lot of new ideas about this topic and changed my mind about some things.</p><p>To understand the material below, it’s helpful to have a basic understanding of rollups <em>and</em> the problem of their interoperability. If you don’t, my article <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/alexhook.eth/y9PTlM6tVr0H8X68r1LV2UwAnT9D6u1MEEiUFvcpyG0">“Dr. Dankshard or How I learned to stop worrying and love rollups“</a> is a great introduction.</p><hr><p><strong>Merhaba!</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2560617904886999ed8aa7e32806a6203c05f2f85ee905bec29590ef65e9e463.png" alt="Istanbul, L2DAYS, 14th November 2023. Myself staying at the food court to the side of the conference building. Mosyo Coffee, where zkCafe took place, is on the front." blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Istanbul, L2DAYS, 14th November 2023. Myself staying at the food court to the side of the conference building. Mosyo Coffee, where zkCafe took place, is on the front.</figcaption></figure><p>It’s the evening of 13th November, the first day of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://devconnect.org/istanbul">Devconnect Istanbul</a>. As a massive fan of zkSync, I decided to attend zkSync Connect as my first event at this summit, the first of my life. There, I met a guy, and together, we headed to “Mosyo Coffee,“ as stated on the Luma page of zkCafe. There were two of them in that area, and we found the right place only by the evening.</p><p>It was much darker than in the photo above and was pouring downpour. Staying at the edge of the roof on which the food court was located and drinking a coffee we bought for free tokens on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://getclave.io">Clave</a>, I told my new friend about my idea for a hackathon project.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/87366320f04f00a3a5ea3a0ae6c17d2130bd4e6ab48d7540e728ac7e99d7eef2.png" alt="That one coffee. Cost me 3 WEN." blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">That one coffee. Cost me 3 WEN.</figcaption></figure><p>There are “mini-accounts” - <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ercs.ethereum.org/ERCS/erc-4337">ERC-4337</a> (AA) accounts, whose validating logic is not a signature check but the existence of the operation’s hash in the single inbox bridge on its L2. The hash must be sent from its parent address on a specific source chain. The parent address is your main smart wallet on any L2 or Ethereum L1. To interact with another L2, you:</p><ul><li><p>Deploy the mini-account on it and set your main wallet as the parent address. Anyone can do the deployment; thus, it can be funded by the protocol or your wallet provider.</p></li><li><p>Send the hash of the user operation you want to send to the inbox bridge on your L2 and set the destination chain ID.</p></li><li><p>This hash gets bundled with other hashes and sent to the L1. The smart contract on L1 forwards this bundle to the destination L2, and the inbox bridge unbundles the hashes so that the mini accounts can read them.</p></li><li><p>The sender adds a small fee to its hash to incentivize initiators of the transactions on the protocol’s smart contracts.</p></li><li><p>When the hash reaches the destination L2, you send your user operation to the AA mempool on this L2. By utilizing the ERC-4337 standard, we don’t have to reimplement our own mini-account mempool and the protocol can be easily integrated into wallets with an already existing codebase.</p></li></ul><p>Shortly speaking, I was going to create an L1-based bridge that sends transactions from the smart wallet on your L2 to any L2 you want to interact with. I ended up <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/alexhooketh/xtra-protocol">almost implementing it at the hackathon</a> but couldn’t finish it due to having little experience and working solo. After explaining it to the friend, he asked me:</p><blockquote><p>Why doesn’t one just change the network on their wallet and use token bridges to move the needed funds to the needed network?</p></blockquote><p>I answered: This is absolutely an option if one uses an EOA wallet. EOA wallets act the same in all EVM networks and share the same address, so you can send transactions in all of them by just changing the network in your wallet settings.</p><p>However, the area is migrating to Account Abstraction-based smart accounts. These accounts allow us to add any functionality we want to our wallets programmatically. P256 signatures make it possible to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/0x8958D0c419BCDFB8A86b8c0089552bE015fbe364/hvpY_houtY9gGDnT8-jthCmE963EawYnyITogyNP_ZU">use secure chips in our phones</a> to sign transactions. Through social recovery, we can add our relatives as guardians authorized to recover our wallets, eliminating unsafe seed phrases. Paymaster technology allows us to pay the gas fee in any token or even <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://x.com/getclave/status/1779082777012670532">make someone pay the fee for us</a>. When quantum computers start breaking classic signature schemes, we can just change the scheme in our AA wallets to a quantum-safe one without creating a new wallet. This list can be continued endlessly, as Account Abstraction essentially allows us to use executable programs as full-fledged wallets.</p><p>All this comes at a cost: One can’t easily migrate their wallets to another chain because, besides moving the funds through the bridge, it requires redeploying the entire account with all the keys, guardians, and settings. In some cases, this might be too complicated or even impossible—say, in rollups that don’t support <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://getclave.notion.site/2295a4513abe46f5a49a41097b88def0?v=e430de5755d9436c8e1de2c9cc9932a1&amp;pvs=4">the P256 precompile</a>, this signature scheme might be too expensive to use.</p><p>This is why I made that protocol. Essentially, you have AA accounts on many L2s. To send a transaction from them, you must verify your intent by sending a hash of it from your main account on a specific L2 to those “mini-accounts“ through the L1 bridge messaging. In fact, this way, you don’t get rid of multiple wallets; you simply move all the verification logic to a single “parent” account.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d1958c0f3a07b6f41d2338532fa1f44ee9ee9f75b5029204bbc0f8ff305430b0.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Another interesting detail of such a protocol is that it allows for interoperability not only with L2s but with all L1s sidechains, as they have enshrined bridges with Ethereum—Polygon PoS, Ronin, Gnosis, and Avalanche are what I can think of. However, it was designed as a rollup-centric interoperability protocol, so this is just a fun technological fact.</p><p>While the idea of the project was pretty clever, the practical implementation had a significant drawback: <strong>speed</strong>.</p><p>The entire design relies on canonical rollup bridges connected to Ethereum L1. Rollup bridges are peculiar in that they prove their state to their smart contracts on Ethereum to inherit its security. As you may already know, optimistic and ZK verification are the two most popular ways to do this.</p><p>Optimistic verification works by opening a “challenge window,“ usually about seven days, in which the challengers can send a fraud proof that points to any invalid part of the transaction batch. If this proof is valid, the rollup reorgs its blockchain to delete this batch. After seven days with no fraud proofs, the batch is automatically considered valid, and all messages and withdrawals are finalized on Ethereum.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8e94e3b7ffd361b5e7e9eb83f7ff6fd18263de3a512ae910b90a7219130911ef.png" alt="Screenshot from docs.optimism.io" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Screenshot from docs.optimism.io</figcaption></figure><p>You probably already figured it out. Due to a 7-day delay in messaging to L1, sending cross-chain transactions from an optimistic rollup is a <strong>terrible</strong> idea. Why? Well, will you wait for your DEX swap for a week? What’s going to happen with the price by this time?..</p><p>Sending cross-chain transactions <em>to</em> the optimistic rollup is much better. Even though the OP Stack sequencer waits a few blocks before processing the message to minimize the possibility of reorgs, waiting a few minutes for your transaction is already somewhat acceptable for some tasks. Moreover, the Ethereum community is currently working on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum.org/en/roadmap/single-slot-finality/">single-slot finality</a>, which will make every block finalize separately, making them irreversible by their next block. After it’s implemented, messaging from L1 to L2 will take about 12 seconds.</p><p>Hosting such accounts on ZK rollups would be better, but still not very usable. As we can see from the stats below, ZKsync Era finalizes in 21 hours, Linea in 5 hours, Starknet in 9 hours, etc.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/11132f8d1b1ce81c00a6c1c98587323bdf4a0ea5746f568bb96eb587d709db31.png" alt="Screenshot from l2beat.com/scaling/finality" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Screenshot from l2beat.com/scaling/finality</figcaption></figure><p>But why is it like this? Isn’t ZK proof generation fast on powerful clusters? In short, there are two problems:</p><ul><li><p>Some ZK rollups, such as ZKsync Era, set execution delays so that the security council has time to revert some batches in case of a bug in their proof system. zkEVMs are really complicated pieces of technology, and due to this complexity, probabilistically preventing bugs by using multiple proof systems at once is not yet feasible.</p></li><li><p>Even though ZK proof verification is very light compared to the computations it proves, verifying it on-chain is still pretty expensive. Depending on the proof system, it can take up to a million gas per verification. Taking the average gas price of 9 gwei and today’s ETH prices, a single proof costs about $30 only for verification on L1.</p><p>Modern ZK rollups minimize these expenses by generating one proof for many batches once per a certain amount of time, but this slows bridge finality speed. Generating a batch and proving it every block makes $30 per block or <strong>$216,000 per day</strong>. At 100 TPS, this is about $0.025 per transaction just for verification costs. And we’ve also got to generate the proof and publish the batch on-chain!</p></li></ul><p>Waiting an hour or two for a transaction is still too long. What can we do about it?</p><hr><p>First of all, let’s forget my eight-month-old hackathon project and try to eliminate the mental model that every transaction needs to be initiated from our main smart wallet. Why do we even need to share our smart wallet logic in every rollup? Why don’t we just generate temporary EOAs, bridge the funds from our main smart wallet there, do some work we want to do, and bridge what’s left back?</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/757783d47118e7efaa52693cd6c542b1b21d51de33efc771dc41ba78186b3ac5.jpg" alt="I came up with this thought while looking at Clave&apos;s UI " blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">I came up with this thought while looking at Clave&apos;s UI</figcaption></figure><p>My <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://getclave.io">Clave</a> (or whatever smart wallet you’re using) has Secure Enclave signing and social recovery, so I can always be safe about my funds there, even if I lose my phone. And who cares what happens with those temporary accounts? I’ve already done my stuff with them; all funds are on my Clave now.</p><p>However, this approach has a fundamental problem: the assumption that you can’t use the same wallet on other chains on a regular basis heavily restricts the number of tasks you can do on them. For example, you can’t create a deposit in a local lending platform because you can’t migrate it to your main network <em>(ZKsync Era in this case)</em>. You can’t get tokens that don’t have a fungible equivalent in your main network (e.g., if they’re natively minted on that network). You can’t participate in a local DAO because your votes have to stay in that temporary account. Essentially, all you can do as a user is disperse funds to multiple recipients without bridging each time and get better liquidity for a swap to a token that can be bridged back to your main chain.</p><p>Thus, to make these wallets useful, we have to access them using the same rules we use on our main smart wallets—secure enclaves, social recovery, etc. So, we get back to the idea above and its infeasibility. There is, however, a <em>feasible palliative</em> that can give these mini-accounts only <em>recovery</em> properties of our main wallet:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f42127672e1f9ab73d965489cf3f187fc6f290fe41fb3318ea554ec320839025.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>We create the same mini-accounts described earlier but allow one key to send transactions from them directly. Our parent wallet can now change this key through the L1-based bridge or make the mini-account read it from the parent L2’s state. This way, if the temporary key is lost, the parent wallet can initiate a key change through the slow but atomic L1-based bridge.</p><blockquote><p><em>Atomicity — the property of an action that doesn’t allow it to fail during execution. Either it wasn’t initiated, or it was done.</em></p><p><em>L1-based bridges are atomic because the message can’t be lost if it’s sent. Ordering, availability, and authenticity are guaranteed by the Ethereum L1.</em></p></blockquote><p>This is much better! Now, ordinary transactions only take time for token bridging. After the tokens are at the destination, sending transactions is as fast as if it’s your main chain. If you lose the key, you’ll have to wait from several hours to 7 days, depending on the chain of your parent wallet, but you won’t use it very often, so the trade-off is acceptable for most use cases. Also, it’s feasible to implement in wallets even today. <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/alexhooketh/unclave">I even made my own implementation</a>, but it’s not by any means secure or production-ready and is meant only for visualization purposes.</p><p>A similar technique is used in Web3 futures trading platforms: you approve the token in pair (usually USDC) to the smart contract and assign a temporary key for spending, which is stored on the platform’s frontend. This allows users to perform fast actions without signing each action with their main wallet. If you change your device or clear the data in your browser, you can just re-assign the key using your main wallet.</p><p>But, just as with everything in crypto, this approach is not perfect either. It has two disadvantages:</p><ul><li><p>Even though mini-accounts can be ERC-4337-compliant and thus support all its features, such as batching, paymasters, spending limits, etc, these features are no longer inherited from the parent account. In fact, the parent account just acts as a single social recovery guardian for the mini-account, but the guardian is the user themselves.</p></li><li><p>Token bridging must be accomplished using external bridges. With cross-chain transaction initiation, we can carry our tokens with the message, receiving them practically 1:1 in an atomic way. However, with this solution, this is no longer an option, so external bridging is the only fast option left.</p></li></ul><p>Even though modern bridges <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://x.com/therollupco/status/1757236188132352436">can transfer funds in a few seconds</a>, they a) take a fee that can get <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://x.com/alexhooketh/status/1800612772809425223">awfully high on large transfers</a>, b) are not atomic, and don’t inherit Ethereum’s security properties.</p><p>At this point, it’s worth taking a note about security properties. Using external bridges to transfer tokens is somewhat acceptable, unlike using them to pass messages to operate mini-accounts. The reason is their worst cases, likely due to an attack on them:</p><ul><li><p><em>In token bridging,</em> the worst that can happen is that you won’t receive the tokens you sent. In such case, you lose X tokens you wanted to bridge and switch to another bridge.</p></li><li><p><em>In cross-account messaging,</em> the worst that can happen is that all your mini-accounts can be stolen by passing impersonating messages through the bridge. In such case, you lose your wallets on all chains with all their value, except your main one.</p></li></ul><p>So, relying on external bridges for token bridging is pretty much an option as long as one has no efficient way to bridge them in an atomic way using L1.</p><hr><p>Suppose we want to <em>validate</em> all transactions in a single place, for example, to natively transfer tokens between accounts or verify signatures with a unique precompile. In that case, we face the slow finality of today’s ZK rollups.</p><p>Let’s return for a little while to think of what can be improved with the previous technique. Why do rollups have slow bridge finality? We’ll take ZK rollups as a target because, with optimistic ones, the reason is already apparent:</p><ul><li><p>ZK proof systems for full-fledged VM environments are complicated, especially if the environment is not ZK-friendly (EVM). Therefore, there is a high chance that they will contain bugs. Multiple proof systems can prevent this, but such are very complicated to implement, and generating multiple proofs for a single batch may be too slow and expensive.</p><p>As a workaround, rollup teams enable execution delays, which allow them to roll back the chain in an emergency. This is what slows the bridge finality in some rollups (e.g., ZKsync Era).</p></li><li><p>Proposing the new state and ZK proving it to L1 are pretty expensive tasks, so to minimize costs, the rollup sequencers do it every few hours rather than every block.</p><p>There is an exception, however; <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://l2beat.com/scaling/liveness">Scroll proposes the state about every minute</a>, but a) proof verifying is still done every few hours, so it stays unverified, and b) Scroll is one of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://l2beat.com/scaling/costs?sort-by=total-cost&amp;sort-order=desc">the most expensive rollups</a> to use today.</p></li></ul><p>If we rephrase it even more simply, the problems are proving costs and verifying costs. Let’s look at each problem and ways to solve it.</p><p>Essentially, our task is to make our smart wallet on a rollup quickly interoperate with other rollups without additional trust assumptions brought by external bridges. Smart wallets typically consist of a few usual AA features—paymasters, social recovery, secure enclaves, spending limits, etc.—and the main operation that allows us to send on-chain transactions from it.</p><p>Why do we need the main operation if we want to use the other rollups from our wallet? Because it is probably hosted on a multipurpose rollup—Arbitrum, Base, ZKsync Era—and we want to interact with users and smart contracts on this rollup, too.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/bc086cc3772bbc12618ea89194721d2d5b22eb6c4f0a74d0258dd1a44ea30482.png" alt="In this particular case, it would make sense to simply use external token bridges. Just replace the task with, for example, interaction with a dApp in the same rollup and another one" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">In this particular case, it would make sense to simply use external token bridges. Just replace the task with, for example, interaction with a dApp in the same rollup and another one</figcaption></figure><p>This multipurposeness is what introduces complexity to the proof system of the rollups. Verifying the state of the entire virtual machine with lots of smart contracts and transactions happening every second is a pretty tall order. We want to execute two types of tasks that require a completely different set of features in the rollup: for an on-chain transaction, it is fast L2 inclusion, low L2 fees, and wide functionality of VM, and for a multi-rollup transaction, it’s fast bridge finality.</p><p><em>But what if we just get rid of the virtual machine</em> and build a rollup that can only handle smart accounts and messaging to the other L2s? Vitalik Buterin proposed a similar technique at just about the time of Devconnect Istanbul:</p><hr><p><strong>Keystore rollups</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/955071ce89e70a2e451a197816dd5bb2ac736a91d634b5f4caa8a539bd662a51.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>The idea is to create a ZK rollup that can only store the account keys and change them using another key. This rollup pushes the root of the Merkle tree that contains all these keys to L1. Then, when you want to send a transaction from one of your smart accounts on L2s, you generate the Merkle proof of your current key, and your account verifies it against the keystore root available on the L1. Now, it knows your key and can use it to verify your signatures.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/344f64864ee8d2e951d6d86a4ba828c3333baffdd51ed0b568d78642f781e737.png" alt="Add a Merkle or KZG proof check to it, and this is what it looks like" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Add a Merkle or KZG proof check to it, and this is what it looks like</figcaption></figure><p>Such rollup is very simple, and multiple proof systems can easily be implemented, so keys stored in it are actually as secure as the L1.</p><p>Besides Vitalik’s original design, there are three leading ones for keystore rollups:</p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://scroll.io/blog/towards-the-wallet-endgame-with-keystore">Scroll’s</a> approach is to store keystore data on L1 but allow updating it from their zkEVM rollup. For this, they’re introducing an L1SLOAD precompile that allows for cheap reads of L1 storage. Then, AA accounts on other L2s can read this data to synchronize their configuration—keys, guardians, etc.</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://hackmd.io/@mdehoog/mksr">Base team</a> is exploring a technique where only the state root is stored on L1, but transactions are sequenced using calldata, so the tree can always be rebuilt. Accounts on L2s are expected to fetch current keys using Merkle proofs.</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/stackrlabs.eth/4kLzcBdvWnvECxOnaGQ8prAqUZEzj4BoDoXqSSXiV6w">Stackr’s</a> design is very similar to Base&apos;s or Vitalik&apos;s, but it utilizes its own framework of “micro-rollups“ with specialized minimal VMs.</p></li></ul><p>Generally speaking, they differ in the number of tasks delegated to off-chain processing (in other words, how many things are on L2) and their implementation details.</p><p>We can expand this idea further by handling <em>not only the keys</em> but also the <strong>entire smart account logic</strong>. This wouldn’t be much more computationally difficult, either; essentially, we only need to handle these tasks:</p><ul><li><p><strong>Sending data to L1:</strong> Accounts on the keystore rollup must be able to notify L1 about their transaction intent. Storing the entire transaction on L1 is not necessary; something like a root of a Merkle tree with all hashes of the user operations would be enough. Then, all that’s needed to send a transaction from a mini-account is reading the root from the destination L2 and making proof that a certain AA operation was actually requested from the parent account.</p></li><li><p><strong>Signature checks:</strong> The user signs the hash of the user operation they want to execute on a certain rollup. The keystore rollup verifies the signature to prove intent and adds the hash to the tree to then push it to the L1. A few signature schemes, such as <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.evm.codes/precompiled#0x01?fork=cancun">ECDSA</a>, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7212.md">P256</a>, and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://en.wikipedia.org/wiki/Lamport_signature">quantum-safe ones</a>, are enough.</p></li><li><p><strong>Social recovery:</strong> Make the other, purposefully chosen accounts, called “guardians,“ vote for the key change on the user’s account. The user can set the guardians and threshold and ask them for recovery in case of key loss. We can also implement <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://blog.getclave.io/recovery-for-everyone-cloud-and-guardians">veto-based recovery</a> or alternative guardian schemes such as <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://blog.getclave.io/universal-recovery-a-social-recovery">ZK-Email</a>, ZK-OTP, or <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://pluto.xyz">Web Proofs</a> to expand social recovery outside the rollup’s users.</p></li><li><p><strong>Spending rules:</strong> In case the wallet is stolen, spending rules controlled by guardians can greatly decrease potential losses before the user recovers the wallet. This feature is also helpful for saving funds or, for example, making wallets for children—parents can send an allowance and restrict how much of it can be spent so that the child can learn to save.</p></li><li><p><strong>Token balances:</strong> This might seem unnecessary, but being able to store crypto <em>inside</em> the keystore rollup dramatically increases the security of users’ assets by not separating them into multiple mini-accounts. Also, it allows for many features that enhance user experience:</p></li><li><p><strong>Paymasters:</strong> The rollup may offer free transactions to attract new users or allow them to pay the fee with any token rather than only ETH. More complicated paymaster logic can be implemented, too—for example, the sequencer can take a fee from the swap on another chain when it’s bridged back to the keystore rollup.</p></li><li><p><strong>Internal token transfers:</strong> Besides instantly sending funds between rollup users, direct transfers are also helpful for implementing intent-based bridges with other rollups that have too slow finality to use L1 to bridge from the mini-account to the parent account on the keystore rollup. This way, the keystore rollup can essentially act as a hub to transfer tokens between mini-accounts on dozens of various L2s cheaply.</p></li></ul><p>Such a system is much technically simpler than a full VM inside of a rollup, so it’s feasible to generate proofs for multiple proof systems simultaneously, and the complexity of proof generation will still be much less.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6d2db35a4fa96c9fed3e919f62ff29659cc9d8ea2f5d11d529a19111b569dd4c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>However, proof verification is still a problem. As we’ve calculated before, its gas cost can be up to 1M gas or ~$25-50, depending on the gas price. This cost is fixed and doesn’t depend on the number of transactions in the batch. This means that if there are too few transactions, the fee for each transaction can be very high. There are two main ways to reduce this cost:</p><p><strong>Aligned Layer</strong></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://alignedlayer.com">Aligned</a> is an EigenLayer AVS that utilizes restaking operators to verify ZK proofs cheaply. If you’re not familiar with EigenLayer, this is a simplified summary of how proofs are verified in Aligned:</p><ol><li><p>A user sends the proof verification request to the network and pays the fee for it;</p></li><li><p>Aligned operators, each of which is an Ethereum validator with their deposits bonded, verify the proof on their nodes and sign for its validity;</p></li><li><p>When 2/3 operators sign for the proof, the aggregated signature is sent and verified on Ethereum L1.</p></li><li><p>If an invalid proof has reached finality, validators who signed for it can be slashed by verifying it on-chain. This way, the proof gets economic security equal to 2/3 of the total stake of Aligned operators.</p></li></ol><p>This approach has an obvious drawback—Ethereum no longer guarantees proof validity. If the TVL of the rollup’s bridge is higher than 2/3 of the total Aligned stake, attacking it becomes profitable. And since we’re talking about the finality latency of 1-2 blocks, we can’t optimistically prevent the attack.</p><p>However, this might be a relatively safe option as long as the rollup doesn’t get too large. When it does, the transaction demand could already make L1 proof verification worthwhile. According to docs, verifying the ZK proof using Aligned costs about 3000 gas, which is nearly free even for Ethereum L1.</p><p><strong>Proof aggregation layers</strong></p><p>If you’re uncomfortable introducing additional trust assumptions to the system, or your protocol has already become too large, but its transaction demand has not, there’s an alternative.</p><p>ZK and rollup teams have recently started actively working on proof aggregation protocols. If you’re not very familiar with ZK, proof aggregation is when a ZK proof proves the validity of another ZK proof (that can, in turn, prove another proof, and so on), thus “aggregating“ them in the single proof and essentially moving all their verifying costs to proving costs. What’s left is verifying a single ZK proof on-chain and being sure about the validity of all the other ZK proofs it proves. Phew!</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/af48f53c891aa1fa83e31d280dc073c3cfd4b5fbd815959e87d693e14439f6e1.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Proof aggregation makes sense where verifying costs are higher than proving aggregating proofs. That is, aggregation becomes profitable if the cost of generating a proof for ten proofs and verifying it is less than verifying these ten proofs independently. This is even more helpful in Ethereum L1, which is heavily restricted by computational capacity. Depending on the proof system, the entire block can only contain <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.alignedlayer.com/about-aligned/how_does_aligned_work#introduction">about 100 proof verifications</a>, excluding all the other on-chain activities.</p><p>Generally, there are two types of proof aggregation protocols:</p><ul><li><p><strong>General purpose (Universal) aggregation:</strong> Such projects usually support several of the most popular ZK protocols (Groth16, Halo2, Plonky), on top of which most ZK circuits are built and take a fee for processing. The dApps that need the proofs then reveal the data from the protocol and process it on their own. <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.nebra.one">Nebra’s Universal Proof Aggregation system</a>, currently in development, does exactly this. Aligned is also working on so-called <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.alignedlayer.com/about-aligned/how_does_aligned_work#aggregation-mode">“slow mode“ verification</a>, which is, in fact, a proof aggregation system, too.</p></li><li><p><strong>Aggregating shared rollup bridges:</strong> Similarly to shared sequencing in optimistic rollups, ZK rollups with their stacks are working on shared bridges with aggregated state proofs for every ZK rollup in the bridge. This not only allows synchronous composability inside the stack ala shared sequencing but also minimizes the costs for proof verification. You might have heard of Polygon’s <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://polygon.technology/blog/aggregated-blockchains-a-new-thesis">AggLayer</a> or ZKsync’s <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.zksync.io/zk-stack/concepts/zk-chains">Hyperbridge</a>, which are shared rollup bridges that work on proof aggregation inside the bridge.</p></li></ul><p>The advantages of universal aggregation systems are that they’re project-agnostic and only specialize in the aggregation process itself, which opens pretty fast verification of proofs and low costs. Also, it’s likely not to have training wheels because of the lack of the bridge component.</p><p>Aggregated rollup bridges, in turn, are helpful for the keystore rollup to have synchronous composability with an already existing rollup stack. For example, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://l2beat.com/scaling/summary">according to L2BEAT</a>, 13 projects are currently built using Polygon CDK, and 11 use ZK Stack. When they all connect to a shared proof aggregating bridge, connecting the keystore rollup to one of them will open seamless interaction with many L2s without even touching the L1. For this to work, the bridge must support different state transition logic for its L2s because the keystore rollup’s logic differs from the other L2s in it.</p><p>However, these bridges are usually upgradable and controlled by its DAO or security council. Keystore rollup projects may not be comfortable with giving up their sovereignty to the operators of the bridge they’re connected to. Also, bridges may introduce execution delays as a training-wheels precaution, similar to how ZKsync Era operates now, which essentially kills the entire efficiency of this keystore rollup design.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7ee628ef3a91374860cac3613664780d98895783f4736eabe7d5bec757d01970.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>This way, keystore rollups, like any other ZK rollups, can minimize proof verification costs and even combine this with synchronous composability with an already existing rollup stack.</p><p><strong>Efficient intent-based bridging with “Keystore+” rollups</strong></p><p>As previously discussed, bridging from L2 to L1 is not the only problem. Most rollup sequencers also apply delays to passing messages from L1 to L2. This is because when an Ethereum block is created, it’s not yet final and can be reversed within the following ~64 blocks (two epochs, about 13 minutes). These reorgs happen because of network latencies, causing some proposals to appear in the network too late when some nodes already consider them missed.</p><p>Even though <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/blocks_forked">most reorgs are no deeper</a> than two blocks <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://cointelegraph.com/news/ethereum-beacon-chain-experiences-7-block-reorg-what-s-going-on">(a seven-block reorg even appeared in the news two years ago)</a>, rollup teams still don’t want to take risks related to missed messages and apply delays to bridging from L1. These delays are just about 1 minute on some rollups (<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.optimism.io/builders/app-developers/bridging/messaging#for-l1-to-l2-transactions">OP Stack</a>, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.rollup.codes/zksync-era">ZK Stack</a>) but can be up to 6 minutes, as in <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.rollup.codes/arbitrum-one">Arbitrum</a>, or even ask for L1 finality, as in <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.rollup.codes/linea">Linea</a>.</p><p>Ethereum community is <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethresear.ch/t/sticking-to-8192-signatures-per-slot-post-ssf-how-and-why/17989">actively working on Single-Slot Finality</a>, which will make each block finalize independently instead of once in an epoch. But we can say for sure that <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum-magicians.org/t/pectra-network-upgrade-meta-thread/16809">it isn’t planned for the next Pectra upgrade</a> coming in Q1 2025, so it’ll be at least a year before SSF gets implemented.</p><p>If a team implementing this extended keystore rollup design isn’t comfortable with such transaction latency, it can implement a palliative described earlier. Every mini-account has a key authorized to send transactions or utilizes a static key from the keystore (as per Vitalik’s original design), but account management is still on the main keystore account. After SSF is implemented on L1, the rollup can remove the authorized spending keys, and users will get the entire AA customization functionality without significant speed degradation.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/330ec712b3ccaa18e525a81759a2d4eac0bc800644c50ace1be1d27ce4b5b19d.png" alt="I agree with Alex here; 15 seconds of latency is absolutely acceptable, especially since the operation is atomic after the keystore rollup transaction is finalized on L1. If we talk about token transfers, recipient wallets can even implement a &quot;Pending&quot; status on the UI level." blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">I agree with Alex here; 15 seconds of latency is absolutely acceptable, especially since the operation is atomic after the keystore rollup transaction is finalized on L1. If we talk about token transfers, recipient wallets can even implement a &quot;Pending&quot; status on the UI level.</figcaption></figure><p>However, cross-rollup token transfers still present a problem. If we implement token vaults inside the keystore rollup, transferring tokens from it will take 1 to 15 minutes, depending on the recipient rollup. If we do not, splitting users’ balances into mini-accounts on multiple L2s can pose security risks and even lock some assets into illiquid L2s, bridging from which may cost too much or take too long.</p><p>As an alternative, we can integrate an intent-based bridge into the rollup and deploy it on all the other rollups or even reuse existing infrastructure, such as <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum-magicians.org/t/erc-7683-cross-chain-intents-standard/19619">ERC-7683</a>-compliant protocols.</p><p><em>— What&apos;s an intent-based bridge?</em></p><p>Most existing cross-chain bridges are based on messaging protocols. For example, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://stargate.finance/bridge">Stargate</a> uses <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://layerzero.network">LayerZero</a> to pass messages about deposits to destination chains, relying on it as the source of trust. When you send tokens through such bridges, they lock your tokens on one side and send a message about your deposit on the other side, and the vault there unlocks the respective amount of tokens for you.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/00b023d191289ae12ba8321fea046ad8a1ab4d0d08dac75aeb82e7f7e2569e00.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Intent-based bridges, in turn, do not send messages between two chains. Instead, funds being sent are locked in the vault as a “cross-chain order,“ and then anyone can fill the order by sending the requested amount of tokens on the destination chain. Whoever fills the order can then claim the locked tokens from the source chain when the vault in it gets informed about the finalized state of the destination chain and can confirm the transfer. This can happen either by waiting for the destination chain&apos;s objective (bridge) finality or via some external oracle protocol. For example, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.across.to/reference/security-model-and-verification">Across uses UMA’s optimistic oracle</a> to fetch the state of not yet finalized L2s.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0b909a14f5bf1e269c763b1f0ecb7f666111717bbab4fa6579d1d887c99244ad.png" alt="In this scenario, Ethereum L1 is used as the source of trust. Some protocols, such as Across, use external oracles instead. The actual design may differ in existing projects; only the general idea is displayed" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">In this scenario, Ethereum L1 is used as the source of trust. Some protocols, such as Across, use external oracles instead. The actual design may differ in existing projects; only the general idea is displayed</figcaption></figure><p>We can use the same design for these extended keystore rollups to implement trustless, fast, and cheap two-way bridging between the keystore and all other L2s. Fast bridge finality allows intent-based orders <em>from</em> the other L2s to be nearly free because proving the fulfillment on the L2 takes just a few minutes. Orders from the keystore will probably be cheap as well, as liquidity on the L2 can be supplied relatively fast through the keystore. This way, such keystore rollup design can become a hub for intent-based bridging, allowing users to send transactions instantly rather than in a few minutes, paying nearly nothing for bridging. The rollup team can also supply liquidity for bridging through the keystore 1:1, and this would not cost them a lot.</p><p><strong>Unified ENS name for all chains</strong></p><p>Imagine having a single <em>username.eth</em> that resolves to all your mini-accounts, no matter which chain the recipient is on. This design makes this possible. How?</p><p>As we already know the address of our main keystore account, we can use <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/pcaversaccio/createx">multichain factories</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.evm.codes/#f5?fork=cancun">CREATE2</a> to make the addresses of our mini-accounts the same across all bytecode equivalent EVM chains, even including Ethereum L1. Then, we set the unified address in the ENS resolver, and our name works in all EVM L2s.</p><p>However, there are two exceptional cases:</p><ul><li><p><strong>Bytecode inequivalent EVMs, such as ZK Stack.</strong> For them, we can generate a custom address according to their CREATE2 rules and add it to the ENS with their chain identifiers according to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.ens.domains/ensip/11">ENSIP-11</a>.</p></li><li><p><strong>Non-EVM L2s, such as our keystore.</strong> The logic is the same for them, but instead, we add their custom addresses to the ENS according to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.ens.domains/ensip/9">ENSIP-9</a>.</p></li></ul><p>While being very UX-friendly, this approach uses a lot of expensive computation and storage on L1 because names and addresses are stored on L1 resolvers. This problem can be solved using <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.ens.domains/ensip/16">CCIP Read</a>, but I came up with another, more efficient on-chain resolution logic:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3baa15ff53a0311344346c30bd570aa2f19ba371046578e43e589e09516de62f.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Every account on the keystore is registered and indexed by the namehash of its ENS name, registered under a single ENS name with a custom resolver. When its subdomain is resolved, the resolver contract checks if the account with such namehash exists in the rollup and uses the namehash to generate CREATE2-based mini-account addresses. When these are deployed, they will ask L1 for the keystore data <em>belonging to the namehash</em> they were deployed with. It can be the transaction intent itself or just the current signing key, depending on keystore implementation.</p><p>This way, we get keystore accounts, each with an ENS name resolving to itself and its mini-accounts on each rollup. These mini-accounts, in turn, will also rely on this ENS name when validating the transaction using the keystore rollup.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/204fb781d3683515d31e09293f474501c295a364220ff1a82bd90a8742b66692.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Sequencing mechanisms on “Keystore+“ rollups</strong></p><p>As bridge finality on the extended keystore rollup is supposed to be a few L1 blocks, we may as well get rid of the centralized sequencers entirely, turning it into a based rollup. As we’ve discussed before, ~12 seconds of transaction speed is acceptable for the average user, but based sequencing would make the rollup much more resistant to censorship and single points of failure.</p><p>It’s worth considering that with based sequencing, internal transactions will take as long as external ones (excluding time to reach L2). This may be unacceptable for some teams, as centralized sequencing makes all internal operations instant.</p><hr><p><strong>Alternative advances in rollup interoperability or Why I did not mention shared sequencing</strong></p><p>I wrote the entire article around ZK rollups and ZK technology. This is because optimistic rollups cannot fundamentally have fast objective finality, and such a property is only reachable using ZK. Today’s optimistic rollups understand their sealed position and are actively researching the feasibility of integrating validity-centric designs in their stacks, hence, for example, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://x.com/RiscZero/status/1793633136636530816">the recent partnership of Optimism and RISC Zero</a>.</p><p>Optimistic design is fundamentally restrictive in that it will never handle interoperability with other rollups. However, interoperability <em>within</em> the optimistic ecosystem is developing rapidly. The primary technology for making optimistic rollups interoperable with each other is <strong>shared sequencing</strong>. Simply put, this is a mechanism where a sequencer can build a batch for multiple rollups simultaneously. If any transaction in any of the rollups sequenced is invalid, the entire batch can be disputed and reverted.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2142b47fbbfcbe18fb15a6360d080eda8426a4aa0ce8a116953b5e809ede506b.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>This gives all batches in this “mega-batch” the atomic property—either all batches are valid or none. This, in turn, allows for atomic synchronous composability inside the batch. Atomic—because nothing in the batch can be invalid if it is valid, synchronous—because all messaging is inside the batch, which is processed simultaneously by all its rollups’ nodes.</p><p>This technology basically turns all rollups in a certain optimistic stack into one big, sharded rollup. Why only one stack and not all of them? Because in order for this to work, rollups must be connected to a single bridge. Each stack has its own bridge, and there’s no reliable way to build batches in multiple bridges simultaneously. This means that shared sequencing allows OP Mainnet to seamlessly interoperate with Base and Zora but not Arbitrum or Metis, and vice versa.</p><p>Such consolidation creates a dangerous situation in the rollup ecosystem. New rollups have the option to either join the existing stack and be integrated with it but not with anyone else OR build on top of ZK and be integrated with anyone but the stack above. There is no such choice now because shared sequencing is not yet available, and each OP Stack or Arbitrum Orbit rollup is independent, with its own bridge. However, when they consolidate, they will form two solid organisms within the ecosystem, each holding <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://l2beat.com/scaling/summary">about 40% of total L2s TVL</a>.</p><p><em>— Okay. If they will hold the vast majority of total TVL, why don’t we get rid of ZK and build on top of them instead?</em></p><p>First of all, shared sequencers are a huge centralization driver. If you run an OP Mainnet sequencer, your batches won’t include transactions from other rollups in the stack; you’ll earn less in fees and eventually be outshined by large commercial sequencers that can handle the entire stack in their batches.</p><p>However, the most critical problem is that in such a case, the rollup ecosystem becomes enclosed within <strong>oligopolistic empires</strong> pursuing their own interests, seeking to establish more control over the capital, and slacking on technological progress in the ecosystem. We would then have to deal with Ethereum being crushed into a disjunct area where PR and intraspecific struggle are what matter, not technologies that actually change the world.</p><blockquote><p><strong>“Build tools, not empires</strong>. Empires try to capture and trap the user inside a walled garden; tools do their task but otherwise interoperate with a wider open ecosystem.”—<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vitalik.eth.limo/general/2023/12/28/cypherpunk.html">Vitalik Buterin</a></p></blockquote><p><em>— How are aggregating shared bridges in ZK better than optimistic shared sequencing?</em></p><p>In ZK rollups’ shared bridges, sequencing can be done independently from the other rollups in the bridge. Each rollup can have its own sequencer or implement shared sequencing. <em>Proposers</em> who assert the resulting state root after all sequenced batches and prove it using ZK are the ones doing aggregation.</p><p>Moreover, the characteristic of relatively fast objective finality in ZK rollups does not make them enclosed inside their ecosystem, no matter how large it grows or how centralized it is. When ZK is developed to the level when big zkVM proofs for multiple proof systems can be generated rapidly, all ZK-based rollup stacks will interoperate nearly seamlessly, just like theoretical keystore rollup described above sends transactions in all the other rollups in a matter of L1 blocks.</p><p><em>— But how come optimistic rollups still exist if they’re so evil, and there’s an alternative in ZK rollups?</em></p><p>Within our community of researchers and highly technical people, the consensus is that ZK is the best scaling solution. And you’ll be surprised to realize that for regular users and builders, optimistic rollups are much better than ZK! How come?</p><p>For users, there’s a well-established ecosystem. All platforms know what Arbitrum and Base are, dApps always have high liquidity, and the UX is fragrant. Try to name an application on Base, and you’ll instantly remember Friend.tech, Farcaster, Daimo, Time.fun, various NFT collections, ZKP2P. Even Mirror initially supported only OP Stack rollups for minting. Try to name an application on ZKsync Era. <em>Uhhh…</em></p><p>For developers, there’s absolute Ethereum equivalence, so the entire Ethereum and EVM forks infrastructure works from the box. Besides that, the documentation scrupulously defines and explains all peculiarities and tooling of optimistic rollups. There are a lot of tutorials, courses, marathons, developer relations, and so on.</p><p>On the other hand, there are year-old zkEVMs, not all of which even have bytecode equivalence. They all have a long list of differences and difficulties when building on top of them. They’re mostly poorly documented, and there’s significant reliance on existing infrastructure that is barely compatible with the networks. Auditing “compatible“ VMs is very difficult and expensive, and you don’t even have a ChatGPT to ask. <em>Its answer probably works for Base, but does it for Linea?</em></p><p>For users, ZK rollups have no ecosystem. There are no applications to use, no social, no popular NFTs or tokens, and all activity boils down to airdrop farming. You’ll barely find liquidity for pairs not in the top 10 of the Ethereum ecosystem, and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://defillama.com/chains">DefiLlama</a> starts showing ZK rollups when you get tired of scrolling.</p><p><em>— But optimistic rollups actually win by compatibility with existing infrastructure. How can ZK rollups beat them in it?</em></p><p>You don’t have to introduce bytecode equivalence, or blake2f precompile to attract developers and activity to your platform. ZK rollups are not supposed to be better in that. Instead, in their fast finality &amp; interoperability, fully horizontal scalability, fundamentally higher security, and decentralization. This is what should be utilized in projects in the ecosystem of ZK rollups to make them advantageous in the ecosystem.</p><p>I wrote this article to put together a complete picture of all these technologies, including ZK rollups, that have appeared and developed in the area during this time and show how they can be used to solve today’s most important problem in the field—rollup interoperability. We have to embrace ZK and its limitless benefits. We have to use them to our advantage to build things that get us closer to making Web3 a place for everyone in the world.</p><hr><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/06537853d96bebd595fafb6c26644763e3edf6150eb13b6d28ce7618d9e9f654.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>This is perhaps the largest comparison table I’ve ever made. No wonder—in the last year, the Ethereum community has come up with many new ideas and technologies that can be flexibly combined and manipulated to create completely new solutions that solve the most pressing problems in the area, even with existing tech.</p><p>Yes, I am still convinced that rollup interoperability is the most pressing problem that prevents us from onboarding the entire world to Web3. Scaling is no longer so urgent—4844 allows us to handle up to a thousand transactions per second, comparable to financial activity in the largest countries in the world; PeerDAS, coming in a year, will increase this even further. Fragmentation, however, still poses a severe threat to the Ethereum ecosystem. No matter how large it grows, the ecosystem should not feel like a dozen distinct empires but as one large mechanism. So different, but so identical.</p><p>We are not early, and this article is supposed to show you that. We must use all our strengths to develop working systems that help the gigantic L2 ecosystem interoperate. This is possible right now. Soon, you should be able to participate in any DAO and send any assets to the ENS, the owner of which is several thousand kilometers from you. Geographical borders should not be replaced by digital ones.</p><p>If you liked this work, agree with its thesis, learned something new, or want to spread this message further—mint it below, share it on social media, leave your comments, and talk about the importance of rollup interoperability more.</p><p>Thank you for reading.</p>]]></content:encoded>
            <author>alexhook@newsletter.paragraph.com (alex hook)</author>
        </item>
        <item>
            <title><![CDATA[What did the blobs change?]]></title>
            <link>https://paragraph.com/@alexhook/what-did-the-blobs-change</link>
            <guid>wUPxfKKsEnublRyiuS5L</guid>
            <pubDate>Thu, 23 May 2024 16:45:57 GMT</pubDate>
            <description><![CDATA[This article was initially written as a run-up for the upcoming Dencun upgrade, but I didn’t have time to finish it before the upgrade. I decided that this article contains a lot of helpful information about how blobs work and what exactly they change in the rollup workflow, so I modified it a little and published post factum. To understand the material below, it’s helpful to have a basic understanding of Merkle trees, Ethereum, and its rollup-centric scaling roadmap. My article “Dr. Dankshar...]]></description>
            <content:encoded><![CDATA[<p>This article was initially written as a run-up for the upcoming Dencun upgrade, but I didn’t have time to finish it before the upgrade. I decided that this article contains a lot of helpful information about how blobs work and what exactly they change in the rollup workflow, so I modified it a little and published post factum.</p><p>To understand the material below, it’s helpful to have a basic understanding of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/">Merkle trees</a>, Ethereum, and its rollup-centric scaling roadmap. My article <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/alexhook.eth/y9PTlM6tVr0H8X68r1LV2UwAnT9D6u1MEEiUFvcpyG0">“Dr. Dankshard or How I learned to stop worrying and love rollups”</a> is a great introduction to the latter.</p><p><em>Special thanks to </em><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/protolambda"><em>Proto</em></a><em> for help with OP Stack</em></p><hr><p><strong>Data storage problem</strong></p><p>If you try to summarise rollups in two sentences, you’ll get something like this:</p><blockquote><p>Rollup is a separate blockchain network that verifies its own state using a smart contract on its parent, “layer one” chain rather than its own independent consensus.</p><p>In order to achieve this, rollup sequencers give the smart contract on L1 all necessary data to verify the state - for example, transaction data and (in case of ZK rollups) Zero-Knowledge cryptographic validity proof - and the smart contract uses it to generate blockchain-verified verdict about the canonical network state.</p></blockquote><p>However, this definition lacks important details, because it’s worth noting how exactly optimistic and ZK rollups utilize L1 data.</p><ul><li><p>Optimistic rollups need to store transaction data on L1 so that people who want to challenge the state transition can always access everything necessary for challenging. The smart contract only needs a contested batch chunk to <em>verify</em> users’ fraud proofs.</p></li><li><p>ZK rollups need to store transaction data on L1 so that people who want to generate the validity proof for the batch can always access the data for proving. The smart contract can verify the proof only by using a short cryptographic commitment to the data.</p></li></ul><p>In fact, in both architectures, the “verifier” smart contract <em>does not need</em> all the data; it’s the off-chain “proving” entities that do. Data storage on L1 is preferred because it has the same trust assumptions as the output of any smart contract on it—in other words, the “verifier” smart contract verdict is as secure as all the data stored.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f4ef5696a74e8e1d36e7cc908f9b82ebc916f105a8561fe3cca44503f286862b.png" alt="Universal graph for both optimistic and ZK rollups&apos; validating process" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Universal graph for both optimistic and ZK rollups&apos; validating process</figcaption></figure><p><em>Interesting fact: L2 networks that store their data outside their L1 are called Validiums (ZK L2s) and Optimiums (optimistic L2s). Some people, including the </em><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://l2beat.com/faq#are-validiums-and-optimiums-l2s"><em>L2BEAT team</em></a><em>, do not consider them L2s because by using an external Data Availability system, they introduce additional trust assumptions into their system. Rollup is a universal term for L2s that store their data on their L1.</em></p><p>Another important thing you might already assume is that data is only needed until its batch is considered valid by the smart contract on L1. After that, all nodes will follow the Merkle root from the contract as the canonical one.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/94d8797c7b6acb9916d86c8442a656115b2b7cd924873257f251d7e30d7ea54d.png" alt="The entire rollup workflow, from sequencer to an up-and-running rollup node having no idea what the transactions were. If you got the thesis above, you can skip this graph; if not, it should be helpful." blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">The entire rollup workflow, from sequencer to an up-and-running rollup node having no idea what the transactions were. If you got the thesis above, you can skip this graph; if not, it should be helpful.</figcaption></figure><p>That is, we don’t need to store the rollup data forever as we do using calldata, so we can make some sort of temporary data storage, also secured by L1 but pruned after some time.</p><p><strong>What’s a blob?</strong></p><p>EIP-4844 introduces special consensus layer entities, called “blobs”.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0a69e8af89f0e58f43ddb3d705579cd88acfc62ce1b27cc0c84bb88291206084.png" alt="The Blobfish is the informal mascot of EIP-4844 and it appeared in people&apos;s nodes when the update happened :-)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">The Blobfish is the informal mascot of EIP-4844 and it appeared in people&apos;s nodes when the update happened :-)</figcaption></figure><p>At a high level, the blob is a 128kb binary object kept by the consensus layer. Its <em>commitment’s</em> hash is stored in the EVM, so anyone can reveal the commitment itself and use it to execute necessary computations. Blobs are pruned after 4096 epochs ~ 18 days, which is enough for both optimistic and ZK rollups to verify their batches.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7fed1f884c15dfcc4392ecbcbcc1232b34ee7190d763a8f87a9eed0f1fe4ea47.png" alt="Both hashing and KZG interpolation are one-way functions. This means you can&apos;t get the original data from the function result." blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Both hashing and KZG interpolation are one-way functions. This means you can&apos;t get the original data from the function result.</figcaption></figure><p><em>How do rollups verify their state if the blob isn’t available in EVM? What’s the commitment? How come only its hash is stored in EVM? How does it all work? To answer all these questions, let’s explore the logic</em> behind Protodanksharding.</p><p><strong>KZG polynomial commitment scheme</strong></p><p><em>Note: I won’t go into all cryptographic details to keep the article relatively simple. Rather, I will take a software-centric approach to explain solely where and how KZG is used within post-4844 Ethereum and rollups.</em></p><p>Technically, the blob is an array (list) of 4096 numbers from 0 to a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ethereum/consensus-specs/blob/dev/specs/deneb/polynomial-commitments.md#constants">very big number</a> roughly equal to 2 to the power of <em>254.857</em>. These numbers, called “field elements,” are packed in 32 bytes each, so the entire blob takes 128kb of disk space.</p><p>KZG commitment scheme allows conversion of an array of field elements (in our case, the blob) into a 48-byte short <em>commitment</em> which can be used to 1) authenticate blobs and 2) generate short proofs that any field element exists in the original array, which can be verified using only the commitment and thus without revealing the whole array.</p><p>The first feature is very similar to the logic of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://en.wikipedia.org/wiki/Hash_function">hash functions</a>, but the second one is the most important for us (and is the reason why we didn’t just take any hash function!):</p><p>Remember how I said that only commitment hash is available in the EVM? Thanks to EIP-4844’s <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-4844#point-evaluation-precompile">point evaluation precompile</a>, we can verify KZG proofs on-chain, only using the commitment, supposed field element, and the proof itself. In the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ethereum/consensus-specs/blob/dev/specs/deneb/polynomial-commitments.md">EIP-4844 implementation</a> of KZG, all this data takes 32+48+32+32+48=192 bytes.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1d100515cdb89d602eec7f6bc6624cbadbcea741cb9fb3d231a024e5e1cbe36b.png" alt="Inside the EVM" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Inside the EVM</figcaption></figure><p>What is this needed for?</p><p>Even though all types of rollups can use this feature, it’s the most useful for optimistic rollups: fraud proofs only need one batch chunk which was executed incorrectly, and they can utilize KZG proofs to contest only necessary parts of the blob, leaving the rest outside the EVM (and thus allowing it to be pruned after challenge time passes).</p><p>ZK rollups can enshrine KZG proof verification inside the validity proof of their batch, but since the validity proof verifies the whole content of the blob, the more efficient solution should be enshrining <em>blob proof</em> verification instead, leaving the blob itself in the private input.</p><p>What’s a <em>blob proof?</em> It’s a cryptographic proof that some commitment corresponds to (that is, was derived from) a certain <em>known</em> blob. It’s not very useful with small 128kb blobs because we can simply perform an interpolation and compare the resulting commitment with the supposed one, but if (when?) we make blobs larger, blob proofs will win performance by a lot.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/040a3c7422cd4faa77ca0d0a9ede7199bd6f6248edd006c4d09bfcfd11f897b5.png" alt="Two use cases for KZG proofs" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Two use cases for KZG proofs</figcaption></figure><p>As you can see, the characteristics of the KZG commitment scheme allow for efficient blob utilization for both ZK and optimistic rollups.</p><p><strong>Blob production</strong></p><p>EIP-4844 introduces a new type of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-4844#blob-transaction">blob-carrying transactions</a>. It’s almost the same as a normal (EIP-1559) transaction but has two new fields - <em>max_fee_per_blob_gas</em> and <em>blob_versioned_hashes</em>.</p><ul><li><p><em>max_fee_per_blob_gas</em> - maximum fee per 1 blob gas (not to be confused with EVM gas!). The blob gas market follows EIP-1559-like logic, so the network won’t take more per 1 blob gas than the calculated blob base fee. Blobs have a fixed blob gas usage of 131072, that is, one blob gas per byte.</p></li><li><p><em>blob_versioned_hashes</em> - <em>versioned hashes</em> of blobs’ commitments. Each transaction can contain multiple blobs, hence “hashes.” When a validator decides whether to take a blob-carrying transaction, it asks its consensus layer client if the blob that has the commitment with a certain versioned hash is available (downloaded). <em>The versioned hash</em> is the simple SHA256 hash, but the first byte is version - 0x01.</p></li></ul><p>Also, to send a blob-carrying transaction, you need to insert your blobs, their commitments, and corresponding <em>blob proofs</em> into the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-2718">transaction envelope</a>.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3c1e606799ec744a1f7f24a01ff31ad3a6c98cf816bbaf2584a49a366217b846.png" alt="If you can&apos;t picture this in your head, I&apos;ll show this in practice later" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">If you can&apos;t picture this in your head, I&apos;ll show this in practice later</figcaption></figure><p>The common misconception is that blob production is expensive and, therefore, must be accomplished by a validator who takes the transaction. As we can see, the latter is impossible—the transaction creator has to set versioned hashes of their blobs, thus executing all interpolation into commitments themselves. Is it actually expensive to generate blobs, though?</p><p>To get a blob that can be published on-chain and which contents can be KZG proven, two steps are required:</p><ul><li><p>Convert a byte array into an array of field elements. Since the field element is slightly (~1.2 bits) less than the 32 bytes it’s packed into, we can’t just split our byte array into 32-byte chunks. However, it’s quite simple to implement necessary compression that, say, pads every 31 bytes with a zero byte to not exceed the limit. Such an operation shouldn’t be expensive, because the blobs are just 128kb each.</p></li><li><p>Perform a KZG polynomial interpolation to generate the commitment to the blob which versioned hash needs to be set in your blob-carrying transaction.</p></li></ul><p>Unless you’re a programmer, I guess you were confused with the first part. Let’s break it down!</p><p>Do you remember that field elements are packed in 32 bytes each? That’s because their limit, that large number called BLS modulus, roughly equals 2^254.857, so it fits in 255 bits. However, we can’t store bits, only bytes, so we add one more zero bit and fit it in 256 bits = 32 bytes.</p><p>Even though we pack field elements in 32 bytes, we don’t quite have all these 32 bytes available, because the first bit has to be set to zero and all remaining bits must be less than BLS modulus. Therefore, not all sequences of 32 bytes are suitable for field elements.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/447dd7a198a38e662f5507a3a4da9f9495117ed4e599410a8e3b4d1fc7a7f92f.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>But what if we need to fit sequences larger than the BLS modulus? - We have to pad our values. This will result in slightly more bytes used and we’ll need to KZG prove two field elements to get a single 32-byte sequence, but our field elements won’t exceed the modulus.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7eea76e7135dc5c9a8610d1325860900d96719888069f5ec89f4cbaebef01bae.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Okay, making an array of field elements seems pretty trivial. What about interpolation?</p><p>I made <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/alexhooketh/blobs-benchmark">blobs-benchmark</a>, a Python script that generates 100 random blobs with their commitments and shows how fast this process was done. The script itself is pretty basic because the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ethereum/c-kzg-4844/tree/main/bindings/python">KZG Python library</a> is available online. Let’s run it!</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://i.imgur.com/vWELjbW.mp4">https://i.imgur.com/vWELjbW.mp4</a></p><p>My M1 laptop generates 100 EIP-4844 blobs in ~8.9 seconds or about <strong>89 milliseconds</strong> per blob. The actual random blob generation happens instantly, so it’s all interpolation.</p><p>This script is open source, so if you had any experience running them before, you can have a try and check how long it takes on your machine. As we can see, <strong>blob production</strong> is practically free, so sequencers won’t need to handle any additional costs.</p><hr><p><strong>Going inside the rollups</strong></p><p>Let’s see how rollups utilize blobs, what their proving mechanism is, and how they pack batches into field elements. Thankfully, all rollups are open source, so we can check all the code ourselves!</p><p>I took <strong>OP Mainnet</strong> for our pseudo-research because it’s based on OP Stack, so all OP Stack rollups with blob support <em>(Base, Mode, Zora, etc)</em> have the same logic.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/66f2e2117b53db12c73d9e2a32e0c63957aa23319d0a660ab0cdc8ff4e78385b.png" alt="All these rollups work the same (source: https://l2beat.com/scaling/data-availability)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">All these rollups work the same (source: https://l2beat.com/scaling/data-availability)</figcaption></figure><p><strong>OP Mainnet</strong></p><p>At the time of writing, the OP sequencer creates new blobs by sending blob-carrying transactions from a special <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/address/0x6887246668a3b87f54deb3b94ba47a6f63f32985">Batcher account</a> to the vanity address.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4301935f7b83055a8d28783521418560a06c94e2b86502f86fbecd92fd7daa47.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Notice that the destination address is almost fully zero. It’s not someone’s wallet; rather, it is a sort of demonstrative burn address, hence the “10“ at the end, which is the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://chainlist.org/chain/10">chain ID of OP Mainnet</a>.</p><p>Previously all these transactions contained batch data in their calldata. Now, all transactions have empty calldata, so technically they’re the same as a simple 0 ETH transfer, but also carry blobs.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c11b3254176ca5f73215089b4a7474f22e933e980e4bca3c67ff925efbf654d9.jpg" alt="Random batcher transaction before blobs" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Random batcher transaction before blobs</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b9ea9a975c99f253cd3c83c6bf88822d9f43de6e85bf43b6d71d3fa03a2f586d.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a9dde31778cf488623a5910db4f2bdb74b67e31754be10c2930785f994401fae.png" alt="Random batcher transaction after blobs (EIP-4844 - blobs upgrade). Calldata is empty, everything is in the blobs" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Random batcher transaction after blobs (EIP-4844 - blobs upgrade). Calldata is empty, everything is in the blobs</figcaption></figure><hr><p><em>(The info below is taken from OP Stack specs, specifically </em><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://specs.optimism.io/protocol/derivation.html"><em>this</em></a><em> and </em><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://specs.optimism.io/protocol/delta/span-batches.html"><em>this</em></a><em> page. It’s slightly technical and not really needed for understanding)</em></p><p>OP Stack uses <em>channel</em> encoding to convert transaction batches into data streams that can be fit into blobs on L1.</p><ol><li><p>Firstly, the sequencer constructs the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://specs.optimism.io/protocol/delta/span-batches.html#span-batch-format">span batch</a> - the range of multiple consecutive L2 blocks, with all their transactions and necessary metadata to reconstruct the network state.</p></li><li><p>Then it gets encoded using <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/">RLP</a> and compressed using <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://specs.optimism.io/protocol/derivation.html#channel-format">zlib stream compression</a>. This was the last step before the blob upgrade, as L1 transaction calldata can accept raw bytes. However, this is not the case with blobs, so now it also goes through blob encoding.</p></li><li><p>The resulting byte sequence is split into chunks of 127 bytes = 1016 bits each, and each chunk is encoded in 4 field elements (254 bits per element).</p></li><li><p>While OP Stack technically supports sending multiple blob transactions to store the single channel, I couldn’t find such examples in the mainnet, so let’s assume the channel takes up to 6 blobs. If the last used blob isn’t full, it’s padded with field elements equal to zero.</p></li></ol><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9e42e3a3348bf78495a037af2af2a453ffaac3c62c622f4f2c6b1ef266225a7b.png" alt="The actual bit-splitting process is slightly more complex, but the idea is the same" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">The actual bit-splitting process is slightly more complex, but the idea is the same</figcaption></figure><p>I chose a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0x353c6f31903147f8d490c28e556caafd7a9fad8b3bc4fd210ae800ee24749adb">random sequencer transaction</a> and made a Python script that decodes its blobs back into the span batch and reads its contents.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/592ced170e7532b6d56add51e7d6a1d8db589f5b4462cecf48128b12a3bd1232.png" alt="This transaction from block 19538908" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">This transaction from block 19538908</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4e217df64afcfcea2a53816427ae9ccb3923ff0fb671be420e23ca1e4a0196c6.jpg" alt="The output of the script" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">The output of the script</figcaption></figure><p>Using the same logic as described above, I decoded the blobs into the span batch and read its contents. The batch also contains transactions themselves, but the script doesn’t print them for the brevity of the output.</p><p>If you want to run it yourself, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/alexhooketh/blobs-toolkit">here’s the link</a>. I won’t describe its internals because this part will become too complicated to comprehend, but if you have some experience in Python, it shouldn’t be difficult for you to understand the script.</p><hr><p>About every hour, the OP proposer (in fact, the same entity, since the rollup is centralized) pushes a new state root based on the execution of newly posted batches. OP Stack doesn’t have fault proofs yet, so the validity of the blobs’ content is not proven in any way.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/fb51bfd4a8568be9f16e7f60a2a4d1272f8b9389800721884fcfe2778d8b940e.png" alt="What proposal look like" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">What proposal look like</figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://specs.optimism.io/protocol/rollup-node.html">OP Rollup Node</a> is connected to the L1 (Ethereum) node and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://specs.optimism.io/protocol/exec-engine.html">OP Execution Engine</a>. Rollup Node constantly scans L1 blocks for new proposals and batch sequences and passes them to the Execution Engine, where they’re used to reconstruct the L2 chain.</p><p>As all OP batches are considered final after 7 days of challenge time, only finalized batches can become unavailable (because their blobs are pruned by L1 only after ~18 days). Thus, the OP node can safely follow the latest finalized output root and <em>leave historical batches untouched</em>. Elements of the state trie can be fetched P2P, and because the node always has the state root, only one honest node is enough to reconstruct the entire trie.</p><hr><p><strong>People are always asking me if I know Alex Hook…</strong></p><p>Do you know what’s the first rule of the fight club?</p><ul><li><p>What’s the “fight club”?</p></li></ul><p>I won’t tell you the whole thing, only the first rule. KZG commitments are going to help me.</p><div data-type="twitter" tweetId="1768021080017367440" tweetData="{&quot;__typename&quot;:&quot;Tweet&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;favorite_count&quot;:6,&quot;possibly_sensitive&quot;:false,&quot;created_at&quot;:&quot;2024-03-13T21:07:28.000Z&quot;,&quot;display_text_range&quot;:[0,140],&quot;entities&quot;:{&quot;hashtags&quot;:[],&quot;urls&quot;:[{&quot;display_url&quot;:&quot;blobscan.com/tx/0xc5c2e96c9…&quot;,&quot;expanded_url&quot;:&quot;https://blobscan.com/tx/0xc5c2e96c9da3fdacc466dc7f239d1c0225764f47c46516e8599b5475b4be6043&quot;,&quot;indices&quot;:[117,140],&quot;url&quot;:&quot;https://t.co/sRNtzEcZxb&quot;}],&quot;user_mentions&quot;:[],&quot;symbols&quot;:[],&quot;media&quot;:[{&quot;display_url&quot;:&quot;pic.x.com/pholLUmkX5&quot;,&quot;expanded_url&quot;:&quot;https://x.com/alexhooketh/status/1768021080017367440/photo/1&quot;,&quot;indices&quot;:[141,164],&quot;url&quot;:&quot;https://t.co/pholLUmkX5&quot;}]},&quot;id_str&quot;:&quot;1768021080017367440&quot;,&quot;text&quot;:&quot;just posted the entire fight club script in two blobs and proved what&apos;s the first rule of fight club onchain :)\n\n1/\n\nhttps://t.co/sRNtzEcZxb https://t.co/pholLUmkX5&quot;,&quot;user&quot;:{&quot;id_str&quot;:&quot;1287755940054302722&quot;,&quot;name&quot;:&quot;Alex Hook&quot;,&quot;screen_name&quot;:&quot;alexhooketh&quot;,&quot;is_blue_verified&quot;:true,&quot;profile_image_shape&quot;:&quot;Circle&quot;,&quot;verified&quot;:false,&quot;profile_image_url_https&quot;:&quot;https://storage.googleapis.com/papyrus_images/bc52e86a2c4cca052a9ec9b6975e3a176533ac0652310b4b75d6551dfa58a317.jpg&quot;},&quot;edit_control&quot;:{&quot;edit_tweet_ids&quot;:[&quot;1768021080017367440&quot;],&quot;editable_until_msecs&quot;:&quot;1710367648000&quot;,&quot;is_edit_eligible&quot;:false,&quot;edits_remaining&quot;:&quot;5&quot;},&quot;mediaDetails&quot;:[{&quot;display_url&quot;:&quot;pic.x.com/pholLUmkX5&quot;,&quot;expanded_url&quot;:&quot;https://x.com/alexhooketh/status/1768021080017367440/photo/1&quot;,&quot;ext_media_availability&quot;:{&quot;status&quot;:&quot;Available&quot;},&quot;indices&quot;:[141,164],&quot;media_url_https&quot;:&quot;https://pbs.twimg.com/media/GIlFo7QXwAAD9MI.jpg&quot;,&quot;original_info&quot;:{&quot;height&quot;:1474,&quot;width&quot;:2882,&quot;focus_rects&quot;:[{&quot;x&quot;:125,&quot;y&quot;:0,&quot;w&quot;:2632,&quot;h&quot;:1474},{&quot;x&quot;:704,&quot;y&quot;:0,&quot;w&quot;:1474,&quot;h&quot;:1474},{&quot;x&quot;:795,&quot;y&quot;:0,&quot;w&quot;:1293,&quot;h&quot;:1474},{&quot;x&quot;:1073,&quot;y&quot;:0,&quot;w&quot;:737,&quot;h&quot;:1474},{&quot;x&quot;:0,&quot;y&quot;:0,&quot;w&quot;:2882,&quot;h&quot;:1474}]},&quot;sizes&quot;:{&quot;large&quot;:{&quot;h&quot;:1047,&quot;resize&quot;:&quot;fit&quot;,&quot;w&quot;:2048},&quot;medium&quot;:{&quot;h&quot;:614,&quot;resize&quot;:&quot;fit&quot;,&quot;w&quot;:1200},&quot;small&quot;:{&quot;h&quot;:348,&quot;resize&quot;:&quot;fit&quot;,&quot;w&quot;:680},&quot;thumb&quot;:{&quot;h&quot;:150,&quot;resize&quot;:&quot;crop&quot;,&quot;w&quot;:150}},&quot;type&quot;:&quot;photo&quot;,&quot;url&quot;:&quot;https://t.co/pholLUmkX5&quot;},{&quot;display_url&quot;:&quot;pic.x.com/pholLUmkX5&quot;,&quot;expanded_url&quot;:&quot;https://x.com/alexhooketh/status/1768021080017367440/photo/1&quot;,&quot;ext_media_availability&quot;:{&quot;status&quot;:&quot;Available&quot;},&quot;indices&quot;:[141,164],&quot;media_url_https&quot;:&quot;https://pbs.twimg.com/media/GIlFwGOWAAA0vhT.jpg&quot;,&quot;original_info&quot;:{&quot;height&quot;:1498,&quot;width&quot;:2880,&quot;focus_rects&quot;:[{&quot;x&quot;:103,&quot;y&quot;:0,&quot;w&quot;:2675,&quot;h&quot;:1498},{&quot;x&quot;:691,&quot;y&quot;:0,&quot;w&quot;:1498,&quot;h&quot;:1498},{&quot;x&quot;:783,&quot;y&quot;:0,&quot;w&quot;:1314,&quot;h&quot;:1498},{&quot;x&quot;:1066,&quot;y&quot;:0,&quot;w&quot;:749,&quot;h&quot;:1498},{&quot;x&quot;:0,&quot;y&quot;:0,&quot;w&quot;:2880,&quot;h&quot;:1498}]},&quot;sizes&quot;:{&quot;large&quot;:{&quot;h&quot;:1065,&quot;resize&quot;:&quot;fit&quot;,&quot;w&quot;:2048},&quot;medium&quot;:{&quot;h&quot;:624,&quot;resize&quot;:&quot;fit&quot;,&quot;w&quot;:1200},&quot;small&quot;:{&quot;h&quot;:354,&quot;resize&quot;:&quot;fit&quot;,&quot;w&quot;:680},&quot;thumb&quot;:{&quot;h&quot;:150,&quot;resize&quot;:&quot;crop&quot;,&quot;w&quot;:150}},&quot;type&quot;:&quot;photo&quot;,&quot;url&quot;:&quot;https://t.co/pholLUmkX5&quot;}],&quot;photos&quot;:[{&quot;backgroundColor&quot;:{&quot;red&quot;:204,&quot;green&quot;:214,&quot;blue&quot;:221},&quot;cropCandidates&quot;:[{&quot;x&quot;:125,&quot;y&quot;:0,&quot;w&quot;:2632,&quot;h&quot;:1474},{&quot;x&quot;:704,&quot;y&quot;:0,&quot;w&quot;:1474,&quot;h&quot;:1474},{&quot;x&quot;:795,&quot;y&quot;:0,&quot;w&quot;:1293,&quot;h&quot;:1474},{&quot;x&quot;:1073,&quot;y&quot;:0,&quot;w&quot;:737,&quot;h&quot;:1474},{&quot;x&quot;:0,&quot;y&quot;:0,&quot;w&quot;:2882,&quot;h&quot;:1474}],&quot;expandedUrl&quot;:&quot;https://x.com/alexhooketh/status/1768021080017367440/photo/1&quot;,&quot;url&quot;:&quot;https://storage.googleapis.com/papyrus_images/4280579d0f16c920683451dd36f71aea09fca5da3aae2c8bddb3708702424b4f.jpg&quot;,&quot;width&quot;:2882,&quot;height&quot;:1474},{&quot;backgroundColor&quot;:{&quot;red&quot;:204,&quot;green&quot;:214,&quot;blue&quot;:221},&quot;cropCandidates&quot;:[{&quot;x&quot;:103,&quot;y&quot;:0,&quot;w&quot;:2675,&quot;h&quot;:1498},{&quot;x&quot;:691,&quot;y&quot;:0,&quot;w&quot;:1498,&quot;h&quot;:1498},{&quot;x&quot;:783,&quot;y&quot;:0,&quot;w&quot;:1314,&quot;h&quot;:1498},{&quot;x&quot;:1066,&quot;y&quot;:0,&quot;w&quot;:749,&quot;h&quot;:1498},{&quot;x&quot;:0,&quot;y&quot;:0,&quot;w&quot;:2880,&quot;h&quot;:1498}],&quot;expandedUrl&quot;:&quot;https://x.com/alexhooketh/status/1768021080017367440/photo/1&quot;,&quot;url&quot;:&quot;https://storage.googleapis.com/papyrus_images/65015bf0c7e2f759ca7e4f81229cc5df8f429f778a2cfce7424a544a000df701.jpg&quot;,&quot;width&quot;:2880,&quot;height&quot;:1498}],&quot;conversation_count&quot;:2,&quot;news_action_type&quot;:&quot;conversation&quot;,&quot;isEdited&quot;:false,&quot;isStaleEdit&quot;:false}"> 
  <div class="twitter-embed embed">
    <div class="twitter-header">
        <div style="display:flex">
          <a target="_blank" href="https://twitter.com/alexhooketh">
              <img alt="User Avatar" class="twitter-avatar" src="https://storage.googleapis.com/papyrus_images/bc52e86a2c4cca052a9ec9b6975e3a176533ac0652310b4b75d6551dfa58a317.jpg" />
            </a>
            <div style="margin-left:4px;margin-right:auto;line-height:1.2;">
              <a target="_blank" href="https://twitter.com/alexhooketh" class="twitter-displayname">Alex Hook</a>
              <p><a target="_blank" href="https://twitter.com/alexhooketh" class="twitter-username">@alexhooketh</a></p>
    
            </div>
            <a href="https://twitter.com/alexhooketh/status/1768021080017367440" target="_blank">
              <img alt="Twitter Logo" class="twitter-logo" src="https://paragraph.com/editor/twitter/logo.png" />
            </a>
          </div>
        </div>
      
    <div class="twitter-body">
      just posted the entire fight club script in two blobs and proved what's the first rule of fight club onchain :)<br /><br />1/<br /><br /><a class="twitter-content-link" href="https://t.co/sRNtzEcZxb" target="_blank">blobscan.com/tx/0xc5c2e96c9…</a> 
      <div class="twitter-media"><div class="twitter-two-images"><img class="twitter-image" src="https://storage.googleapis.com/papyrus_images/4280579d0f16c920683451dd36f71aea09fca5da3aae2c8bddb3708702424b4f.jpg" /></div></div>
      
       
    </div>
    
     <div class="twitter-footer">
          <a target="_blank" href="https://twitter.com/alexhooketh/status/1768021080017367440" style="margin-right:16px; display:flex;">
            <img alt="Like Icon" class="twitter-heart" src="https://paragraph.com/editor/twitter/heart.png">
            6
          </a>
          <a target="_blank" href="https://twitter.com/alexhooketh/status/1768021080017367440"><p>4:07 PM • Mar 13, 2024</p></a>
        </div>
    
  </div> 
  </div><p>In my recent experiment, I posted the entire Fight Club script in two blobs on mainnet and sent a transaction to the point evaluation precompile with the proof that the “you do not talk about Fight Club” rule actually exists in one of those blobs. When I did this, there were no tools to build the blobs yourself, so I had to write a deployment script. Here’s how it works:</p><p>Firstly, I had to get a Fight Club script to put into the Python deployment script.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1cdd1fb913273a51b5d5ba8474aa4d3ca7ffa491dd6bbce57fe2833bdf784a7f.png" alt="That was easy" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">That was easy</figcaption></figure><p>However, to put it into the blobs I needed to solve two problems.</p><ol><li><p>The Fight Club script is too big to fit in the single blob (~160 KB, only text with all unnecessary symbols stripped)</p></li><li><p>It consists of ASCII printable characters that can be as big as <em>0111 1110</em> in binary form. If any field element starts with a character bigger than <em>0111 0011</em> (first bits of BLS modulus), the entire blob is invalid.</p></li></ol><p>The first problem is easy - we can put up to 6 blobs in a single transaction. Here’s how I fixed the second one:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ac194209e687164a353d16d478bd9f4c1fc6d48ebf745aa177e6c5a698f6d5cb.png" alt="Do not read it if you can&apos;t. The explanation is below" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Do not read it if you can&apos;t. The explanation is below</figcaption></figure><p>This part of the Python script splits the incoming data (in our case, the movie script) into chunks of 31 bytes each, pads every chunk with a null byte (thus, making them start with <em>0000 0000</em>), and groups them into arrays of length 131072, essentially constructing the always-valid blobs.</p><p>Ok, now we’ve got blobs. How do we publish them?</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f527b733d5ebd0b6ef4596e0ff1d9c2ca6c286a1877b4e7d49588816003cb904.png" alt="Transaction building process. You can leave it unread too." blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Transaction building process. You can leave it unread too.</figcaption></figure><p>This may seem weird. If you know no Python, this is what happens above:</p><ul><li><p>We build an array with all the data needed to construct the transaction. You may even notice familiar values - a gas limit of 21000 since we call no contracts, gas price, max priority fee, transaction count AKA nonce, but with versioned hashes of our blobs. Do you remember that, unlike blobs or commitments, they’re stored forever? Here’s why - they’re built in the transaction body, which is added to the block, which is added into the blockchain.</p></li><li><p>We encode this array using RLP encoding and sign the result with our Ethereum private key. The signatures in Ethereum consist of three elements - two numbers <em>(signature.r, signature.s)</em> 32 bytes each, and a parity bit <em>(signature.v)</em>.</p><p>Notice the <strong>“03”</strong> number we add to the start of the array. This is the type of a blob-carrying (EIP-4844) transaction. Normal transactions have the type of <strong>02</strong> (EIP-1559).</p></li><li><p>We build an array with our transaction, our blobs, its commitments, and proofs and pad them with the transaction type. This is a <em>transaction envelope</em> or <em>packet</em>, we should send it to our node provider so that it can be added to the mempool and distributed within the Ethereum P2P network.</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3177fa9610d5d4f3755929493bc6309e85538e4935d499a8f24a282fa71ff334.png" alt=".hex() - hexadecimal form of our transaction ID." blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">.hex() - hexadecimal form of our transaction ID.</figcaption></figure><p>Now we’re ready to send it. <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://blobscan.com/tx/0xc5c2e96c9da3fdacc466dc7f239d1c0225764f47c46516e8599b5475b4be6043">Ta-da!</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/42e4ace7b36b4b831e5f36b9e90bf6672245bc769f7a3fcf05387c0059255a80.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e6261c9bf45f8462fbdf149c35534d4b02fa878b9b8666f77328fb22a5c53ce0.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/fb78048b1f43cbd870e83b7dc51ae224fbd99d4eb72eee7d7dd1b7bb07f955b6.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>The entire script took two blobs. The publication itself cost me 0.000000000000262144 ETH, which is virtually free. The main cost driver was sending the transaction to the network, which was about $5 at that moment.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2efb79e1466057144e6268fdf5c1fd4f6e1795faf1cb3b0f0bf4f3a3dd32aabb.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>You can send up to 6 blobs in the single blob-carrying transaction and, as it’s almost the same as the normal one, execute some other smart contract computations in the same transaction, distributing the costs.</p><p><em>The important thing to remember</em> is that the EVM has no idea what the blobs were because I packed them into the networking packet. It only knows the hashes of the commitments, which is enough for me to verify blob proofs on it.</p><p>Here’s what the verification script looks like:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e1df86358eef2af301748d850ebb2a64e0deb939e67f26d9d392739b3a861d73.png" alt="While it&apos;s almost the same as the logic above, don&apos;t read it if you&apos;re not an expert." blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">While it&apos;s almost the same as the logic above, don&apos;t read it if you&apos;re not an expert.</figcaption></figure><p>It’s very similar to the logic above. For a reason - what was changed is transaction type (now it’s <strong>02</strong>, a normal EIP-1559 transaction), destination address (<strong>0x0A</strong> - <em>point evaluation precompile</em>), and the calldata (that is, transaction input) is <em>not empty</em> now. Everything else is the same.</p><p>The calldata is the sequence of the versioned hash, the field element existence of which we want to verify, the commitment, and the KZG proof. This is all the point evaluation precompile needs to verify our proof. As I already said, the blob is not needed to verify proofs.</p><p><em>Build, sign, pack, send</em>. <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0xad6b77265406737f8980ddad5296ffa29b95b5d4a4e23ef395bd97ca76bb7381">Voila.</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/874b9634fdb4350baa00789cacc0e2d5fe3be107d526d7c0a50679d8cb8f25e4.png" alt="Can you notice the actual rule here?" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Can you notice the actual rule here?</figcaption></figure><p>The <em>“Success“</em> label tells us that the precompile did not revert while verifying the proof, so it is valid. Yes, you got it right; this is just a smart contract call. Now the EVM knows the first rule of the fight club according to the scripts but no other rules or what the fight club is.</p><p>The source code of the scripts is available here.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/984c78a7b62559eb396c18cbc5a2e81f1ebf0d7144d4db8b74121092c7b2d0c6.png" alt="Tyler is watching the corporate world of web2 collapse, thanks to you!" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Tyler is watching the corporate world of web2 collapse, thanks to you!</figcaption></figure><hr><p>Replace the first rule of the fight club with the forged batch element and the movie script with the batch of transactions, and that’s how optimistic rollups work. Make the proof a blob proof and wrap it into the validity proof so that it only needs the versioned hash as public input, and that’s how ZK rollups work. That’s it. That’s what the blobs changed in the rapidly moving Ethereum ecosystem.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b375cbe73d3c41da9d9a7f370333ab0600bfb3a1e62cb9fbf2246389d4529349.png" alt="Commit blob, prove batches, execute batches. zkSync validator steadily sends and proves blobs of transaction batches every few minutes never caring about all this huddle of cryptography that happens behind the scenes. What about the users?" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Commit blob, prove batches, execute batches. zkSync validator steadily sends and proves blobs of transaction batches every few minutes never caring about all this huddle of cryptography that happens behind the scenes. What about the users?</figcaption></figure><p>In fact, the blob upgrade is nothing but using some cryptographic primitives to optimize the workflow of rollups, so that they can run more efficiently and give cheaper fees and smoother experience to end users. This is the whole crypto - huge engineering work taking a lot of man-hours that gives nothing but a better user experience in the completely trustless system slowly changing the entire world.</p><p>If you try to summarize this article, you’ll get completely different results based on who you’re trying to explain it to. For ordinary users, making the vast majority of the user base, “it makes the fees cheaper“ is enough. For curious minds, the concept of blobs being pruned after they’re not needed anymore should do the thing. If one is an engineer, however, you probably wouldn’t compress this material significantly much. I tried to cover everything you could be interested in if you wanted to <strong>know</strong> the blobs, but not going to write your own implementation of them. I hope this article gave you such kind of understanding and await your feedback on any socials or comments if they’re added to Mirror someday.</p><p>Thank you for reading.</p>]]></content:encoded>
            <author>alexhook@newsletter.paragraph.com (alex hook)</author>
        </item>
        <item>
            <title><![CDATA[Dr. Dankshard or How I learned to stop worrying and love rollups]]></title>
            <link>https://paragraph.com/@alexhook/dr-dankshard-or-how-i-learned-to-stop-worrying-and-love-rollups</link>
            <guid>8O7xDVyVPSCcQHtVUHI5</guid>
            <pubDate>Sun, 26 Nov 2023 14:51:22 GMT</pubDate>
            <description><![CDATA[UPD 2024/08/28: Two months ago, I authored a series of articles for Etherpedia, an initiative by the 2077 Collective aimed at providing beginner-friendly content on various Ethereum technologies and roadmap elements. This series included an article titled “The Roadmap: Rollup Scaling,” which draws heavily from the article you&apos;re reading right now. Even though it doesn&apos;t include as much detail regarding calculations and comparisons with alternative scaling designs, I consider it an e...]]></description>
            <content:encoded><![CDATA[<p>UPD 2024/08/28: Two months ago, I authored a series of articles for <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherpedia.2077.xyz">Etherpedia</a>, an initiative by the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://2077.xyz">2077 Collective</a> aimed at providing beginner-friendly content on various Ethereum technologies and roadmap elements. This series included an article titled <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherpedia.2077.xyz/posts/rollups-101/">“The Roadmap: Rollup Scaling,”</a> which draws heavily from the article you&apos;re reading right now. Even though it doesn&apos;t include as much detail regarding calculations and comparisons with alternative scaling designs, I consider it an enhanced and simplified version of this article. As such, I strongly recommend reading the updated version first.</p><p>I’ll keep the original article uploaded as it’s still a really good piece with numerous insightful observations. Also, it holds personal significance for me, as it’s the first article that garnered me some recognition and inspired me to pursue technical writing further.</p><hr><p>You may notice how many people wonder why such a complicated solution was adopted for Ethereum scaling, maybe you’re even one of them. Like, why “rollups” if there are many other options, from Solana-style vertical scaling to block expiry and execution sharding?</p><p>In the past I was a huge fan of execution sharding and strongly opposed rollup scaling as too complex and meaningless if execution sharding exists. In response I always received non-exhaustive “it’s inefficient”. Time flies, and after reading dozens of topics, articles, rationales, sharding and danksharding designs, I can say that I changed my mind about it. I want to make a summary of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/alexhook.eth/HaT8UvqQ6ED1yv1h7Fs3Xcv1d_cxglfgBrhI0oYB4EE">rollup scaling</a> from the point of comparison with other scaling designs, and show exact numbers and facts about their effectiveness to the same doubting people as me a year ago.</p><p><em>Special thanks to Domothy for feedback and review</em></p><hr><p><strong>Theory of scaling</strong></p><p>Ethereum chain is slow.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d55521212ec01ca100a28c31cf6eaeff8e5d021154d7beda6afd89ff796c42e0.png" alt="I can click more times per second, with one finger" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">I can click more times per second, with one finger</figcaption></figure><p>It’s slow because all nodes have to execute all transactions happening on-chain themselves. All computers with running Ethereum EL+CL clients should download and re-execute all 18.5 million (at the time of writing) blocks and all transactions inside of them, and after they’re done, they do the same with newly created blocks, which are created every 12 seconds.</p><p>With this system it’s impossible to make weaker node execute less computations than stronger one. If on-chain computations are only within the power of stronger node, weaker node simply won’t keep up with the chain, eventually leaving the network only with powerful nodes. It follows that the entire network operates at the speed of one node of this network. The load can’t be distributed between the nodes.</p><p>It can be assumed that if the solid network can’t distribute the load between nodes, we must make node requirements as high as possible. By that we can make the network much faster, since modern enterprise-grade servers can let us process hundreds of thousands of transactions.</p><p><strong>This is called vertical scaling</strong> - we make single instance of the system more powerful to increase capacity of the whole system. Among platforms that adopted this type of scaling - <em>Solana</em>.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a80382d27827c1e210f379d743133a6cc81ef1a61f924c64e07d8f705ede0a80.png" alt="Solana network executes 600 transactions per second - 30 times higher than Ethereum! " blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Solana network executes 600 transactions per second - 30 times higher than Ethereum!</figcaption></figure><p>However, this type of scaling is not perfect. By increasing node requirements, you respectively reduce the number of people that can afford running their own node. If ordinary users of the network can’t run the network themselves, they have to trust ones who do - block explorers, commercial projects, dApps, etc. <strong>Trust</strong> implies huge risks on the part of simple users, because they become easily vulnerable to malicious actors in the network infrastructure. <strong>Cryptocurrency</strong> as an idea strives for refusal of any type of trust by verifying your funds and other elements of the network that you may need yourself, which isn’t really possible with vertical scaling mechanism. That’s why Ethereum community refused this type of scaling since the launch and instead looks for other designs.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9885b177fc9395f5c27429d11b6d465d3c13986dc864f044eaca263ca936ab37.png" alt="Solana validator node requirements. How much weaker is your home PC?" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Solana validator node requirements. How much weaker is your home PC?</figcaption></figure><p>Ok. Let’s assume that we have hundreds or thousands of lightweight nodes that operate the solid chain on low speed. What stops us from making each node execute its own set of transactions, effectively distributing the load between all existing nodes?</p><p>One of old scaling mechanisms that followed this logic was <strong>sharding</strong>, or <em>execution sharding</em>. The mechanism works like this:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ba38e8e3de244fa421c0a0c8e396b56b04f4e21e509add399ad1f0b4da2fce47.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>We make many parallel chains that are interoperable and coordinated by beacon chain that provides staking and controls validators. Then, we distribute all existing validators between all these chains, so each validator secures the chain it’s assigned to. Looks quite simple and natural - why should we all run the same chain if we can split into many groups and run our own chains that are interoperable?</p><p>Among the chains that adopted this mechanism - NEAR. At the time of writing, the network isn’t sharded due to low demand, but sharding system is integrated in protocol and may be used in the future.</p><p><strong>What is a rollup</strong></p><p><em>I’ll just assume optimistic rollups don’t exist because they’re pretty much obsolete and it’ll be much simpler to explain without them</em></p><p>Another scaling design which is currently chosen by Ethereum community is <em>rollups</em>. <em>Rollups</em> are separate blockchains that prove their state with transactions on the solid Layer 1 network, in our case it’s Ethereum chain. Each rollup has two way bridge built in the system, so they can interact with L1 and therefore with each other.</p><p>Re-executing all rollup transactions on L1 would be too expensive and thus would have no point, so rollups use other ways to prove their transactions’ validity without actually running them on L1. One of the ways that recently gained popularity and is recommended for new rollups is through <strong>zero knowledge proofs</strong>.</p><p>What’s zero knowledge proof? I’ll take an explanation from my previous article, because it’s useful here as well:</p><hr><p><em>Well, my explanation will not be exhaustive at all, because it entirely sounds as a magic and to understand how it works internally, you should have strong knowledge in cryptography. ZK (Zero-Knowledge) proof is a set of mathematical equations that allow you to prove outputs of some computations without executing these computations yourself, either because they’re too hard for you to execute or because you don’t have some of necessary values to execute it.</em></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/alexhook.eth/HaT8UvqQ6ED1yv1h7Fs3Xcv1d_cxglfgBrhI0oYB4EE"><em>“</em><strong><em>Foundations and orders of rollup-centric Ethereum</em></strong><em>“ - Alex Hook</em></a></p><hr><p>In our case, we know all necessary values (rollup posts them on the L1 blockchain), but they’re too hard for L1 to execute so we want to avoid re-execution, that’s why we use ZK proofs.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7a10273ac0292353d1826b59fcf65609f1a0226a8431e2b3b3d45864f83bd215.png" alt="This is the logic which is basically used by ZK rollups, just replace sha256() with execute_EVM_transactions() and the person on the left with smart contract on Ethereum L1" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">This is the logic which is basically used by ZK rollups, just replace sha256() with execute_EVM_transactions() and the person on the left with smart contract on Ethereum L1</figcaption></figure><p>The important characteristic of ZK proofs is that it’s hard to generate them (much harder than computations that they prove) but extremely simple (in comparison to computations that they prove) to validate. That’s because in order to generate a ZK proof to some computations, you have to “convert” <em>all</em> these computations to lots of mathematical equations. By that, we can move computation burden from all nodes to some sequencers with powerful machines, while nodes can enjoy low load.</p><p><strong>Drawbacks and disadvantages <em>(what’s worse?)</em></strong></p><p>What’s the limitation of execution sharding? Let me explain using Ethereum as an example.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2041b6324194ee548163cb0e021e891917d21277bb0b577c63aff2b79deca8c3.png" alt="Source: beaconcha.in (values at the time of writing)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Source: beaconcha.in (values at the time of writing)</figcaption></figure><p>Currently the Ethereum network is secured by 28.2 million ETH. To attack it, you should burn 1/3 of it to prevent the chain from finalising and 2/3 of it to rollback blocks.</p><p>If we take USD and the price of 2050 USD per ETH, it’s <strong>58 billion dollars of economic security for single chain.</strong></p><p>All these validators secure the single chain. Let’s imagine that we create 100 shards and distribute validators between them. If previously we had 880k validators for the single chain, now we have 8.8k validators per each shard, or 580 million dollars of economic security, or at least 174 million dollars to attack one shard.</p><p>If one shard is secured by significantly less funds than it contains, <strong>it becomes profitable to attack the shard.</strong></p><p>Therefore, sharded network can’t contain too many shards, because then their economic security will be too weak. It turns out that it’s impossible to really distribute the load among each network entity (validator node), because validators have to be divided into huge enough groups for network to remain secure.</p><p>We will rely on a number of 64 shards, because it’s used in most sharding specs and defining specific number will greatly help us with future calculations.</p><p><em>Ok. </em><strong><em>What about rollups?</em></strong> Let’s look at a lifecycle of rollup batches.</p><p>Currently, all data of L2 transactions is stored on L1.</p><ol><li><p>Some rollup <em>proposer</em> (or proposers if we talk about decentralised rollups) sends the compressed batch of these transactions on L1 through calldata,</p></li><li><p>then some rollup <em>sequencer</em> (or sequencers) reads this batch from proposer&apos;s transaction on blockchain, re-executes it, generates a ZK proof of this batch’s validity and sends this proof on the smart contract on L1.</p></li><li><p>Smart contract executes the proof, and if it’s valid, then the batch that this proof proves is valid by definition. Smart contract updates canonical merkle root (<em>very</em> <em>roughly</em> speaking, hash of everything) of the state and then rollups nodes can keep up with the chain according to this root in the contract on L1.</p></li></ol><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6b510afd48ae06adcdf6c52c6f72e6fa294a5f11d2d6c9f90adf4eaa47bea3bb.png" alt="Nodes can even rebuild the state from all batches that are stored in the blockchain, but usually rollups just implement fast sync from state roots" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Nodes can even rebuild the state from all batches that are stored in the blockchain, but usually rollups just implement fast sync from state roots</figcaption></figure><p>Do you see a bottleneck here? Don’t worry, i’ll help you.</p><p>Storage in Ethereum blockchain is limited. I mean, <em>very</em> limited. How much?</p><p>One non-zero byte <em>(you compress all zeroes down, right?)</em> of calldata storage costs <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.evm.codes/about#gascosts">16 gas</a>. Ethereum block has soft limit of 15m gas. if we assume that 1/4 of all gas of the block is spent only on rollups data, we’ll be able to fit <em>375k/16=</em><strong><em>~229 KB of data per block.</em></strong></p><p>I’ll take zkSync’s average transaction size of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.reddit.com/r/ethereum/comments/17qi9od/comment/k8d4ziu/">177 bytes</a>, so we get ~1324 transactions per block or <strong>~110 TPS</strong>. This is obviously not much. And these transactions would be <em>really</em> expensive, because Ethereum block demand is always high, and you’ll have to pay really high fee to take 1/4 of all blockspace just for your rollup.</p><p><em>If Ethereum blockspace is limited, we probably have to somehow spend it more efficiently to fit more transactions?</em> This is already made by many rollups using compression.</p><p><strong>Wait, why do we even have to store rollups’ batches permanently, if in the end rollup nodes just listen to the latest root from the L1 smart contract?</strong></p><p>If you already have this question, you’re right!</p><p>All rollups nodes by design use the rollup smart contract on L1 as a source of trust. If the contract isn’t buggy and L1 isn’t attacked (and it probably isn’t), then everything the contract says is truth. Therefore, thanks to the blockchain, everything the contract ever said is the truth too.</p><p>Scroll back to the scheme above. All transactions data is only used <em>once</em> - when sequencer takes it to generate the proof to the state they made. Then proof to the batch is verified and the system <em>does not need these transactions anymore</em>, because smart contract already accepted their execution in the rollup state.</p><p><em>Wait, doesn’t smart contract need the transaction data to execute the ZK proof to it?</em> No! Everything the contract needs is a <strong>commitment</strong> to the data.</p><p>Explanation for people that don’t know anything about ZK cryptography: <em>commitment</em> is a really short data that is derived from the main data and is used to execute ZK proofs that belong to this data. However, commitment can’t be used to <em>generate</em> proofs, only to <em>verify</em>. That is, we don’t need smart contract to have the data, we can just give it the short commitment and we’re good.</p><p><em>Yeah, I know, it’s the freaking witchery, just believe that it works, if you want, you can read about it from people more techy than me later.</em></p><p>The only thing we should do is <strong>to make sure that sequencers have all necessary data to generate the proofs until they generate and send them to L1.</strong></p><p><em>Sounds interesting! What if we make something on Ethereum that stores the data only as long as it’s needed?</em></p><p>We do! Currently Ethereum developers work (and they’re almost done!) on EIP-4844 update which enables blob transactions. <strong>Blob</strong> is some big amount of data which is stored separate from the blockchain, so it can be deleted later. The blockchain only stores the hash of the commitment to the blob, so sequencers can reveal the commitment to the contract and use it to prove the data <em>inside</em> the blob.</p><p>Blobs are only stored for 4096 epochs, or 131 072 blocks, or ~18.2 days. During this time, sequencers will obviously have time to generate the proof, many proving systems are already capable of generating proofs in a few minutes. And we even have some time for optimistic rollups that have to wait for 7 days, but we’ll leave it for now :)</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/36e2706c69cc9878fa83de73ddf87bfc154c5884cac5a4572b4343f644559fbb.png" alt="zkSync Era has around 24 hours finality and even it will have time to finalise :)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">zkSync Era has around 24 hours finality and even it will have time to finalise :)</figcaption></figure><p><em>Sounds cool!</em> Let’s calculate how much transactions it allows us to make.</p><p>One blob is 128 KB in size, EIP-4844 (blobs spec) specifies conservative <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-4844">3 blobs soft limit per block</a>. We’ll keep 177 bytes per transaction average from above, so we get: 128 * 1024 * 3 / 177 = ~2221 transactions per block or <strong>~185 TPS</strong>.</p><p>It’s worth noting that unlike blockspace, blobspace will only be used by rollups, so these transactions will be cheaper than blockspace ones. Also, 3 blobs soft limit was chosen for testing purposes and will be increased in the future. I expect this limit to be increased 3-4 times short-term, but I’m not a dev, so we’ll use these initial values for future computations.</p><p><em>Well, 185 TPS is better than 110, but still not really much.</em> Is there anything we can do to increase this space? <em>Hmm</em>… What if I told you that we can divide this data into relatively small validator groups, so the system can <strong>store more data</strong>? :)</p><p>Yes, you got me right. I talk about <strong>sharding</strong>, but with <strong>data</strong>. This mechanism is called <strong>danksharding</strong>.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/bd5494717fa02e3358c0363397f54bdb3672679517a70c77ee28c1e9fe62842e.png" alt="(Danksharding because of researcher Dankrad Feist, not weed)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">(Danksharding because of researcher Dankrad Feist, not weed)</figcaption></figure><p>I won’t go into technical depths of this mechanism, especially when it’s not fully done yet and is generally quite complicated, so we likely won’t see it in the next 2-3 years, but it’s something Ethereum community actively works on, and blob transactions are obviously one of required steps for danksharding.</p><p>Basically the logic is very similar to execution sharding:</p><ol><li><p>We split all validators into some sort of groups and distribute all incoming blobs to these groups equally.</p></li><li><p>They must store their blobs for certain amount of time. If any blob becomes unavailable (<strong>all</strong> validators in the group lost or pretend to lost it), these validators get slashed (deprived of the part of stake and kicked out)</p></li><li><p>Validators outside of this group can make sure that the data isn’t lost by asking committee for random small parts of the blob and applying some mathematical computations to them. If these points are valid, the whole blob is considered available, since it’s practically impossible for theoretical malicious actors to generate fake blobs that have same points of data as original blob. This mechanism is called <strong>D</strong>ata <strong>A</strong>vailability <strong>S</strong>ampling <strong>(DAS)</strong></p></li></ol><p>Wait, what? How is third part possible? Well, it’s ZK magic as well. You can read a paragraph below, but make sure that your brain won’t boil:</p><p><em>Remember how I told you that we can use commitment to the blob to ZK prove its contents in EVM? To make it possible, blobs were not just made as a chunk of bytes, but an array of mathematical points. All these points are provable through the commitment to the blob, therefore the more points you ask for, the less chance of malicious actor to generate all malicious points that are considered valid by the commitment.</em></p><p>This is very rough explanation that doesn’t do in depths, but the logic is like that. In fact, we don’t even need to know all the tech. You can read <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://domothy.com/blobspace">Blobspace 101 by Domothy</a> to get a deeper techinical understanding of how it works.</p><p><strong>So, basically danksharding</strong> is just fancy mechanism of distributing blobs to relatively small commitments of validators, so each validator don’t need to store all data. This way, the network can handle much more blobs. I’ll take the number of 192 blobs per block, because by that we form equal amount of ephemeral “groups” (64) both for execution sharding and data sharding.</p><hr><p><strong>Reveal your numbers!</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/15dbb5373029827fb833fe72340eaa569f1306da2942c1a234deb9e06c1c21de.png" alt="Which scaling design will you take?" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Which scaling design will you take?</figcaption></figure><p>Let’s summarise rollup scaling.</p><ul><li><p>There is a blockchain whose transactions must be confirmed by Ethereum blockchain.</p></li><li><p>Since Ethereum network nodes are run on Raspberry Pi’s and such weak garbage for maximal possible decentralisation, we can’t just re-execute all transactions of L2 blockchain on L1, it would simply be too hard.</p></li><li><p>Instead, we take one, two, five, doesn’t matter, expensive powerful clusters that execute extremely hard computations to generate small cryptographic proofs to transactions of our L2 blockchain.</p></li><li><p>Then, we send this proof to special smart contract on Ethereum that verifies this proof by certain cryptographic rules. It’s much easier just to validate the proof than to re-execute these transactions, that is, we in fact move all computation burden to few powerful clusters, leaving Ethereum blockchain unloaded.</p></li><li><p>By that, we get a blockchain that gets all security guarantees of Ethereum (because its validity is proven on it), but keeps all necessary load off Ethereum.</p></li><li><p>However, we have to store our transaction data for some time so sequencers (these powerful clusters) can download the data and generate the proof to it. We don’t need the smart contract to have this data, since for ZK proof short commitment to data is enough.</p></li><li><p>Storing all this data which is needed for an hour or two on the ledger that will outlive my grandchildren is a huge (and too expensive) overkill. So, we make special cells of data (blobs) that are deleted after 18 days.</p></li><li><p>But these blobs are still not enough (they give us ~185 TPS by my computations) so we’re also going to make an update that will split all validators to some amount of groups and distribute all newcoming blobs to them. This way we can store significantly more blobs than if each validator kept all blobs.</p></li></ul><p>Then, let’s summarise execution sharding scaling.</p><ul><li><p>Validators are weak because they work on cheap node hardware such as Raspberry Pi’s. Because of it, the Ethereum network can only handle, say, 15 TPS.</p></li><li><p>We split all validators into 64 groups and make them build their own chains. All these chains are coordinated by a single beacon chain, which is run by all nodes and therefore makes all chains interoperable.</p></li><li><p>???</p></li><li><p>Profit!</p></li></ul><p>What do these designs have in common? It may seem that they’re completely different, but in the end we still split all validators into groups, each of which performs its own task.</p><p>The difference is, in execution sharding these groups handle execution - smart contracts, accounts, transactions, just as in the normal Ethereum chain. In danksharding, they handle temporary data for rollups.</p><p>And now, finally, side to side comparison.</p><h3 id="h-performance" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Performance</strong></h3><p><strong>Rollups</strong>: In EIP-4844 where the whole network handles 3 blobs per block, it will handle data enough for <em>~185 TPS</em>, as we calculated earlier. But, if we take 64 “groups” and the same load per validator (3 blobs per block), danksharding would handle 192 blobs per block and therefore will allow rollups to perform 185*64 = <strong>~11 840 transactions per second</strong>.</p><p>It’s worth noting that for <em>small microtransactions</em> such as <em>gaming or tips</em> it may be useful to use <strong>Validiums</strong> and off-chain data availability solutions, such as Celestia, EigenDA or Near DA. These solutions will allow us to perform much more transactions than this, while these ~12k TPS can be used for more <em>serious payments</em>, where full Ethereum security is necessary.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/67006752cccc2bcaf5f46fd0e283025637ab55bcee3964b587f490ecf4983501.png" alt="How much data per second you can store on different systems (I stole the pic but numbers look legit so I won&apos;t re-check)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">How much data per second you can store on different systems (I stole the pic but numbers look legit so I won&apos;t re-check)</figcaption></figure><p>Also, blob limits will slowly be increased as tech improves. EIP-4844 limits were chosen as temporary to test the system and fix potential bugs on release. This means that with 2x increase we’ll have ~24k TPS, with 5x increase - ~60k TPS, and so on.</p><p>I believe that over time rollups teams will improve their compression mechanism as well, it’s generally a big field for potential improvements.</p><p><strong>Sharding</strong>: It’s hard to approximate TPS limit for the single Ethereum chain since transactions take different computations - some of them are token transfers, trades on Uniswap, NFT trades, etc etc. But I think current TPS is quite accurate metric, since current demand always covers supply (all gas is spent) and it reflects average gas consumption per consumer transaction.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/177be48be19d93b79b61fa6a24a7ee6b0a57786fffb1239df877af65c9f4fce7.png" alt="It&apos;s always around 12 TPS | Source: etherscan.io" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">It&apos;s always around 12 TPS | Source: etherscan.io</figcaption></figure><p>So, we have 12 TPS on the single chain, and we would have 64 parallel chains in execution sharding. Let’s add 3 more TPS, since we assume that rollups wouldn’t exist and therefore wouldn’t consume any gas. 15 * 64 = <strong>~960 transactions per second.</strong></p><p>So, we get at least <strong>~12.3x</strong> difference in performance in favor of rollups.</p><h3 id="h-efficiency" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Efficiency</strong></h3><p>By efficiency I mean how much work can be distributed among entities in the network.</p><p><strong>In monolithic chain</strong>, no work is distributed. Each node has to execute all computations in the network. This way, the network can only work at the speed of the single instance of it.</p><p><strong>In execution sharding</strong>, work can be distributed by splitting all validators into some amount of committees each working on its own chain. However, this distribution lowers economic security of each shard, because each shard has less validators than the monolithic network, and this security lowers proportionally with amount of shards.</p><p>People usually take the amount of 64 shards, because then <em>each shard</em> is secured by somewhat reasonable 1/64 of total stake = currently ~440k ETH = <em>~900m$</em>. It means that distribution capacity doesn’t depend on amount of entities of the network, but on economical security. This way, the network can’t work at the speed of more than <em>64 instances of the network</em>.</p><p><strong>In rollup scaling with danksharding</strong>, the most computation burden is on some powerful entities that generate ZK proofs to rollup batches. All rollups work at the speed of proof generation. If proofs only for 20 transactions are generated per second, the network will handle <em>20 TPS</em>, and so on.</p><p>However, proof generation speed is increased with each instance of sequencer system/s. The more provers there are, the more proofs are generated per second. The more proofs are generated, the higher is capacity of rollups. The only restriction is data availability which has practically unreachable limits mid-term.</p><p>It means that <em>in rollup scaling</em>, <strong>network scales with each new sequencer instance</strong>.</p><h3 id="h-tech-stack" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Tech stack</strong></h3><p>One of important technical differences of rollups and execution sharding is that while execution shards fully resemble the logic of Ethereum, rollups can be programmed to work on basically any existing stack, virtual machine, language, etc.</p><p>There are different types of <strong>zkEVMs</strong>, ZK rollups with ZK-friendly virtual machines that fully or partially resemble logic of EVM.</p><ul><li><p>Some of them, such as <em>zkSync Era</em>, provide only language-level compatibility, which means that you can use Solidity or Vyper for your zkSync smart contracts.</p></li><li><p>Another rollups, such as <em>Polygon zkEVM</em> and <em>Scroll</em>, implement EVM compatibility, which means that you can re-use all existing infrastructure, including compilers, for their rollups, but they will have higher fees due to more prover complexity.</p></li><li><p>Taiko, Type 1 zkEVM, resembles all logic of Ethereum blockchain including gas system and state trie. Because of that, it’s expected that their fees will be the highest among all zkEVMs, but that’s an option for those who need full equivalence with Ethereum tech.</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/06c2a9278a95ed53ea78bc739950074a5f29d126ff00359d9821f9f2fc7ef50d.png" alt="Source: https://vitalik.eth.limo/general/2022/08/04/zkevm.html" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Source: https://vitalik.eth.limo/general/2022/08/04/zkevm.html</figcaption></figure><p>There are also non-EVM rollups. Eclipse works on Solana VM, Fluent develops zkWASM, M2 is going to use Move VM which is used by Aptos and Sui, L1 blockchains. Starknet uses its own unique Cairo VM.</p><p>Besides virtual machines, there are also solutions with different DA systems. If you need full Ethereum security, you might want full rollups such as zkSync or Scroll. If you’re ok with data availability solutions based on external consensus, you can use Eclipse based on Celestia DA or Fluent based on Near DA. If you’re ready to trust single entity in exchange for near-zero fees, Validiums are your choice.</p><p>Different rollups have different decentralisation levels. zkSync currently works on switching to decentralised sequencing, which will be built in protocol. Taiko will be released with decentralised sequencing from day 0. Solutions such as Scroll and Starknet are using centralised sequencers, which may also be an option if you don’t want to take risks related to complex sequencing protocol or want to have pre-confirmations from single entity.</p><p>In turn, all shards of execution sharding resemble the same logic and work the same. You won’t be able to use different programming languages and VMs, have pre-confirmations, different gas tokens, in-built account abstraction, etc etc. Everything is Ethereum, nothing more, nothing less.</p><p><em>However, this diversity comes at the cost which I will cover later.</em></p><h3 id="h-security-assumptions" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Security assumptions</strong></h3><p><em>ELI5 - How hard is it to attack the system, what are the losses from an attack and how easy is it to recover from an attack?</em></p><p>In case of execution shard, it’s just as vulnerable to finality (51%) attacks as the current Ethereum chain, which means that if certain shard is attacked, attacker can prevent shard from finalisation or roll back certain blocks, essentially stealing money. In case of attack on data availability, the worst that can happen is that rollups won’t be able to continue the chain and will likely require to roll back unconfirmed batches through their governance.</p><p><strong>However</strong>, attack on <em>execution shard</em> and <em>data availability</em> looks completely different.</p><p>Technically, it’s much <em>easier</em> to store data than to run parallel execution layer. Instead of keeping up with the chain, possibly monitoring PBS, leader election, and all consensus burden, you just download some MBs of data and share with people when needed. Because of that, there would be more people storing all existing blobs from all committees than running all parallel chains. More RPCs, explorers, infrastructure solutions could afford to store everything for their products.</p><p>Moreover, unlike execution shard, data has 1/N trust assumptions. As long as any single entity stores required blob, it’s available, because you can prove that certain blob is valid with its commitment. Therefore, it becomes really hard to perform a censoring attack on blobs, because you have to somehow keep target blobs from <strong>all</strong> archive nodes. Just imagine - you can run a single archive node and you make any attack on blobs in the network impossible by oneself.</p><h3 id="h-interoperability" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Interoperability</strong></h3><p>With execution sharding it’s obvious. All shards are interoperable by design, because they coordinate through single beacon chain and belong to the same consensus mechanism. What about rollups?</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethglobal.com/showcase/xtra-protocol-k8k5t">It’s completely possible</a> to implement rollup interoperability protocol, however, such protocol requires fast finality, because we need to receive messages from L1 in the matter of blocks and be sure that message from one side won’t be reversed after its execution on the other side.</p><p>Modern proof systems already allow us to generate ZK proofs <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/Ozhar/status/1726697317166617039">in seconds on consumer-grade PCs</a>, but we have to remember that currently all rollups are in early stages and have “training wheels” - certain restrictions needed for fast and easy recovery of the chain in case of a bug or an exploit. One of these popular training wheels is proof delay. As example, Scroll delays batch finality by <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://scrollscan.com/batches">30 minutes</a> and zkSync delays it by <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://explorer.zksync.io/batches/">~24 hours</a>. It’s obvious that rollups can’t effectively interact with each other with such delays.</p><p>So, in order to make rollups interoperable, we should wait until they leave their testing phase, which will probably take a long time. Why?</p><h3 id="h-consensus-guarantees" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Consensus guarantees</strong></h3><p>In execution sharding, all shards are considered part of the Ethereum consensus. It means that if some of them contain a bug, or are attacked, it’s considered a fault of Ethereum consensus and therefore is a subject to a community fork.</p><p>It means that safety of users is guaranteed by community that will fork the chain in case of consensus fault. As example, if there was a bug that allowed malicious actor to steal ETH from people’s balances, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://gist.github.com/karalabe/e1891c8a99fdc16c4e60d9713c35401f">community would make a fork update to fix this bug</a>.</p><p>Rollups, in turn, are made by independent developers and do not count as the part of Ethereum protocol. This is not as big problem as if you had a sidechain that you can’t fork, because in rollups you at least don’t have a (attackable) consensus, but bugs still exist, and due to general complexity of modern ZK rollups, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/ChainLight_io/status/1720109308015485194">bugs are not a rare thing</a>.</p><p>Currently rollups deal with potential bugs by running centralised sequencers (provers), having special upgradeable contracts, creating security councils that can stop the rollup in case of emergency, and other restrictions that help users not worry about security of their assets, but seriously harm trustlessness and decentralisation of protocols. These training wheels can’t last long, that’s why rollups teams spend the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/zksync/status/1707742905912242200">most money and time</a> on bug bounties and audits in the whole ecosystem, but of course even that can’t make them sure about security of protocols that are expected to handle trillions of dollars and the whole world financial system. If they’re hacked, there’s nothing Ethereum community and consensus can help them with.</p><p>One of solutions that <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/gluk64">Aleks Gluchowski</a> (zkSync) has suggested is <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/gluk64/status/1697964707548676245">the system of on-chain Courts in Ethereum</a>. Basically the idea is to make some sort of community court that can fork L1 in case of a bug in some big protocol (DeFi or L2) important to Ethereum ecosystem. This is definitely a controversial idea, because it questions the whole “code is law” philosophy <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum.org/en/history/#dao-fork"><s>(which was already violated once)</s></a> and in fact brings Ethereum back to the web2 world of human vices - corruption, corporation or government propaganda, etc etc.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/81b2e2b86198a19a607f42198687965f622620af3750912484e8f5c94c1321e0.png" alt="Source: Twitter post above" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Source: Twitter post above</figcaption></figure><p>Another, more technical solution is to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vitalik.eth.limo/general/2023/09/30/enshrinement.html">enshrine some standardised zkEVM inside of Ethereum protocol in a form of precompile</a>. The advantage of this idea is that we still have fork guarantees of L1, but they aren’t related to problems of certain rollup or Dapp. As long as bridge with proposing and sequencing works normally in the rollup, everything else is secured by L1 consensus.</p><p>However, its serious problem is that it doesn’t support any rollups that are <em>different from standardised zkEVM</em>, for optimisation reasons or because they work on a different VM. While there are ZK rollups that follow the philosophy of <em>“as close to Ethereum as possible”</em> such as Scroll or Taiko, rollups such as <em>zkSync Era</em> have their own version of EVM-like virtual machine with many features and peculiarities that <em>don’t exist</em> in canonical EVM, such as account abstraction and system contracts.</p><hr><h2 id="h-conclusion" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Conclusion</strong></h2><p>We can summarise this comparison with the table below:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a226962d944752eda1d38990bb37140b06b6a38f26d1a0b3c3fee8fccd7e2375.png" alt="Excalidraw was probably not the best option to make this pic" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Excalidraw was probably not the best option to make this pic</figcaption></figure><p>While being native to Ethereum tech, execution sharding can’t scale to the levels of rollups and nearly isn’t as secure as rollups with danksharding. Danksharding, being a data sharding mechanism, is probably the most secure way to distribute data since it doesn’t rely on honest majority, blobs can be stored by anyone and single person can prevent any censoring attack on blobs this way.</p><p>In crypto, we don’t like <em>“it works if nothing breaks”,</em> but we have to admit that in comparison with execution sharding, danksharding is pretty much impossible to break in normal circumstances. And even if it’s broken, rollups <em>don’t risk</em> stolen funds, because consequences of an attack are easy to recover from, especially with well-built governance system. We still have a monolithic system secured by <em>60 billion dollars</em> under the hood!</p><p>Rollups can allow developers to make their rollups fully based on their needs and easily configurable. They can create anything, from custom sequencing rules or account logic to a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.starknet.io/en">custom VM</a> or a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.cartesi.io/">Linux runtime inside of a rollup</a>. Rollups open actual blockchain parallelisation by allowing each entity, even if it’s your home PC, to contribute to execution of transactions in the network.</p><p>However, this all comes at a cost: <em>rollups can’t have security guarantees of Ethereum consensus</em>, so their development is really hard, expensive and takes long time. The work is going, and I think that in a year or two, we’ll already start to see <em>fully interoperable rollups with shared liquidity</em> and smart wallets that <em>abstract the whole “rollups” term on UX side</em>, so we can enjoy basically monolithic experience, but with distributed efficiency and bulletproof decentralisation.</p><p>Thank you for reading.</p>]]></content:encoded>
            <author>alexhook@newsletter.paragraph.com (alex hook)</author>
        </item>
        <item>
            <title><![CDATA[Foundations and orders of rollup-centric Ethereum]]></title>
            <link>https://paragraph.com/@alexhook/foundations-and-orders-of-rollup-centric-ethereum</link>
            <guid>XncQ5ZE1Y8c8Ejt28UXP</guid>
            <pubDate>Tue, 24 Oct 2023 03:42:37 GMT</pubDate>
            <description><![CDATA[In this article I want to tell about current state of Ethereum scaling, demystify some of false points about rollup-centric Ethereum and explain how to navigate in all of this if you’re a developer or just interested in this topic. To my surprise, there are no guides of Ethereum scaling angle for developers. Yeah, you can find articles that explain what is a rollup, what are their differences, how to develop on rollups, etc. But all this looks like building on top of another chains and pretty...]]></description>
            <content:encoded><![CDATA[<p>In this article I want to tell about current state of Ethereum scaling, demystify some of false points about rollup-centric Ethereum and explain how to navigate in all of this if you’re a developer or just interested in this topic.</p><p>To my surprise, there are no guides of Ethereum scaling angle for developers. Yeah, you can find articles that explain what is a rollup, what are their differences, how to develop on rollups, etc. But all this looks like building on top of another chains and pretty much nothing related to what all these rollups have to do with Ethereum ecosystem and how to build your projects if you want to get the most out of <strong>Ethereum</strong> while reaching maximum scaling.</p><p>It’s expected that you have knowledge of how Ethereum works and all sharding/rollups explanations here are of a reminder nature.</p><hr><p><strong>What is scaling</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4803d24af649e6dba882a631f8ca4800980e71bf2fc30fa776a63f989e821df4.png" alt="In short, you don&apos;t want people to spend that much on interactions with your projects. Just imagine that a year ago these numbers were constantly at least 5x higher!" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">In short, you don&apos;t want people to spend that much on interactions with your projects. Just imagine that a year ago these numbers were constantly at least 5x higher!</figcaption></figure><p>We can define scaling as <em>increasing blockchain network throughput without increasing node requirements</em>, that is, how powerful PC you need to run a client of your network. Ethereum philosophy says that for the actual decentralised network, node requirements must stay at the level of consumer PCs. For example, full node takes slightly more than 1 TB of storage and such SSD can be found for ~100$. All other requirements are approximately at the level of Pi4 microcomputer.</p><p>From this fact it’s logical to assume that Ethereum network throughput is quite low. That’s right - it usually processes 12-15 transactions per second. We can’t calculate exact throughput in transactions per second, but if we assume that all transactions are ERC20 tokens transfers, we’ll have a number of 20 TPS.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3233ab2d55a44838f1bb8581eaefc3efe7da575d7bc03bdb749e31358c22810e.png" alt="At the time of writing, chain is averaging 12 TPS" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">At the time of writing, chain is averaging 12 TPS</figcaption></figure><p>Is it much? Well, if we take 100M users, it’s 0.017 transactions per day for one user or one transaction per 58 days. Obviously, this is not enough, not to mention all 8 billion people on the planet. To onboard 100M users each making 3 transactions per day, Ethereum network must process ~3472 TPS.</p><p>How’s it possible? That’s the task that Ethereum community was trying to solve for years. Previously we were working on <strong>sharding</strong>.</p><p><strong>What is sharding</strong></p><p>Sharding is a mechanism that splits the network into many interoperable chains, all of which are proven and coordinated by some central chain.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ba38e8e3de244fa421c0a0c8e396b56b04f4e21e509add399ad1f0b4da2fce47.png" alt="Some old scheme that I found on the internet" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Some old scheme that I found on the internet</figcaption></figure><p>All of these chains should have been operated by validators distributed into small sections called <em>committees</em>. This system was expected to be released on Ethereum 2.0 upgrade, but it was abandoned in favor of rollups.</p><p><strong>Rollups</strong></p><p>Many people think that rollups are complicated, but in fact they’re even simpler than sharding mechanism. Rollups are independent blockchains whose validity is verified by the Ethereum blockchain. They’re often called Layer 2 because they in fact stay on top of Ethereum which acts as a Layer 1. How do they prove their validity? There are two basic methods.</p><p><em>ZK Rollups</em></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/308294cf90248ec0b73075be2c8dfc7186753a021f6c56cb0c1c74222531d002.png" alt="I stole this picture too" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">I stole this picture too</figcaption></figure><p>Group of transactions is executed and bundled in the single structure called batch and sent to the Ethereum blockchain. Then, sequencer or group of sequencers generate a ZK proof of this transaction set’s validity and send this proof to the smart contract on Ethereum L1. Smart contracts executes (validates) this proof, and if it’s valid, then transactions it belongs to are valid by definition.</p><p>What is ZK proof? Well, my explanation will not be exhaustive at all, because it entirely sounds as a magic and to understand how it works internally, you should have strong knowledge in cryptography. ZK (Zero-Knowledge) proof is a set of mathematical equations that allow you to prove outputs of some computations without executing these computations yourself, either because they’re too hard for you to execute or because you don’t have some of necessary values to execute it.</p><p>In this case, we have a batch of X transactions. They all produce changes in the current network (L2 one) state. Sequencer generates ZK proof that states that if you execute all these transactions, they will all be valid and will produce required changes in the state (transfer some ETH, changing storage in some smart contract, etc).</p><p>ZK proof is crazy difficult to generate (it requires lots of GPU computations and some time), but extremely easy (compared to what computations it proves) to validate. That’s why they’re used here - we can execute all hard work off chain, and keep remaining easy work (proof execution) on chain. This way, we keep Ethereum network unloaded, but remain its security guarantees.</p><p><em>Optimistic rollups</em></p><p>ZK cryptography is really young, and when rollup scaling was just adopted, it was too undeveloped to actually prove EVM computations. Because of this, optimistic rollups were invented first.</p><p>The point of optimistic rollups is that they assume that loaded batch is valid by default, until some of rollup operators won’t prove the opposite. If some batch appears to be invalid (e.g it has a transaction that double-spent ETH), an operator sends a <em>fault proof</em> to L1 and if it’s valid, rollup’s smart contract on L1 reorgs the chain to remove invalid data. Fault proof is a message that asserts that some transaction inside the batch is invalid.</p><p>Among advantages, it’s lightweight. No one has to execute any hard computations and as long as one honest operator exists, the chain is safe.</p><p>However, its serious disadvantage is <em>challenge time</em>. In ZK rollups, batch is safe as soon as someone provides a ZK proof to it. In modern ZK rollups, it takes from 15 minutes to an hour and constantly improves. In optimistic rollups, batch is considered safe when no one has provided a fault proof to it in a certain period, which is called challenge time. Usually it’s 7 days and it can’t be lower than few hours because then it becomes possible to attack the chain.</p><p>Batch finalisation is a crucial requirement for <strong>rollup interoperability</strong>. L2→L1 messages are executed only after they’re finalised and safe. Rollup can’t effectively communicate with other rollups if its messages are delayed by 7 days each.</p><hr><p><em>Here we go to the main part of article.</em></p><p><strong>“Rollups are not Ethereum”</strong></p><p>This really common point may seem fair, because unlike shard chains, which are interoperable and thus share the same liquidity, dApps, etc, rollups live completely on their own as entirely separate blockchains, and the only thing that they share is security.</p><p>However, I’d say that this is partially made by us. We’re not used to new rollup world and trying to build our projects just as we were doing it in alt-L1 era.</p><p>Here I’ll share some principles that you should follow as a developer to build efficient apps that are ready for cross-rollup interaction.</p><p><strong>1) Be a ZK rollup maximalist</strong></p><p>While choosing a rollup to build on, you may choose Arbitrum and Optimism for the single reason - they’re popular and already have many users, so it’ll be simpler to attract people. Now you’re trapped in the chicken-egg problem.</p><p>Arbitrum and Optimism are the most popular because they were first and attracted first people, which attracted first dApps, which attracted new people, which… you know what’s next. Arbitrum and Optimism are both optimistic rollups with 7 day challenge time, it means that they won’t effectively communicate with people on other rollups in the near future.</p><p>Ok, what’s wrong in only using these two and not using anything else? - In short, centralisation risks and stack limitations. Your project may require built-in account abstraction, general purpose languages, fast communication with L1, and other things that exist on other rollups, but not on Arbitrum and Optimism.</p><p>ZK rollup ecosystem is developing really actively. Most of them already have &lt;=30 minutes finality. This means that no matter which ZK rollup you’ll take, as long as it’s ZK rollup, it is fast in finality and it will be even faster when technology improves.</p><p>This might all seem like a rude or biased statement, so I’ll clarify. Optimistic rollups have a right to exist, but ZK rollups are more modern in many ways and if you look for a rollup to build on, take a closer look at the rollups, even if they’re not so popular. You will not regret in the future.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8c143cacfb709c6bc5454620087ba06d143fc6367aa4987981c5131264d71d6c.png" alt="Polygon zkEVM" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Polygon zkEVM</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4c28f66e654e877054ce46e856c256e6a4a2fa410c15bf9dd40fa8181a23c26b.png" alt="Scroll" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Scroll</figcaption></figure><p><strong>2) Choose a rollup based on your needs</strong></p><p>One non-obvious advantage of rollups over shard chains is that rollups are developed independently by various groups based on different paradigms and principles. All rollups are not alike - different zkVM/zkEVM types, account systems, proof systems, gas prices. They’re all different so that you, as a developer, can choose the one you need for your project.</p><p>If you want an experience close to Ethereum - use <strong>Scroll</strong> or <strong>Linea</strong>.<br>If you want an experience too close to Ethereum - use <strong>Taiko</strong>, it will cost you higher fees.<br>If your project is expected to execute many changes of same state elements - use <strong>zkSync</strong>, its state diff-based proof system lets you pay once for multiple state element changes. It also has built in account abstraction that you may need as well.</p><p>If you want to use WASM - use <strong>Fluent</strong>.<br>If you want to use Solana VM - use <strong>Eclipse</strong>.<br>If you want to build a private dApp - use <strong>Polygon Miden</strong> or <strong>Aztec</strong>.</p><p>There are many different systems with different features and drawbacks, and it’s worth exploring many options to choose the one that suits you best.</p><p><strong>3) Application-specific Rollups or “RollApps”</strong></p><p>If you feel that your project is going to be big, or you’re already the big project on Ethereum L1, it’s worth taking a look at rolling out your own rollup.</p><p>The huge advantage of this approach is that you can deal with the load yourself and you don’t have risks related to staying on general purpose rollups. Also, if your project is used really frequently, the rollup you stay on can overload and proof generation will significantly slow down, while on your own rollup you can set up sequencer rigs yourself. Users from all rollups can enjoy the same liquidity and prices, which isn’t possible when project is deployed on many chains raw.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/108f1df4ba8839738e8d274efd4352b42d4d778c97842f8a57660830c2595193.png" alt="RollApp can be used from both L1 and L2" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">RollApp can be used from both L1 and L2</figcaption></figure><p>You can make it open for everyone or restrict to your project, use EVM, SVM or no VM at all, possibilities are unrestricted. Whatever you implement, you still seriously reduce fees for users.</p><p>However, it leads to many difficulties. In particular, you have to develop and control your own chain, which is quite complex and expensive, even using existing stacks (ZK Stack, Polygon zkEVM Stack, etc). Also, you’ll probably have to make a web interface with built-in bridging to your rollup.</p><p>Generally, this approach isn’t for everyone, but for huge projects such as Uniswap, AAVE, Curve, that’s probably the best option.</p><p><strong>4) Token-based projects</strong></p><p>If you’re an RWA project, let’s say stablecoin, or liquid staking provider, consider <strong>not using rollups at all</strong>. If your project has a token for governance or utility purposes, deploy the token on L1. Why?</p><p>The main reason is that it’s way easier for cross-rollup transfer solutions to transfer tokens that only exist in the form of bridged L1 assets. All rollups have built-in ERC20 and ERC721 bridges, and the first liquidity that rollups gets after its launch is inherited liquidity from ERC20 tokens on L1. Mostly it’s stablecoins and liquid staking tokens.</p><p>You can always move a token to L2 if it’s deployed on L1, but not vice versa. For example, that’s the reason why native USDC on Arbitrum is still not really used compared to the natively bridged USDC.e that is also redeemed from the most bridges for the same reason. Natively deployed assets break inter-rollup supply chains by making it impossible to reorganise funds through common L1 by unbridging-bridging.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3bf10402cddcd3a56f29a99b7299221a9def78e255ef2b5710e916dd853bdccb.jpg" alt="Interesting fact: Worldcoin, the project on Optimism, deployed its token only on L1 and bridged it to the Optimism through native bridge" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Interesting fact: Worldcoin, the project on Optimism, deployed its token only on L1 and bridged it to the Optimism through native bridge</figcaption></figure><p>Same goes for RWAs and NFTs. You probably want your NFTs to be traded and transferred between different users on different rollups, and for these tasks it’s worth deploying on L1.</p><p><strong>5) On cross-rollup protocols</strong></p><p>It’s worth noting that currently no cross-rollup protocols were developed, it means that all wallets are tied to their chain and can’t use apps from another chains out of the box. Of course, such protocols will start releasing in the near future, but if you want to attract users from another rollups right now, you’ll have to implement algorithm of cross-rollup interaction with your project yourself.</p><p>I can note that such system can be built using L2→L1 and L1→L2 messages that exist in all rollups. You can use optimistic-style communication or transmit messages off-chain, the logic is on your side. However, I wouldn’t recommend using protocols that work on their own consensus such as Chainlink or LayerZero, because then you not only accept the risk of failure of Ethereum consensus, but also of the cross chain protocol.</p><hr><p><strong>Summary</strong></p><p>We can summarise rules for building on rollup-centric Ethereum like this:</p><ul><li><p>Consider using ZK rollups for your project</p></li><li><p>Choose a rollup based on your needs and not TVL or users</p></li><li><p>If you’re a big project, consider running your own rollup</p></li><li><p>Do not deploy to L2 tokens that you expect to be used outside this L2</p></li><li><p>Use L1-L2 communication possibilities to unlock cross-rollup interaction</p></li></ul><p>By following these rules we are paving the way to the interconnected, interoperable Ethereum future, and the solidity of Ethereum ecosystem is the key to the user experience and mass adoption.</p><p>Thanks for reading.</p>]]></content:encoded>
            <author>alexhook@newsletter.paragraph.com (alex hook)</author>
        </item>
        <item>
            <title><![CDATA[Why MEV is unavoidable]]></title>
            <link>https://paragraph.com/@alexhook/why-mev-is-unavoidable</link>
            <guid>NFjzA2cfPI3jLaNOiSDF</guid>
            <pubDate>Tue, 17 Oct 2023 12:13:08 GMT</pubDate>
            <description><![CDATA[UPD 2024/08/28: Two months ago, I authored a series of articles for Etherpedia, an initiative by the 2077 Collective aimed at providing beginner-friendly content on various Ethereum technologies and roadmap elements. This series included an article titled “The Roadmap: How to Train Your MEV,” which draws heavily from the article you&apos;re reading right now. As I consider it an enhanced version of this article, I strongly recommend reading the updated version instead. I’ll keep the original ...]]></description>
            <content:encoded><![CDATA[<p>UPD 2024/08/28: Two months ago, I authored a series of articles for <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherpedia.2077.xyz">Etherpedia</a>, an initiative by the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://2077.xyz">2077 Collective</a> aimed at providing beginner-friendly content on various Ethereum technologies and roadmap elements. This series included an article titled <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherpedia.2077.xyz/posts/train-your-mev/">“The Roadmap: How to Train Your MEV,”</a> which draws heavily from the article you&apos;re reading right now. As I consider it an enhanced version of this article, I strongly recommend reading the updated version instead.</p><p>I’ll keep the original article uploaded for historical purposes.</p><hr><p><em>Foreword: by “unavoidable“ I don’t mean that it’s impossible to get rid of some MEV, but that all smart contract networks with trustless sequencing have or will have it by default if they don’t fight it. In this article I’ll dispel some myths about MEV, particularly “Ethereum has MEV because it’s broken, chain X does not have it“ and look at different methods to fight MEV.</em></p><hr><p>What do Bitcoin and high-TPS L1 maxis have in common? You probably won’t guess, so I’ll answer - they both use absence of MEV as an argument for their chains. Of course, I see these arguments as completely inappropriate. To prove it, let’s define MEV.</p><p>MEV <em>(maximal extractable value)</em> is a practice of block builders using their right to order transactions in their blocks at their discretion to insert certain transactions in certain positions to get additional profit.</p><p>As example, on Uniswap ETH costs 1500 USDC, and on Sushiswap it costs 1510 USDC. Block builder creates an arbitrage transaction and inserts it before anyone else’s transactions to prevent anyone from using this arbitrage opportunity before them. By that, block builder got profit from this arbitrage in addition to block reward and priority fees.</p><p>However, there are many ways how block builder can use transaction ordering for additional profit. I like this terminology from <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://notes.ethereum.org/@domothy/mev_burn_faq">Domothy</a>:</p><ul><li><p><strong>Non-toxic MEV</strong> is MEV that does not affect specific users. An example above is example of such MEV.</p></li><li><p><strong>Toxic MEV</strong> is MEV that targets specific trades, affecting their initiators. Mostly it’s frontrunning (sandwich) attacks.</p></li></ul><p>What’s frontrunning (sandwich) attack? It’ll be simpler to explain by example:</p><ol><li><p>I want to buy 1 million USDC worth of ETH on Uniswap. I create such transaction with 1% slippage <em>(slippage is maximum difference in price at which I’m still willing to make a trade)</em>.</p></li><li><p>Builder that creates a block sees my transaction in mempool, creates a transaction that buys maximum amount of ETH that does not increase the price more than by 1%, inserts it in their block, then inserts my transaction, then inserts their own transaction that sells ETH bought from their previous transaction.</p></li><li><p>Because my trade is large, it increases ETH/USDC ratio in the pool, which is in turn abused by the block builder. From the point of transaction ordering, it looks like that - they buy ETH cheap making it more expensive, I buy ETH for high price and make it even more expensive, they instantly sell those ETH for the new price, returning the price to previous values and receiving the profit at my expense.</p></li></ol><p>It’s sometimes called <em>sandwich</em> attacks because our transaction is inserted right between two builder transactions, making it similar to sandwich.</p><p>While it may seem that both types of MEV are harmful, non-toxic MEV is actually helpful for users.</p><p>Before PoS, MEV was not as developed, mainly because the block reward (static 2 ETH/block) was much higher than potential MEV rewards. All arbitrages were happening with on-chain gas competition, which affected gas fees. With MEV, there is no competition for arbitrage, so users can enjoy nearly identical prices on all DEXs without suffering constant gas price “pallet“.</p><p><strong>It looks like a great money generator, why don’t all chains have MEV-extracting builders?</strong></p><p>With Bitcoin it’s simple. Bitcoin does not have decentralised exchanges because it does not have actual smart contracts. Bitcoin miners don’t extract MEV because there’s nothing to extract it from.</p><p>With high-TPS L1s (and by this term I mean dPoS chains), it’s because they are centralised and a right to build blocks is restricted to several entities. For example, BNB Chain has <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://bscscan.com/validators">61 validators</a>, Polygon PoS has <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://polygonscan.com/stat/miner">100</a>. They’re usually affiliated with chain team and have an obligation not to extract MEV.</p><p>Trustless networks are already starting to get their own MEV solutions. Solana, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://defillama.com/">3rd</a> smart contract platform with trustless sequencing, has <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.jito.wtf/validators/">Jito</a>, MEV-boosted validator client. I honestly don’t know why Avalanche, 2nd in this rating, doesn’t yet have its MEV, I assume that it’s because most of its TVL is concentrated in lending platforms and doesn’t circulate.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/15a73b2fa4a83268ebf35c4c1b8cf8d08a64fdec4137ec8b0102738d3fbe9704.jpg" alt="Chains with centralised sequencers are crossed out. Sorting by dApp TVL (defillama.com)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Chains with centralised sequencers are crossed out. Sorting by dApp TVL (defillama.com)</figcaption></figure><p>If we have a public transparent chain with large economic activity happening 24/7 where everyone can build their blocks how they want, it’s impossible to make sure no one’s extracting MEV or only extracting non-toxic MEV.</p><p><strong>Is there anything we can do about it?</strong></p><p>If we look at non-toxic MEV, I think it’s probably impossible to prevent it.</p><p>The point of arbitrage is that you buy for less in one place and sell for more in other place, leveling out supply-demand ratio and therefore price in these two places. To prevent it, arbitrager must not know what price can DEXs offer for certain pairs, which is obviously not possible.</p><p>However, preventing toxic MEV is more than possible.</p><p>One of solutions that <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/watch?v=XRM0CpGY3sw">Justin Drake</a> (i don’t know if he was first) suggested is <strong>encrypted mempools</strong>. As far as I understood, the point is to make encrypted batch transactions which are decrypted only on execution. With this system, it’s not possible to attack certain transactions, only to make some work before and after batch execution, which greatly minimises toxic MEV possibilities.</p><p>One DEX that has similar algorithm is CoW Swap.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e1cf4c0ca0f6154437bc595f14c87ffc07cae1d54bd886ec763d8aa6d9781bfc.png" alt="Useless screenshot to make article look more full" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Useless screenshot to make article look more full</figcaption></figure><p>CoW Swap packs all trades in batches and executes them at one time, so it’s impossible to frontrun certain trade inside the batch. Batches can be created by anyone, so the system does not rely on trust.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/80e1b3bfd06ac4b1561b5ae27c6277c6feed5203fcdfde03988654a48b07366f.jpg" alt="Interesting fact: Vitalik used CoW Swap to prevent losses from MEV when selling large amount of MKR" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Interesting fact: Vitalik used CoW Swap to prevent losses from MEV when selling large amount of MKR</figcaption></figure><p>It’s worth noting that encrypted mempools mostly are generally not intended to be enshrined in protocol, they can be used by certain protocols that want to protect their users from MEV.</p><p><strong>MEV Burn</strong></p><p>It’s quite off topic, because it doesn’t prevent MEV itself, but I still want to tell about it, because it’s interesting technology that can help turning MEV to something helpful for the network and from some side even for the users. Also, it’s mentioned in the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/VitalikButerin/status/1588669782471368704">Ethereum roadmap</a> by Vitalik.</p><p>MEV Burn is the part of <strong>P</strong>roposer-<strong>B</strong>uilder <strong>S</strong>eparation, a proposal that separates block proposing and block building to different entities of the consensus. Its point is an election of block <strong>b</strong>uilder based on how much ETH they burn in their block. A simplified example:</p><ol><li><p>Builder A has built a block that collects 1 ETH MEV and notifies the chain that their block can burn 0.5 ETH (they want to keep other 0.5 ETH for themselves)</p></li><li><p>Builder B has built a block that collects 0.8 ETH MEV and notifies the chain that their block can burn 0.6 ETH (that is, they’ll keep 0.2 ETH)</p></li><li><p>Builder bids time is ended, chain elects Builder B for building the block because it burns the most ETH.</p></li></ol><p>How is it helpful for users?</p><p>Right now, ETH economics work like this: the more people use Ethereum, the higher the fees. The higher are fees, the more ETH is burned. The more ETH is burned, the higher deflation rate. If few people use Ethereum, fees become lower and ETH becomes inflationary, incentivising people to spend it more actively.</p><p>MEV burn pushes ETH economics forward: burn rate depends not only on gas usage, but also on <em>economic activities</em> happening on chain. The more trades, loans, etc happen on chain, the more MEV opportunities appear. The more MEV is extracted, the more ETH is burned. All next steps repeat steps from paragraph above :)</p><p>By that, Ethereum usage that affects ETH inflation/deflation rate is not just gas used, but actual economic usage by <em>people</em>. Roughly speaking, people can theoretically use 5m gas per block but execute so large amount of trades that ETH will still be deflationary.</p><p>In short, MEV burn raises “ultra sound money” to another level.</p><hr><p><strong>Summary</strong></p><p>MEV will always exist on chains with high economic activities where block building is available for everyone, because MEV is not property of Ethereum, but property of market - making as much money as possible when possible. While it’s not possible to fully prevent MEV, we should seek for solutions that minimise damage from MEV, using encrypted mempools or any other technology. Some of them even already exist and you can use them today.</p><p>Thanks for reading.</p>]]></content:encoded>
            <author>alexhook@newsletter.paragraph.com (alex hook)</author>
        </item>
        <item>
            <title><![CDATA[Ethereum and Solana]]></title>
            <link>https://paragraph.com/@alexhook/ethereum-and-solana</link>
            <guid>5w5zpHsdXv41izsQfLyt</guid>
            <pubDate>Thu, 12 Oct 2023 10:45:51 GMT</pubDate>
            <description><![CDATA[It’s hard to come up with what to write when completely nothing happens in the field. Usually I come up with ideas for articles when reading someone else’s materials. For example, I made “Rollup interoperability“ after reading about Chainlink CCIP, and “How we can use Ethereum to fight corruption“ after reading specs of yet another country’s CBDC. I could write something about war in middle east but in the world where everyone talks about it, who would want to read even more about it in the c...]]></description>
            <content:encoded><![CDATA[<p>It’s hard to come up with what to write when completely nothing happens in the field. Usually I come up with ideas for articles when reading someone else’s materials. For example, I made <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/alexhook.eth/g8FifgWnh6w9fIXX4DJrZXFf3nsr0dPgARrdFtzbHNs">“Rollup interoperability“</a> after reading about Chainlink CCIP, and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/alexhook.eth/eNlilsrvBYc6byv0tozUNS1hLSBeVWVhGUYcImgBhLo">“How we can use Ethereum to fight corruption“</a> after reading specs of yet another country’s CBDC. I could write something about war in middle east but in the world where everyone talks about it, who would want to read even more about it in the crypto-related platform?..</p><p>So I’ll discuss the first thing that appeared in my twitter wall - Placeholder VC’s <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.placeholder.vc/blog/2023/10/10/ethereum-and-solana">“Ethereum and Solana“</a> article. While in this article Ethereum and Solana are compared to iOS and Android and the whole point is quite abstract, I’ll talk about the main difference between them, not technical, but somewhat ideological.</p><hr><p>The competition of most L1s comes down to solving blockchain trilemma. Blockchain trilemma says that there are three main characteristics of blockchains - security, scalability, and decentralisation. All modern blockchain systems can only have two of them, and we need to solve all three to make web3 happen.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/669ddce520a0dd8a4de0db51219033b2fb300d8848d709b78d512ec83074d62d.png" alt="Source of pic: vitalik.eth" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Source of pic: vitalik.eth</figcaption></figure><p>As decentralisation is quite abstract metric, I’d change it here to <em>Security (how much does it cost to hack the network and to recover from hacks) - Scalability - </em><strong><em>Users’ power</em></strong><em> (how many things in the network depend on ordinary users)</em></p><p>It’s worth noting that by power I don’t mean harmful actions of any specific person, but <em>collective network management</em> - in other words, how many things user community can control and change themselves if needed?</p><p>Different views on this factor, in fact, lead us to different scaling methods:</p><p><em>Ethereum</em></p><p>We can shortly define Ethereum’s scaling strategy as trying to squeeze out as much TPS as possible from Ethereum, while keeping node requirements at the level of home PCs and microcomputers not exceeding price of 100-200$ + consumer-grade SSDs.</p><p>By philosophy of Ethereum community, a real decentralised system must be possible to run by everyone, and only with this approach people can make worldwide computer compete with existing web2 world. It’s obvious that this approach imposes many difficulties to scalability that the community has been solving for a long time. In fact, all development in the Ethereum since its launch comes down to making the system more scalable while not increasing node requirements.<br>We can’t say that Ethereum community is done and they probably won’t be done for years, but right now they’re quite close to significant changes. Specifically, upcoming EIP-4844 update will increase bandwith in tens of times for rollups that already handle <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://l2beat.com/scaling/activity">5x TPS of Ethereum L1</a>. This is the first significant step in solving this hard task of Ethereum philosophy.</p><p><em>Solana</em></p><p>Solana philosophy, in turn, says that technology is developing, and we should use it to the fullest. Solana node requirements are quite close to the power limit of modern server computers and the whole system is designed in the way that unnecessary load is stripped off. Needless to say that it’s impossible to run a node at home or on the average hardware, only the most powerful servers in large datacenters can handle the load.<br>Solana community believes that it’s completely fine if nodes are mostly run by projects on top of Solana, RPC providers etc, because they are also somewhat run by the community. In this view Ethereum vs Solana philosophy is quite close to 2017-era Bitcoin vs Bitcoin Cash philosophy.</p><p>This similarity is even reflected in the areas of development. It’s hard to say that now Bitcoin is developed at all, but in this 2017-era Bitcoin community was thinking how to scale the network keeping node requirements around microcomputer level (SegWit, Lightning, etc.), while Bitcoin Cash community was (and is) thinking how to use modern tech possibilities as efficient as possible (Xthinner, UTXO Fastsync, etc).</p><p>In case of Ethereum and Solana, Ethereum community is mostly working on ZK cryptography in rollups and Ethereum L1 itself, distributed provable storage via Danksharding - in short, technologies that help with scaling while keeping hardware requirements same. Solana community, in turn, mostly works on optimising its protocol. For example, Jump Crypto team develops <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/firedancer-io/firedancer">Firedancer</a> node client which is written entirely in C with Assembly and uses various memory and cryptography hacks for maximal client optimisation. It will allow protocol to work faster on modern professional-grade tech.</p><p>I consider it as the main difference between Ethereum and Solana.</p><hr><p>A year or two ago it would be fair to simplify Ethereum vs Solana tech to decentralised vs centralised. However, if we look at the current state objectively, neither projects have single point of failure or controlled by anyone. Yes, it’s definitely simpler to control Solana than Ethereum, Solana is way more dependent on current state of tech and less “apocalypse-resistant“ than Ethereum, former also has some controversial design decisions in order to implement its view e.g leader mechanism, but I would say that now Ethereum vs Solana philosophy is something more complex than decentralised vs centralised, people vs companies, proletariat vs bourgeois <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/aeyakovenko/status/1708512030184132777">(sic!)</a>, etc etc.<br>This leads to the fact that we can’t objectively say which approach is better. It depends on your opinion and life views, what you consider as web3 more.</p><p>What about me?</p><p>My views are closer to Ethereum philosophy. I very appreciate possibility of participating in the worldwide network even if you’re not running a commercial project or can’t afford renting a powerful server on your own. I also believe that trying to solve the main Ethereum challenge can lead to many scientific discoveries even outside the crypto space. I’m eager to help with difficulties that Ethereum community meets on its way, although I can’t say that I’m doing anything significant right now. :-)</p><p>The future will probably show who’s right. While we wait for the future, I’d like to hear your opinion about it. Mirror does not have comments, so you can comment in the posts with my article pinned.</p><p>Thanks for reading.</p>]]></content:encoded>
            <author>alexhook@newsletter.paragraph.com (alex hook)</author>
        </item>
        <item>
            <title><![CDATA[How we can use Ethereum to fight corruption]]></title>
            <link>https://paragraph.com/@alexhook/how-we-can-use-ethereum-to-fight-corruption</link>
            <guid>ar59GIVtYaBR9kSTLG1n</guid>
            <pubDate>Fri, 29 Sep 2023 09:08:35 GMT</pubDate>
            <description><![CDATA[It occurred to me when I started to notice more news about countries’ CBDC research or even early launches. Now even first world countries and economic unions such as US, UK and EU openly express their interest in CBDCs. I’ve never researched CBDC studies, so probably all things that I’ll discuss here were already discussed, but I’ll also impose them to Ethereum ecosystem, so it might be interesting for you. - What is CBDC? CBDC (central bank digital currency) is a centralized payment system ...]]></description>
            <content:encoded><![CDATA[<p>It occurred to me when I started to notice more news about countries’ CBDC research or even early launches. Now even first world countries and economic unions such as US, UK and EU openly express their interest in CBDCs. I’ve never researched CBDC studies, so probably all things that I’ll discuss here were already discussed, but I’ll also impose them to Ethereum ecosystem, so it might be interesting for you.</p><p>-</p><p>What is CBDC? CBDC <em>(central bank digital currency)</em> is a centralized payment system that is controlled by your country’s central bank. For its development central banks of different countries often reuse tech of existing cryptocurrency platforms, such as blockchain, elliptic curve cryptography, simple smart contracts that allow to assign purpose of payment, etc. Basically CBDC is PayPal or Visa but controlled by government rather than god knows who.</p><p><strong>Why is it needed?</strong><br>For government, it allows to easily track all criminal activities and facilitates tax collection.<br>For citizens, CBDC opens faster payments and usually less fees, because now you don’t have a bank or other intermediary structure that wants to get a profit, everything is unified.</p><p>Some people criticize CBDC because with it their finances are fully controlled and tracked by government. I mostly agree with this statement, however it’s worth noting that governments already do that by requesting information about certain accounts in banks, now it just becomes easier from bureaucratic point of view. Also, if we talk about democratic regimes, banks aren’t exploited to violate citizens rights, so I think CBDCs won’t be either.</p><p>Another advantage of CBDCs that mass media are talking about is simplifying the fight against corruption. When all transactions are in full view of governments’ anti-corruption agencies, it becomes really easy to find out if some contractor irrationally spent funds allocated from state budget. While I agree that it helps to fight corruption on low-level, local corruption, it does completely nothing for high, government-level corruption, which obviously accounts for the vast majority of misdirected funds.<br>Why? Well, if you’re a big executive guy, you can negotiate (read as “give a bribe“) with anti-corruption agency or put your people in place.</p><p>Here comes the main disadvantage of CBDCs - their privacy is reached by the total closedness and opacity of the system.</p><p><strong>Ok, what does Ethereum have to do with it?</strong></p><p>I think you already got me. <strong>What if we make CBDC an L2 on top of Ethereum?</strong> Now something like MetaMask or other crypto UX hell and then instant “it’s NGMI“ thought appeared in your head. To convince you, let me dream a little.</p><p>There is a Zcash-style Validium (or even a rollup if full danksharding throughput is enough) on top of some DA layer. Accounts are registered by ID, one per person and one per legal/government entity. It’s Zcash-style in the sense that there are private and public transactions protected by ZK cryptography. Individuals can send both transactions, legal and government entities (e.g companies) are forced to send and receive only public transactions by consensus. CBDC node is open-source and free to run. Projects that want to integrate CBDC can run their own nodes. Independent anti-corruption agencies can run their own nodes and check legal entities’ transactions for suspicious transfers and spendings. Emission is transparent. UTXO system can be used to assign transferred funds some sort of special code that indicates a payment purpose or spending rules (e.g government sends contractor 10 000 CBDC$ with purpose “budget for road construction“ that can only be spent on construction materials).</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/80311a0282b079e48f66e6b04a53ec99c3139ad5d4b4b6b1e83d0663db9739e5.png" alt="The simplest example I came up with (it&apos;s even simpler if we restrict budget spendings&apos; destinations, but in case of tenders it&apos;s obviously not an option)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">The simplest example I came up with (it&apos;s even simpler if we restrict budget spendings&apos; destinations, but in case of tenders it&apos;s obviously not an option)</figcaption></figure><p><strong>Government corruption</strong></p><p>As in case of companies, we can also make state employees public.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/966e2d89e9907234718d95d4e199cb458586176085b0bedd722e4f6a72b29d32.png" alt="If the agency is bought off, there are likely dozens of other agencies and researchers. Even you can be one of them, everything is public!" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">If the agency is bought off, there are likely dozens of other agencies and researchers. Even you can be one of them, everything is public!</figcaption></figure><p>Problem of using family members to hide bribes still exists in this system. However, in many countries state employees are forced to report about savings and property of all family members. I think a similar system could be used here. For example, we can make all family accounts public or restrict the receipt of funds not from companies/outside of work (in short, from private accounts).</p><p><strong>Fair tenders</strong></p><p>Did someone say smart contract?</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6b3692e960e24366e7b893012580670044f219bbbcac652ab00caf4d58ab38c8.png" alt="Project specs, requirements, deadlines etc can be specified inside the smart contract " blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Project specs, requirements, deadlines etc can be specified inside the smart contract</figcaption></figure><p>We can use smart contracts for many things in state’s economy. For example, we can conduct fair self-executing tenders, where it’s impossible to bribe the right people to win the tender without any competition. Moreover, we can make use ZK cryptography to conduct tenders on <strong>private smart contracts</strong>, allowing us to use it for military contracts and other areas where confidentiality is required.</p><p>Because of a nature of Ethereum rollups, we aren’t restricted by Ethereum/EVM stack and can build basically any logic in our rollups, including fully functional CBDC platform on top of Ethereum L1. It means that possibilities are endless and thus building a CBDC on Ethereum isn’t really harder than another CashApp but located on central bank servers.</p><p><strong>Fiatotokenomics</strong></p><p>If we assume that CBDC in our ephemeral country is chosen as the main and only monetary system and put in place of cash, we can make emission fully transparent, which prevents government from hiding actual levels of inflation and where new money is going to.</p><p>More of that, we can, for example, inherit emission model from Ethereum, that is, print more money when people don’t spend it, and burn spare money when people spend it a lot. We can even stop printing money at all, but I’m not sure if it’s going to work, I’m not really an economist.</p><p>In other words, open and uncensored L2-CBDC prevents government from influencing the economy.</p><p><strong>Yeah it sounds too good. Any disadvantages?</strong></p><p>Of course.</p><p>The first one is that we still have to trust government to approve citizens’ IDs. It means that government agencies can create fake accounts. It can be prevented by adopting biometrical IDs but we’re really early with this one.</p><p>The second, simpler one, is that we have to make private transactions public for law enforcement agencies. It’s no secret that corruption is not the only crime that has to be tracked, for example, drug trafficking is mostly done by individuals, that is, all related transactions will be private. I’m not an expert in ZK cryptography but I think this problem can be solved by providing witnesses that are encrypted with LEA public keys along with transaction. Law enforcement agencies, in turn, can provide ZK proofs that this encrypted data is actually witness for this transaction when decrypted with their private keys.</p><p>Also, we must not forget that supervisory authority must be able to recover accounts, because phones are often stolen or broken and it’s not ok to lost your life savings because of this. We have to figure out how to prevent account recovery abuse.</p><p>What about corruption, it’s obvious that we cannot end it completely. There are still crypto, gold, cash and many other workarounds. However, I think that doesn’t mean we shouldn’t deal with it at all, and I see crypto-CBDCs as a very efficient thing for such purposes.</p><p><strong>Conclusion</strong></p><p>CBDCs are not so bad if implemented correctly. As a technology, CBDC is really helpful for people and national finances, but its closedness and reliance on trust to government authorities makes all of us question if it’s worth it. However, we can use Ethereum to fix CBDC and world finance in general.</p><p>Ethereum is the global unstoppable, unbreakable machine. It’s the most powerful world computer ran by independent people around the planet, and we must use it to make our countries’ economy and our finances more efficient, reliable and transparent. It’s time to use all these abstract technologies to make our everyday lives easier.</p><p>Unfortunately mirror does not have comments, but I’d like to hear your opinion and maybe some ideas about it. You can share it in comments to my posts with this article on reddit, twitter, etc.</p><p>Thank you for reading!</p>]]></content:encoded>
            <author>alexhook@newsletter.paragraph.com (alex hook)</author>
        </item>
        <item>
            <title><![CDATA[Rollup interoperability is crucial for ethereum future]]></title>
            <link>https://paragraph.com/@alexhook/rollup-interoperability-is-crucial-for-ethereum-future</link>
            <guid>z2EANvrqD5oPEsIXgQV9</guid>
            <pubDate>Wed, 13 Sep 2023 17:37:39 GMT</pubDate>
            <description><![CDATA[Just imagine if two shards of sharded Ethereum had 80% of its TVLI feel anxious about current state of rollup evolution. No, it’s not about rollups’ training wheels or too high fees. I’ll talk about why we don’t feel Ethereum when we’re on rollups. Why don’t we feel the breathtaking massiveness and solidity (no, not that one) of Ethereum that we all felt when it all was on L1, regardless of whether you were here before bullruns or survived from fees after. You could probably argue, “But I fee...]]></description>
            <content:encoded><![CDATA[<figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7df4ab6b7cddb0f5a30be61e8c790dad068118f8e76fe3b13500192767dedd72.png" alt="Just imagine if two shards of sharded Ethereum had 80% of its TVL" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Just imagine if two shards of sharded Ethereum had 80% of its TVL</figcaption></figure><p>I feel anxious about current state of rollup evolution. No, it’s not about rollups’ training wheels or too high fees. I’ll talk about why we don’t feel Ethereum when we’re on rollups. Why don’t we feel the breathtaking massiveness and solidity (no, not that one) of Ethereum that we all felt when it all was on L1, regardless of whether you were here before bullruns or survived from fees after.</p><p>You could probably argue, <em>“But I feel!“</em>, and I&apos;d be almost one hundred percent sure that you’re either on Arbitrum or Optimism. And I know exactly why.<br>If you’ve ever paid for something with crypto, payment provider that were sent to probably only supported Ethereum, Arbitrum and Optimism. It was once, twice, couple times, certain dapp that you wanted to interact to also had only these three, one of which isn’t suitable for you because of huge fees. Your friend probably once wanted to send you some ethers to pay you back but couldn’t because they were on Optimism and you were on Starknet or Loopring or, most likely, Ethereum L1. Screwing with bridges wasn’t an option because one of you were in a hurry or just not techy enough. You decided that there’s no point to be in a niche platform and suffer from all these difficulties and switched to one of those rollups. Natural monopoly grows.</p><p>Have you ever wondered why do you even have to choose between Ethereum, Arbitrum, Optimism, Base, zkSync, and tons of other rollups when you select a network in your wallet or payment gateway, if they all, in fact, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum-magicians.org/t/a-rollup-centric-ethereum-roadmap/4698">should be Ethereum itself</a>, just scaled? By that logic you should have just chosen “Ethereum” in pop-up and started doing whatever you needed to do. But in reality the only thing the rollups have in common is security assumptions of Ethereum. From the point of user experience, rollups are same as alt-L1 networks, so many people just don’t see any reason in using rollups instead of alt-L1s, if they also have less liquidity and smaller ecosystem than Ethereum (<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://defillama.com/chains">and not that much less</a>), but are still cheaper to use.</p><p>“But is there anything we can do about it? Rollups are actual separate blockchains and only nest on the same L1, Ethereum” - Yes. We really underestimate the power of nesting on the same network. Here’s what we can do with it: <strong>Unstoppable cross-rollup messaging.</strong></p><p>All existing cross-chain or cross-rollup messaging protocols are either <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://duckduckgo.com/?q=cross+chain+bridge">custodial</a> or <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://chain.link/cross-chain">rely on its own consensus to work</a>. Needless to say that we have Ethereum L1 that can help us to get rid of them. The simplest one - Send L2→L1 messages and forward them to destination L2 through L1. Forwarding full data through L1 is expensive asf, but, for example, we can send only a hash of data and send the data itself some other way. The point is that this is completely possible, and L1 can greatly help us with this.</p><p>What is the practical use of cross-rollup messaging? Let me show a few examples:</p><p><strong>Cross-rollup transfers</strong></p><p>What comes to mind first - we can send money between rollups by transmitting ETH to a “bridge“ with instructions of how much of them transfer to whom (in case of ether).<br>If we talk about ERC20 tokens, we can lock natively bridged asset from one side and send natively bridged version of the same asset on another side. Then, when one of endpoints runs out of this asset, we execute reallocation of assets through L1. That’s the case with assets that have its natively bridged version on all rollups, e.g USDC.e on Arbitrum and USDbC on Base.<br>In a case of assets that exist only on one rollup, we can provided wrapped versions of them. In my opinion, wrapped asset that is ran by smart contract on L2 and controlled by controller contract on L1 is safe enough, if we assume that all smart contracts contain no vulnerabilities.</p><p>But only transfers are not enough, because we could also want to interact with other rollups’ ecosystems entirely. And here’s what we can do about it:</p><p><strong>Stay in one chain, use all chains</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ff4f50d7c9367eac0041daf192ae73ad3a31fb02b7260c126a4f74df4f2db4b8.png" alt="This is very abstract illustration and I&apos;m not good in graphics. I&apos;ll explain it below" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">This is very abstract illustration and I&apos;m not good in graphics. I&apos;ll explain it below</figcaption></figure><p>Let’s imagine that I have an account on zkSync Era (I’ll take it because it has built-in account abstraction, keep it in mind). I want to interact with Uniswap on Arbitrum.</p><p><em>Status quo</em><br>To do it, I need to switch the network to Arbitrum or create new account if my wallet is chain-bound and top up my new account on Arbitrum with ETH either via bridging from my existing wallet, or asking someone for some. Then, if I want to use some of my funds from my existing zkSync wallet on Uniswap on Arbitrum, I need to bridge them too. After bridging it’s also worth to revoke all approvals, because my first wallet probably contains if not my life savings then at least more funds that I wanted to spend on this cross-rollup adventure.<br>After doing everything I needed to do on Arbitrum, I need to bridge received or remaining funds back to zkSync and change the network or wallet back. To be honest, even writing this part made my eye twitch.</p><p><em>How can it look</em><br>To do it, I firstly connect my wallet to a dapp&apos;s frontend. Wallet backend can edit contents of dapp calls to itself (e.g if it asks for USDC balance on Arbitrum, return USDC balance on zkSync) to make dapp frontend work without changing the chain in wallet settings. Then wallet backend checks if there’s its proxy contract on Arbitrum, and if not, requests its deployment.<br>When dapp requests transactions (or, to be more precise, I make something that initiates transaction, e.g swap or approval), wallet backend checks if there are any interactions with token allowance, and if there are, bridges required amount of tokens from itself to proxy on Arbitrum, then sends proxy transaction request to the controller on Arbitrum. After everything is made, wallet backend can either leave remaining funds in proxy or bridge them back.<br>From the point of view of user experience, it looks like that: I connect my wallet, see all my funds in the dapp’s frontend although they technically don’t exist in this chain, initiate a transaction, confirm it, done. Everything looks like I’m on my native chain.</p><p>Sounds nice! You don’t have to deal with tokens on different chains, find gas on these chains, etc, now all this mess can be easily abstracted away on UX.</p><p><em>But why should we keep our main wallet in one chain?</em> Now it all sounds like overcomplicated paymaster system that allows us to get rid of gas mess, but for some reason also connected to some main wallet. <strong>This is where account abstraction comes in.</strong></p><p>I’m writing this article in a “language” that, if you understand it, you should already know what AA is. But i’ll explain it anyway.<br><strong>Account abstraction</strong> is a technology that allows you to use smart contract as a normal wallet. This is useful for customizing your wallet or adding arbitrary logic in it. For example, you can authorize some of your trusted people to reset access to your wallet in case you lose your phone or someone steals your seed phrase. To decrease losses from potential hack, you can set up daily spending limit. Basically AA allows you to program your wallet and possibilities are only restricted by possibilities of your programming language.</p><p>And how does it matter in our case? - With that cross-rollup interaction logic you can, in fact, <strong>use your single wallet with all its funds, customizations and security settings in all existing rollups.</strong> If you create a new EOA each time you interact with new rollup, it does not inherit all these things. If you use a single AA wallet in all chains, your funds in all these chains are <strong>as secure as funds in your wallet’s native chain</strong> and follow same spending rules.</p><p><strong>Why hasn’t anyone done this yet</strong></p><p>The reason is terribly simple.</p><p>L2→L1 messages follow same proving rules as rollup batches. It means that, if it takes 24 hours to prove the batch, then the message will either be sent or be secure to consume only after 24 hours. To make such cross-rollup messaging system, it needs to be fast enough. Batches should be proven within several minutes. How far are we at the current point?</p><p>Well, with ZK rollups we’re, in fact, done. Despite the fact that some of ZK rollups’ devs intentionally delay batches proving for bug hunting purposes (for example, zkSync Era validator proves batches after 24 hours after their submission), ZK rollup batch is proven as soon as anyone generates a proof to it and executes it on L1. When zkSync and other rollups open proving to everyone, it will become much faster and eventually will fit in a couple minutes.</p><p>With optimistic rollups it’s more complicated. Two most popular rollups on Ethereum, Arbitrum and Optimism, are optimistic, and they’re quite far from even opening proving to everyone. Arbitrum has fraud proving system, but it can <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.arbitrum.foundation/state-of-progressive-decentralization#data-availability-committee-members">only be ran by whitelisted entities</a>. Optimism develops <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ethereum-optimism/optimism/tree/develop/cannon">Cannon</a>, but it’s not ready yet and will take long time until it ships to mainnet and becomes permissionless to use.<br>Even when they will open fraud proving to everyone, challenge time should be long enough to prevent massive DoS attacks against provers and other attacks aimed at taking provers down. Now it’s 7 days in both Arbitrum and Optimism.<br>In decentralized future, I don’t see realistic challenge time as less than 1 hour. Though I’m not an expert in optimistic rollups and may be wrong. If you’re interested in it, I’d recommend to read something from optimistic rollups developers.</p><p>However, all is not lost. For example, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ethereum-optimism/ecosystem-contributions/issues/61">OP Labs is now looking at ways to ZK prove outputs of Cannon fault prover</a>. I didn’t understand much from this topic, but as far as I understood, OP Labs wants to make system that allows (not forces) network participants to create ZK proofs of Cannon output on certain batch and send it on chain to immediately prove this batch without waiting for the challenge time to end. This may help Optimism to join us on the way of connecting Ethereum back.</p><p>In general, I would say that the problem of interconnecting rollups comes from decentralization sacrifices in favor of setting up training wheels.<br>And I totally understand it. If you build a system that is expected to handle billions of dollars and move huge elements of current financial system to itself but still don’t have any recovery guarantees from your settlement layer, it’s extremely hard and expensive to develop such things fast, efficient and straightaway decentralized.</p><p>I would like to thank all developers that work on Ethereum rollups and rollup ecosystem. You are those who move an entire industry forward and help us all to change the world to better. No matter if you’re CEO, team lead or simple coding plankton working on some small part of your project. You matter.</p><p>Thank you for reading.</p><p><em><s>I spent 2x more time to fix all writing mistakes than to write this article lmao</s></em></p>]]></content:encoded>
            <author>alexhook@newsletter.paragraph.com (alex hook)</author>
        </item>
    </channel>
</rss>