<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Guillaume Ballet on Medium]]></title>
        <description><![CDATA[Stories by Guillaume Ballet on Medium]]></description>
        <link>https://medium.com/@gballet?source=rss-6594eebf58d0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*zwBrraD5i9WeGh2q.jpg</url>
            <title>Stories by Guillaume Ballet on Medium</title>
            <link>https://medium.com/@gballet?source=rss-6594eebf58d0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 08:57:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gballet/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Structure of a binary state tree — part 1]]></title>
            <link>https://medium.com/@gballet/structure-of-a-binary-state-tree-part-1-48c587836d2f?source=rss-6594eebf58d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/48c587836d2f</guid>
            <dc:creator><![CDATA[Guillaume Ballet]]></dc:creator>
            <pubDate>Mon, 05 Oct 2020 12:00:58 GMT</pubDate>
            <atom:updated>2020-10-07T17:22:06.429Z</atom:updated>
            <content:encoded><![CDATA[<h3>Structure of a binary state tree — part 1</h3><p><em>In the past few months, I have been working on transitioning the trie from a hexary structure to a binary one. I have already written about </em><a href="https://medium.com/@gballet/ethereum-state-tree-format-change-using-an-overlay-e0862d1bf201"><em>the conversion method</em></a><em>, in which the structure wasn’t fully specified. This article is the first in a series that goes over the design trade-offs to be considered when designing a new structure.</em></p><p>Some design choices that sounded like a good idea when the hexary trie was designed, turned out to be a source of complexity over its 5 years of faithful service. As eth1x contemplates a switch to binary tries, there is a great opportunity to take another look at how the state is stored.</p><h3>The root of the problem</h3><p>There are at least 5 things that could be improved when redesigning the storage format.</p><ul><li><strong>Merging the accounts and storage tries</strong>: maintaining several structures creates complexity, and the typical use case is to go through the account trie first, get the root of the storage trie, and then go to the storage trie to get to the data.</li><li><strong>Extension nodes</strong>: this is a special node used to prefix all keys in a given subtree. They are useful because they limit the number of nodes that need to be hashed, however they also introduce complexity because the section of the keys that they cover has to be packed in a specific way.</li><li><strong>The RLP encoding format</strong> is meant to encode arbitrary structures rather efficienctly. It is also the biggest source of pain due to its complexity: it also requires going through hoops to pack key chunks. Furthermore, due to the fairly constant structures of each node, the size gains made by using RLP can be made using a simpler serialization method.</li><li>Connected to the previous two problems, the <strong>hex prefix</strong> is also a huge source of complexity and confusion.</li><li>The proofs (a.k.a “witness”) for <strong>hexary tries</strong> are about 4 times larger than that of a <strong>binary trie</strong> (<a href="https://medium.com/@gballet/ethereum-state-tree-format-change-using-an-overlay-e0862d1bf201">see the binary overlay article</a> for a visualization).</li></ul><h3><strong>RLP — Ramble, Lose yourself and Pester?</strong></h3><p>Let’s tackle the RLP question in this article. The vast majority of core devs wouldn’t be sad to see RLP go. This is due to its huge complexity. In fact, the only argument I’ve heard in favor of keeping it was: “RLP is so complex, let’s not take the risk of re-living the same nightmares by picking a new format”.</p><p>The basic principle is that it follows a simple size + data format. This is where the simplicity stops. First, the size can be any integer (in practice, it’s unlikely to be more than 2 bytes, but it <em>could</em> be, so you have to make sure this is supported). How do you tell where the size part ends and where the data begins?</p><ul><li>In most cases, a <em>header </em>is added in front. The header is composed of a value h, to which the size is added: the RLP encoding is therefore [length(data)+h] [data]</li><li>The previous case works if length(data)+h &lt; 256. What if the data is so large that it doesn’t fit into a single byte with the header? Bingo, you need another byte to store the size! And another h’ value to notify that you are using this second storage scheme. The RLP encoding is therefore: [h&#39;+length(length(data))] [length(data)] [data]. h&#39; has “conveniently” been chosen to be 56.</li><li>If the data is a single byte, one finds oneself having to add a byte in front of a single byte. Is it possible to not do that? Sometimes yes, and only at the price of an extra complication! If data[0]&lt; h, then no header is necessary. Conversely, any byte payload starting with a value that is less than h is necessarily a single byte.</li></ul><p>Can we make it more fun? Of course we can! There are two types of “objects” that RLP knows of: lists of structures and byte arrays.</p><ul><li>Byte arrays have header = 128 and overflow_header=183,</li><li>Lists have header=192 and overflow_header=247.</li></ul><p>So note that the maximal size for the data size is 8 bytes, which is a 64-byte number. 18014398509481984 KB ought to be enough for anybody.</p><p>Although there’s plenty more tricky details to be looked into, the point is clear: RLP is a beast. Let’s now see how it interacts with the state trie.</p><h3><strong>Merkelization rule</strong></h3><p>How do we apply both RLP and its tortured logic to our Merkelization rule? Let’s start at the bottom with the leaves.</p><h4>Leaves and the hex prefix</h4><p>Leaves contain a value, and then there’s whatever bits of the key leading to them, that is not common to other leaves. So we have a tuple (key, value), which is a 2-element list, containingkey and value that are byte arrays. RLP should be able to let us handle that right? Not so fast.</p><p>Keys in a hexary trie are <strong>nibble</strong>-based, so if we take a chunk from a key it could end up in the middle of a byte and the question comes as to where the alignment should take place. So a decision has to be made for this, and that key chunk is packed using a function called the <em>hex prefix</em> method. This adds a header to tell if the chunk length is even or odd.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*3CHBe2FvlILSatXdcTH7BQ.png" /><figcaption>The hex prefix encoding uses the first nibble of the first byte to store whether the length of the key chunk is even or odd.</figcaption></figure><p>The hex prefix require twiddling with nibbles. For example, if the chunk length is odd, then the first nibble is packed in the lowest nibble of the header.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*WvXsIqV53BB5ycilkyIdNQ.png" /></figure><p>Also, if the length is odd but is not byte-aligned, each nibble will have to be shifted to make it fit in one byte less.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*eclgcy5UrSn0nFxh2HgOCg.png" /><figcaption>In case the chunk length is even but is odd-aligned, all nibbles need to be shifted by 4 bits.</figcaption></figure><p>So the leaf node is finally encoded as RLP(HP(key_chunk), value).</p><h4>Branch nodes and Small children</h4><p>A branch node has 16 children, one for each nibble. RLP-wise it’s simply a list of the hashes of its children, so a list of 16 byte arrays. If one of the children is missing, it will simply have an empty byte array (just a standalone 128 to mark an array with a size of 0). There is actually a 17th entry in the list, for the value at the branch node, but it isn’t used in practice, so the last entry in the list is always 128.</p><p>As you should expect by now, there’s a bit of a catch here, too. In order to not create database entries for something too small, a node whose RLP is too small will not be hashed. So in that case, the RLP is stored directly as a raw list, instead of its hash. The consequence is that instead of finding a start-of-array marker (128) in the list, one will find another start-of-list marker (192) which gives rise to a lot of fun problems to solve.</p><p>If the total size of the RLP of a branch node is more than 32, then it will be hashed. Which happens most of the time because for that not to happen, the RLP size of a child would have to be 16 bytes max.</p><h4>extension nodes</h4><p>There is a third type of nodes called extension nodes, which will be discussed extensively in the next article. Luckily, they don’t add any woes from the RLP standpoint.</p><h3>Is RLP really needed?</h3><p>Are all these optimization useful? Not really.</p><p>For instance, this is how much the space would increase if the rlp &lt; 32 bytes rule wasn’t used:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*UMnOUHWHTNH_t_zrmn27yg.png" /></figure><p>To be compared to the ~300GB that a full sync needs these days.</p><p>Likewise, not using the hex prefix would cause an increase of ~100MB. A mere 0.03% increase, which can be countered still, by carefully choosing the encoding format of the binary trie.</p><h4>Binary tries — the last nail in the RLP coffin</h4><p>With binary tries, branch nodes become much simpler: a node has a maximum of two children, that are pointed at by their hashes. The size of a Keccak256/Sha256 hash is fixed to 32 bytes.</p><p>At this stage, it becomes obvious that a general-purpose encoding scheme that has values of any length isn’t warranted. For example, assume that each node in the new binary trie has the following fields:</p><ul><li>left child hash, used as a pointer;</li><li>right child hash, used as a pointer;</li><li>value (optional), the value that is stored at the key used to get to this node;</li><li>prefix (optional) which is intended as a replacement of the hexary trie’s extension node.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/0*XSo8i1tRNarCCdwT.png" /><figcaption>Example trie storing (key, value) pairs (0xcafe, 0x00) and (0xcaff, 0x01): the root node is prefixed by the key chunk “0xcafe” with a number to indicate that only 7 bits out of the last byte are used for the prefix. Then it has a pointer to each of its children, and no value. Each child has an empty prefix (marked by bit count 0x00), no child and a value.</figcaption></figure><p>A client could encode the node data with a simple two-byte header:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*n4B-LiJyVttvulOtVMyRDQ.png" /><figcaption>Intermediate node serialization header proposal</figcaption></figure><p>This model only requires two extra bytes, as opposed to at least 5 for the same model using RLP. The first byte contains the following flags:</p><ul><li>If bit #7 is set, the first 32 bytes of the payload following this header contain the hash of the left child. If the bit is not set, then the left child hash is the empty hash;</li><li>If bit #6 is set, the subsequent 32 bytes represent the right child hash. If the bit is not set, then the right child hash is the empty hash;</li><li>If bit #4 is set, then the header has an extra byte giving the number of prefix bits following the left/right child hashes;</li><li>If bit #5 is set, then the remaining bytes in the payload represent the value</li></ul><p>An important point is that this approach also covers the functionalities of the hex prefix, which can thus be deprecated.</p><h3>Conclusion</h3><p>I confess that with this post, I have as much been seeking to explain how RLP works as venting the frustration I accumulated working with RLP.</p><p>To be fair, the design is far from bad, and it has no doubt served its purpose over the last 5 years. It has become apparent over time, that its complexity is too hefty a price to pay, and I hope to have convinced you that RLP can advantageously be replaced in the context of storage tries.</p><p>The storage trie format proposed in this first post is far from complete, and more aspects will be covered in further installments.</p><p><em>Many thanks to </em><a href="https://medium.com/u/d13b4f7f670c"><em>Sina Mahmoodi</em></a><em> and Martin H. Swende for their feedback.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48c587836d2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ethereum state tree format change using an overlay]]></title>
            <link>https://medium.com/@gballet/ethereum-state-tree-format-change-using-an-overlay-e0862d1bf201?source=rss-6594eebf58d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0862d1bf201</guid>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Guillaume Ballet]]></dc:creator>
            <pubDate>Thu, 26 Mar 2020 09:56:57 GMT</pubDate>
            <atom:updated>2020-03-26T09:56:57.638Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the many problems affecting Ethereum is the way accounts and contract data are stored. The structure that has been chosen is called a Merkle Patricia Tree (MPT). Even though it made a lot of theoretical sense, in practice it brings more problems than it solves. Core developers have been discussing transitioning to a binary tree for years, and in this article I will present my take on the problem and <a href="https://ethresear.ch/t/overlay-method-for-hex-bin-tree-conversion/7104">how to solve it</a>.</p><p>The proposed process introduces a transition period during which two trees are maintained. This has the advantage that the main chain can keep operating while the tree is being converted, and it also ensures that all accounts will be translated to a binary format.</p><h3>Background</h3><p>At the moment, accounts are stored into a hexary tree. Hexary means that a node has 16 children. In theory this is nice, because that means that you need less “stages” to store all the data you have.</p><p>For example, this is what it takes to represent the key and value pair (170, v) in the form of a hexary tree. In hexadecimal, 170 is written 0xaa, so you just need two levels: one for the first a and another one for the second a.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kqSZuf5dLACLiZl3M3niCg.png" /><figcaption><strong>Figure 1</strong> An example hexary trie showing how value “v&quot; is stored at key 0xaa. This tree only has 2-byte long keys and only the subtrees along the 0xaa key have been expanded. Irrelevant sub-trees are replaced with “…” for brevity.</figcaption></figure><p>Note that the tree is very shallow, and also very wide. Compare this to the following binary tree representation of the same key and value pair. In binary, 170 is represented as 10101010.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*1ClLz8wDwgvcaVpGlktsXQ.png" /><figcaption><strong>Figure 2</strong> The same key value pair as Figure 1, stored as a binary tree. Irrelevant sub-trees are denoted as “…” for brevity.</figcaption></figure><p>You can see that the tree is much deeper and also much narrower.</p><p>In Ethereum, each block contains a stateRoot field, which is the value of the hash of the root of the MPT. To summarize it, that hash is obtained by hashing the list of hashes of the root’s 16 children. Each one of these children’s hashes is in turn the hash of the list of hashes of their children’s hashes, and so on.</p><p>Each time a new block is going to be produced, a miner updates the account tree and recalculates its root hash. The hash is stored in the stateRoot field of the new block, and the new block is then sealed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tHBV5o2O3KNTdOGVDODy0w.png" /><figcaption><strong>Figure 3</strong> The state root field of a block headers points to the root of the hexary tree.</figcaption></figure><p>The problem already appears here: it would be too long to recalculate the hash root by hashing all nodes, so in order to calculate the root node, the miner will retrieve the <em>sibling hashes</em> from the database. Even though it doesn’t take as much time as getting all the leaves from the database and hashing the entire tree, this operation still takes a lot of time. This is because each hash has to be fetched from the database.</p><p>In a hexary tree, you have in general to fetch 15 sibling hashes per stage. In the contrived example above, that’s 30 hashes.</p><p>Even though it goes deeper, a binary tree will only require one sibling hash per stage. In the contrived example above, that’s a mere 8 hashes! This is why in practice, binary trees are actually nicer.</p><h3>The overlay conversion method</h3><p>Unfortunately, switching to a binary tree is not that simple. There is a <em>lot</em> of data to convert, and it will take more than the 15 second block time to perform the changes.<br>On top of that, imagine that you are translating a 5000 page book, and the author keeps calling you to tell you they made changes in the story, and that affects pages that you have already translated… this could go on forever. It’s the same problem here, since users could update addresses that you have already converted, which means you have to start the conversion process over.</p><p>The proposal to fix this is to have a transition period, during which an <em>overlay tree</em> is laid on top of the hexary tree. This overlay tree is a binary tree, and its role is to hold all the changes happening to the state, until the base tree is converted to binary. The transition takes place in three steps.</p><h4>Step 1 — The conversion</h4><p>In this approach, it is decided that at a block height <em>H1,</em> blocks have <em>two</em> stateRoots: one for the “base” hexary tree and one for the “overlay” binary tree.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uCLx4rYgAXYVptz9VMRARA.png" /><figcaption><strong>Figure 4</strong> During the conversion process, blocks have 2 state roots: one is the read-only root of the traditional hexary tree, and the second one is the root of the overlay binary tree.</figcaption></figure><p>The hexary tree is considered read-only, so any update to the state will be updates to the overlay tree.</p><p>When a transaction reads or updates an account, the system first searches the overlay tree. If the account can not be found there, the system will then search the old, hexary tree for the value.</p><p>Meanwhile, the hexary tree is being converted in the background. That can now be done without worrying about inserts, because all changes are stored in the top tree.</p><h4>Step 2 — The base switch</h4><p>When the background conversion process is done, miners will advertise they are ready to switch by replacing the read-only hexary base root with the result of the conversion: a read-only binary base root. Reading and writing to the state works the same as in step 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*kIYmte6zVD5ycwtkJAsAzA.png" /><figcaption><strong>Figure 5</strong> During the second phase of the transition, the block header replaces the hexary base root with that of its binary conversion, to signal the network that they are ready.</figcaption></figure><p>When a sufficiently large sequence blocks have the same value for the converted base root, this means most miners are done with the conversion and agree on what the converted tree looks like. The merge process starts.</p><h4>Step 3 — Merging the two trees</h4><p>The merge process happens gradually: each time a new block is produced, n keys are deleted from the overlay and reinserted into the base tree. This process will continue until all keys are removed from the overlay. At this stage, the overlay state root will be dropped from the block header.</p><p>On top of that, if a transaction execution writes to a key that is found in the overlay, this key will be deleted from the overlay and the write will directly go to the base tree.</p><h4>Next steps</h4><p>A <a href="https://github.com/holiman/go-ethereum/pull/12">low resolution prototype</a> has already been created, in order to estimate the time needed to complete the transition. We are confident that the whole process can happen in a reasonable time frame, i.e. a couple days. I will publish more details as the algorithm is refined.</p><h3>Thanks</h3><p>This proposal has benefited from the valuable input from Alexey Akhunov, Vitalik Buterin, Anna George, Sina Mahmoodi, Tomasz Stanczak and Martin H. Swende.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0862d1bf201" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Improving scalability withWASM precompiles]]></title>
            <link>https://medium.com/@gballet/improving-scalability-withwasm-precompiles-df75e536f93e?source=rss-6594eebf58d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/df75e536f93e</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[wasm]]></category>
            <category><![CDATA[eth1x]]></category>
            <dc:creator><![CDATA[Guillaume Ballet]]></dc:creator>
            <pubDate>Mon, 13 Jan 2020 20:12:33 GMT</pubDate>
            <atom:updated>2020-01-22T14:45:30.477Z</atom:updated>
            <content:encoded><![CDATA[<h3>Improving scalability with Wasm precompiles</h3><p>This is a writeup building on my <a href="https://www.youtube.com/watch?v=ez4W9-byCnM">Devcon 5 presentation</a> explaining how <a href="http://webassembly.org/">Wasm</a> precompiles can improve the current state of Ethereum and prepare the way for Ethereum 2.0.</p><h3>Rationale</h3><h4>Challenges for Eth1</h4><p>The major technical challenges facing Ethereum in the coming years are as follows:</p><ul><li><strong>State growth management</strong>: Contract creators can pay the storage allocation cost once and expect their data to be kept permanently. This has caused the storage to grow to a size that the typical handheld device can no longer store, and is even getting difficult for standard desktop computers to manage. The mid-term risk is that participation in the network will become the purview of big mining farms, which in turn presents a major collusion risk;</li><li><strong>Feature adoption</strong>: Adding new precompiles and features has seen a lot of healthy pushback by client maintainers. Adding a new feature means that said feature needs to be properly understood and correctly implemented by all client maintainers. This is a rather difficult task, especially considering that client teams are typically understaffed;</li><li><strong>Network maintenance</strong>: An issue which is correlated to the previous one. As research interests switches to Eth2, few people are left behind to keep maintaining the network until Eth2 is production-ready;</li><li><strong>Privacy</strong>: A concern, which is always difficult to address in a public ledger;</li><li><strong>User experience paradigm shift in Eth2</strong>: A lot of details are currently still being discussed, nonetheless it’s already apparent that Eth2 introduces an important change in the user experience, which will represent a non-trivial step-up in difficulty for all Eth1 users.</li></ul><h3>Wasm precompiles</h3><h4>How it works</h4><p>Like regular precompiles, during the execution of the code of a contract, a call can be made to some special contract. This contract is special because:</p><ul><li>The functionality it offers is needed by many contracts, so it makes sense not to duplicate the same code over and over;</li><li>This contract is written in such a way that its execution is faster than it would be if the same code had been written in EVM bytecode (i.e. with solidity or vyper).</li></ul><p>In the present case, this special contract is written in Wasm. Why Wasm? Because the code for a given precompile can be written only once, and then be available everywhere (that is, in every client).</p><p>The main focus is to bring about a change in ÐApp development paradigm, similar to Eth2. This works by <strong>providing developers with the tools to handle off-chain most of what is currently done on-chain</strong>. It greatly helps with scalability, since only the minimal amount of data necessary to preserve the safety properties of a blockchain (generally a 32-byte hash) is retained on-chain. On top of that, most of the updates to that data is handled by precompiles, so development, execution costs and maintenance are also greatly simplified.</p><h4>Advantages of this approach</h4><ul><li><strong>Easy to implement:</strong> as a host of Wasm interpreters are available, written in a variety of languages. Client integration is therefore straightforward and a <a href="https://github.com/ethereum/go-ethereum/pull/18329">Geth-based prototype already exists</a>.</li><li><strong>New features, fast:</strong> only one Wasm program needs to be validated, which can subsequently be dropped as-is into each client and work without effort.</li><li><strong>No lock-in:</strong> If clients are dissatisfied with the execution speed of Wasm, they can take their time to rewrite the precompile in their favorite language; the Wasm file can then be used to validate the output of “native” precompiles.</li><li><strong>Fairer gas schedules: </strong>there is a single, instruction-based reference for each clients. This provides unbiased arguments for a gas schedule change, as data from the benchmarking of the Wasm precompile are easily published and scrutinized.</li><li><strong>Focus on layer 2 or <em>stateless</em> solutions:</strong> those precompiles focus on cryptographic primitives and proof verification, which opens up the possibility of reducing each contract’s state to only 32 bytes.</li><li><strong>A UX closer to that of Eth2:</strong> precompiles are very similar to the Eth2 concept of <em>execution environments</em> (EE). Among other things, Eth2 EE will be Wasm-based. Introducing Wasm precompiles will provide for a smooth transition to the heavy paradigm shift that Eth2 is.</li></ul><h4>Challenges</h4><ul><li><strong>Execution speed:</strong> News flash: Wasm is slower than native. There is currently a lot of research going on, not least of all in the <a href="https://github.com/ewasm">ewasm team</a>, to explore areas for speedup.</li><li><strong>Risk of precompile overload:</strong> Everybody want their code to be added as a precompile, in order to have their code subsidized. This predates Wasm precompiles and client maintainers are accustomed to pushing back on such proposals. There is no reason for this to change. See relevant question in the FAQ.</li><li>A third issue is the potential for reinventing the wheel, as e.g. some topics are very close to those of Eth2. Care is taken to avoid redundancies.</li></ul><h3>Case study: proof verification</h3><p>As part of this project, several implementations addressing Eth1 challenges have been offered, on which more details will be published shortly. In this section, I will outline how a proof verification precompile would help implement a stateless version of the ERC20 standard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*x8csKrWWi-GHfX7d2MofJA.png" /><figcaption><strong><em>Figure 1</em></strong><em> A tree root stored on the main chain points to an off-chain tree containing accounts of an ERC20-like token. In this view, the account at address </em><em>0x221234 is expanded. Unlike the main chain, this account only stores data linearly, keys are much shorter (6 nibbles or 3 bytes) and nodes have a maximum of 4 children.</em></figcaption></figure><p>As seen in Figure 1, an on-chain contract only stores the root of a merkle tree representing the accounts. Note that on this figure, the arbitrary choice of a linear storage space has been made.</p><p>When a user wants to update their account, they need to provide the merkle proof of the current state of their account. The contract receives this proof, verifies that it corresponds to the root currently stored, update the accounts, recalculate the root and updates it.</p><p>As a result, since proof calculation is gas-intensive, there is a great advantage to use a precompile to handle this very repetitive task. Note that the precompile would be used for more than just ERC20 tokens as this system can also be applied to other layer 2 solutions. And since there is more than one ERC20 token anyway, it justifies its inclusion as a precompile.</p><h3>FAQ</h3><h4>What’s the point? Isn’t that very close to Eth2? Or stateless clients? Or <em>&lt;name your favorite project&gt;</em> ?</h4><p>It certainly has similarities (and is inspired from) all of the above. The advantage is that the amount of work needed to implement it is minimal, and at the same time it paves the way for the advent of these technologies.</p><h4>Can you add my precompile?</h4><p>We can’t turn everything as a precompile. Precompiles should be understood as a factorization of code that would otherwise be duplicated among many contracts. As a rule of thumb, to be considered by the community, candidates will have to demonstrate:</p><ul><li>Having (many) more than one application;</li><li>A relevance to either a) cryptographic primitives, b) proof verification or c) layer 2 solutions</li></ul><p>Expect as much push-back from client maintainers as currently.</p><h4>Is there a connection with the ewasm team’s <a href="https://github.com/ewasm/ewasm-precompiles">previous work on precompiles</a>?</h4><p>Yes. This work is a continuation. It is currently still at the prototype stage and I made different, incompatible design choices in order to extract more performance. If this project is successful, the result will be merged back.</p><h3>Acknowledgments</h3><p>Many thanks to <a href="http://github.com/s1na">Sina Mahmoodi</a> and <a href="http://github.com/axic">Alex Beregszaszi</a> for their feedback on this post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df75e536f93e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FreeBSD Aarch64 and QEMU]]></title>
            <link>https://medium.com/@gballet/freebsd-aarch64-and-qemu-d54b6db381be?source=rss-6594eebf58d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d54b6db381be</guid>
            <category><![CDATA[kvm]]></category>
            <category><![CDATA[freebsd]]></category>
            <category><![CDATA[arm64]]></category>
            <category><![CDATA[qemu]]></category>
            <category><![CDATA[aarch64]]></category>
            <dc:creator><![CDATA[Guillaume Ballet]]></dc:creator>
            <pubDate>Thu, 09 Jan 2020 18:04:49 GMT</pubDate>
            <atom:updated>2020-01-09T18:04:49.858Z</atom:updated>
            <content:encoded><![CDATA[<p>For the past couple months, I have been trying to switch my development rig to a simple <a href="https://www.friendlyarm.com/index.php?route=product/product&amp;path=69&amp;product_id=268">NanoPi M4</a>. My goal has been to not having to carry a laptop around, knowing that it will just sit on a desk.</p><p>The experiment has been going great so far: the device fits in my coat pocket and packs an impressive amount of power with its 6 cores. Enough to run Xorg, vim with all the plugins that I need, and of course some heavy compilers. The limited amount of RAM also forces me not to have too many windows open while I’m developing, and that turned out to be the source of a pleasant productivity boost.</p><p>It has now replaced my laptop altogether. The biggest issue I still face is when no HDMI screen is available. I looked into the <a href="https://onyxboox.com/boox_max3">onyx boox max3</a> to serve as a low-power display, but the price tag is too much for something I need only twice a year. So I bought a cheapo LCD display that I don’t really like, which is fine since I only have to look at it maybe 2 weeks per year.</p><p>A lot of the Linux tools that I use have been ported to ARM64/Aarch64. And if they haven’t been, there is always the app I can install on my phone to complement the missing features. While it’s not the most secure approach, it’s enough for this experiment.</p><p>Now, the only thing I’m really missing is FreeBSD, and some improved security. One of the issues is that the OS available at Friendlyelec’s website is a customized version of Armbian whose kernel is never updated. The other issue is that it’s not FreeBSD. So in the past couple weeks I started experimenting with QEMU and KVM in order to run different FreeBSD VMs. The end goal is to have something similar to <a href="https://www.qubes-os.org/">Qubes OS</a>, with one VM dedicated to a specific task. And because I have control over the OS, I can keep it up to date even if the host OS isn’t.</p><h3>The VM image</h3><p>So I started with downloading a <a href="https://download.freebsd.org/ftp/releases/VM-IMAGES/12.1-RELEASE/aarch64/Latest/">VM image</a> from the FreeBSD website and decompressed it. The first problem is that the image is limited to 3GB, which doesn’t leave room for much.</p><p>Increasing the “disk size” is very easy, one can do that with qemu-img :</p><pre>host $ qemu-img resize FreeBSD-&lt;version&gt;-RELEASE-aarch4.qcow2 +10G</pre><p>Then, I booted the image:</p><pre>host $ qemu-system-aarch64 -m 1024M -cpu host,pmu=off -M virt,gic-version=3 -bios QEMU_EFI.fd -nographic --enable-kvm --drive if=none,file=browsing.qcow2,id=hd0 -device virtio-blk-device,drive=hd0 -net nic -net user,hostfwd=tcp::5555-:22,hostfwd=tcp::5901-:5901</pre><p>The next step was to resize the partition and the disk label inside the disk. This is done with gpart:</p><pre>root@vm # gpart resize -i 2 -s 12G vtbd0<br>root@vm # gpart resize -i 1 -s 12G vtbd0s2<br>root@vm # growfs /dev/vtbd0s2a</pre><p>What the code above does is resize the third partition vtbd0 to 12 GB, then resize the label inside that partition vtbd0s2. Finally, the filesystem sitting inside this label needs to be grown to take up all the newly available space.</p><h3>Setting the image up</h3><p>Because this VM only has 1GB of RAM, one should not load it with too many bloated components. I have elicited to use i3 as a window manager, and I use TigerVNC to connect to it. Chromium is available as a browser for Aarch64.</p><pre>root@vm # pkg install xorg i3 chrome tigervnc-server</pre><p>I added a user called user with adduser and configured SSH to be able to connect to it. Connection to the X server is done through port forwarding. I chose VNC and forwared the VNC port (number 5901) through QEMU, although I could have done it with SSH. I changed the configuration in .vnc/xstartup to start Chromium and i3 :</p><pre>chrome --incognito &amp;<br>i3 &amp;</pre><h3>Using the VM</h3><p>Access to the system happens through SSH:</p><pre>host $ ssh -p 5555 user@localhost</pre><p>Once on the machine, the VNC server must be started with:</p><pre>user@vm $ vncserver</pre><p>Then on the host side, start the VNC client and enjoy browsing!</p><pre>host $ xtigervncviewer</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*wysQWuTvHJaST1jY.png" /><figcaption>Visiting freebsd.org with chromium from a FreeBSD VM hosted by Armbian Linux!</figcaption></figure><h3>Conclusion</h3><p>That’s roughly it. There are many things to iron out, starting with not having to manually launchvncserver each time I start a VM. I hope that this will help someone and I’m happy to discuss improvements.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d54b6db381be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Turboproofs, light clients and saving private Eth1]]></title>
            <link>https://medium.com/@gballet/turboproofs-light-clients-and-saving-private-eth1-487aaa9b386?source=rss-6594eebf58d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/487aaa9b386</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[wasm]]></category>
            <category><![CDATA[ewasm]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Guillaume Ballet]]></dc:creator>
            <pubDate>Sun, 10 Nov 2019 15:59:02 GMT</pubDate>
            <atom:updated>2019-11-15T18:14:54.729Z</atom:updated>
            <content:encoded><![CDATA[<p>The Ethereum state is growing fast and left unchecked, chain management will only be accessible to a handful of big players. At his request, this article describes my interpretation of Alexey’s turboproof proof system, which is to be applied to several light client approaches.</p><p>The state of the Ethereum blockchain is stored as a hexary patricia tree, or <em>trie</em> for short. The data is stored at two levels:</p><ol><li>The address trie is a mapping from addresses to account data.</li><li>A contract’s storage is also stored in a trie, which then represents a mapping from a 32-byte memory addresses to the 32–byte value stored at this address.</li></ol><p>These trees store (key, value) pairs. Note that the keys’ base unit is the <strong>nibble</strong> (4 bits), not the byte.</p><p>The trees have 3 types of nodes:</p><ul><li><strong>Leaves</strong> these are a (key suffix, value) pair, and they are always terminal nodes of the tree.</li><li><strong>Branch nodes</strong> these are internal nodes, and this node and all its subnodes share the same prefix. Each branch node has 17 entries. The first 16 entries correspond to the first nibble of the subnode’s key suffix. If present, the 17th entry is the value associated with the key prefix</li><li><strong>Extension nodes</strong> are “shortcut nodes” in case all the children share a common prefix. It is used to avoid creating a series of branch nodes, each with only one child.</li></ul><p>As an example, the following tree has a collection of leaves, branch and extension nodes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*BcM3TqXjHuv5CR20me8rvA.png" /><figcaption><strong>Figure 1</strong> A trie encoding the following values: (0x1234, 0x0000), (0x1111, 0x1111), (0x4567, 0x2222) and (0x4569, 0x3333). Keys and values have been shortened to 2 bytes in this example for increased readability. Rows with label 0 to 15 represent branch nodes, and arrows coming out of it specify what nibble its children have to be prefixed with. The 17th entry (index 16) is not used and therefore not represented. Row [5,6] is an extension node, meaning its children have to be prefixed with those two nibbles. Terminal nodes are leaves, the two on the left having key prefixes and the two on the right not needing a prefix as tracing the path down to them yields the whole key.</figcaption></figure><p>In practice, this model is the source of many efficiency issues in Ethereum, but it has also proven its resilience.</p><h3>Serializing values</h3><p>Some use cases require passing (key, value) tuples between users. For example, in order to save space light clients only store the root of their tree. So in order to interact with the state, the user needs to tell the light client what their share of the state looks like, so that the light client can perform operations and calculate the new root. The construction must allow for grouping several accounts into one single proof, for compression purposes.</p><p>Building on the previous example, here is the proof that both (0x1234, 0x0000) and (0x4567, 0x2222) are present in the tree:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*PmFsLI2ofPxLZLvwQTF24g.png" /><figcaption><strong>Figure 2</strong> A proof that the tree in figure 1 contains (0x1234, 0x0000) and (0x4567, 0x2222). All the subtrees leading to values other than these two are replaced with hashes (in this diagram, those subtrees are simple leaves).</figcaption></figure><p>Calculating the hash of the tree in figure 2 will yield the same root as the tree in figure 1, since the hashes provided in the proof have the same value as what would be provided if the tree was complete.</p><p>The question is how to serialize the data: given a list of hashes and a list of (key, value) pairs, how does one find the structure of the tree? For instance, given only the following input:</p><ul><li>(key, value) pairs (key and value lengths are shortened to make the resulting pictures more readable) for (0x1234, 0x0000) and (0x4567, 0x2222)</li><li>Hashes representing the subtrees.</li></ul><p>One could reconstruct the following tree:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*uIwbRVGaYB-Egnjd5VUJWA.png" /><figcaption><strong>Figure 3</strong> An incorrect tree reconstruction for lack of structural information.</figcaption></figure><p>Or this tree:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*ntcEkkwCQ-Mrn-u6UzJjeg.png" /><figcaption><strong>Figure 4 </strong>Another, incorrect tree reconstruction for lack of structural information.</figcaption></figure><p>As a result, there is a need to somehow encode <strong>structural information</strong>.</p><h3>Turboproofs</h3><p>The proposal by <a href="https://github.com/ledgerwatch/turbo-geth/blob/master/docs/programmers_guide/guide.md">Alexey Akhunov</a> is still in the works, and this independent writeup is part of the effort to define it entirely. The solution presented here corresponds to the rust <a href="https://github.com/gballet/multiproof-rs">implementation</a> that Sina Mahmoodi and I worked on.</p><p>A turboproof is broken into three parts:</p><ol><li>The list of leaves</li><li>The list of hashes, corresponding to untouched branches of the tree</li><li>“Structural information”, that is, a list of instructions explaining how the tree can be rebuilt using only the hashes and leaves provided.</li></ol><p>The last part is encoded as a list of instructions for a stack machine, to be executed to reconstruct the tree:</p><ul><li>LEAF indicates that a leaf should be popped from the proof’s sequence of leaves;</li><li>BRANCH(i) stipulates that a new branch node needs to be created, and the node that was constructed before should be stored as the <em>i</em>th child of the new branch node. The new node is then stored on the stack;</li><li>ADD(i) stipulates that given a branch node and any other node, the latter should be set as the <em>i</em>th child of the branch node. When one of the nodes isn’t a branch node, the order doesn’t matter. When both are branch nodes, the parent node will be the one that is on top of the stack;</li><li>EXTENSION(ext) stipulates that the node of top of the stack should be set as the child of an extension node (a.k.a shortNode in geth parlance), whose prefix for the subtree is represented by the sequence of nibbles ext; and</li><li>HASH is a node that represents the hash of a subtree</li></ul><h3>Example</h3><h4>The tree</h4><p>Let’s suppose that the entire state consists of the following 4 (key, value) pairs: [(0xcafecafe, 0x0303030303030303), (0xcafedeca, 0x0202020202020202), (0xdeadbee0, 0x0404040404040404), (0xdeadbeef, 0x0101010101010101)]</p><p>(For clarity, keys are shortened to 4 bytes instead of the usual 32 bytes, and values are 8 bytes long, instead of having their size unrestricted)</p><p>The tree representation of these values is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*fFtlQyepezqVHP1lNMk_-g.png" /><figcaption><strong>Figure 5</strong> Initial tree</figcaption></figure><h4>The proof</h4><p>Our proof will only include keys 0xcafecafe and 0xcafedeca. The two leaves that aren’t needed are hashed. The proof is then serialized as such:</p><ul><li>The nodes are serialized in a depth-first order:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lzVE15JJQJM5W7MSd9LjIw.png" /><figcaption><strong>Figure 6</strong> The nodes part of the proof</figcaption></figure><ul><li>The hashes are also serialized in a depth-first order. There’s only one hash, representing the 0xd* subtree</li><li>The set of instructions used to rebuild the tree:</li></ul><pre>LEAF<br>LEAF<br>BRANCH(14)<br>ADD(13)<br>EXTENSION([0xa, 0xf, 0xe])<br>BRANCH(13)<br>HASH<br>ADD(14)</pre><p>The user now has the proof that they know the current state of the tree. They send it to the relayer or whoever wants to ensure that the user knows the part of the state they manage.</p><h4>Reconstructing the tree</h4><p>At first, the node and hash lists are received, and the stack is initialized to be empty</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qv7cMeFhfuUChCkFeEWW_Q.png" /><figcaption><strong>Figure 7</strong> Starting state during tree reconstruction</figcaption></figure><p>Let’s follow the program:</p><ul><li>LEAF</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*9dqm38cXeJRpLIkXFigZwA.png" /><figcaption><strong>Figure 8</strong> The first leaf is pushed onto the stack.</figcaption></figure><ul><li>LEAF</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*tLQY7Ha3GukHolntVVxRFQ.png" /><figcaption><strong>Figure 9</strong> Both leaves are now present on the stack</figcaption></figure><ul><li>BRANCH(14)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*WoE_lX41yCv6yhBKkoSgZw.png" /><figcaption><strong>Figure 10</strong> The node at the top of the stack is popped, and set as the 14th child of a branch instruction. The sub-tree thus composed is immediately pushed back on top of the stack.</figcaption></figure><ul><li>ADD(13)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*teAXeGGx7toDCqrKCFwncw.png" /><figcaption><strong>Figure 11</strong> The two elements at the top of the stack are popped, and the second one is added as the 13th child of the first one. The result is pushed back onto the stack.</figcaption></figure><ul><li>EXTENSION([0xa, 0xf, 0xe])</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*gyb2A42d1c77K_IrGVxiAA.png" /><figcaption><strong>Figure 12</strong> The node at the top of the stack is popped and set as the child of an extension node with `0xafe` as prefix. The result is pushed back onto the stack.</figcaption></figure><ul><li>BRANCH(13)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*h_Fs2rFBa0XtA8E67_oBzg.png" /><figcaption><strong>Figure 13</strong> The last node is taken from the proof’s node list and the subtree at the top of the stack is set as its 13th child. The result is, again, pushed to the stack.</figcaption></figure><ul><li>HASH</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*gYdMfv4eP2C4dEnnlEplrA.png" /><figcaption><strong>Figure 14</strong> A hash is taken from the proof’s list of hashes and pushed to the top of the stack.</figcaption></figure><ul><li>ADD(14)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*wJfXVGgiC59T5A9AJO2Cjg.png" /><figcaption><strong>Figure 15</strong> The hash is added as the 14th child of the tree.</figcaption></figure><p>The program has now terminated, and the top of the stack has the final version of the tree. This tree and the tree in figure 6 have the same root hash and it is trivial to verify that both keys are present.</p><h3>Relevance</h3><p>The Ethereum state is growing. At the time of this writing, we’re dealing with about 20 GB of state data (not including all the indices and other necessary features, which inflate this 10 fold). This is already too much for a cell phone to handle, so for the network to remain accessible be everyone, there is a need to let underpowered machines participate.</p><p>With such proofs, it is possible for a user to only store the data they are interested in, and to prove ownership when they want to interact with the blockchain. This is known as a light client.</p><p>Pushing the concept further, one can envision a “stateless” future for the main chain (independently of what happens with Serenity), where users only keep the proof of their part of the state on the blockchain, and publish these information when they need to use it. This will help stop the inflation of the state and keep Ethereum accessible to all.</p><p>There’s still work to be done in order to keep the proof sizes small and quick to process, and hopefully making the use of these more common will help.</p><h3>Acknowledgment</h3><p>This work would not have been possible without the input and feedback from <a href="https://medium.com/u/404913b2c32b">Alexey Akhunov</a> and Sina Mahmoodi. This version has been edited after publication, to include the remarks of <a href="https://twitter.com/josephch">JosephC</a> and <a href="https://github.com/gumb0">gumb0</a> 🙇</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=487aaa9b386" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ewasm 1.x precompiles, part 1]]></title>
            <link>https://medium.com/@gballet/ewasm-1-x-precompiles-part-1-66ee7e7345d1?source=rss-6594eebf58d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/66ee7e7345d1</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[ethereum-1x]]></category>
            <category><![CDATA[ewasm]]></category>
            <category><![CDATA[wasm]]></category>
            <dc:creator><![CDATA[Guillaume Ballet]]></dc:creator>
            <pubDate>Mon, 18 Feb 2019 06:01:00 GMT</pubDate>
            <atom:updated>2019-02-18T06:01:00.987Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a write-up of a lightning talk that I gave at <a href="https://youtu.be/CnOyVZ3HvK4?list=PLaM7G4Llrb7yxss-k2S3apbKHf1nvWLUA&amp;t=15">the Ethereum 1.x meetup in Stanford on January the 28th, 2019</a>. The goal of this presentation was two-fold: 1) draft up a list of requirements for an ewasm precompiles proposal, and 2) showcase the progress that has been made on that proposal. This post expands on that second point. Many thanks to Paul Dworzanski for his patient feedback.</p><h3>A first prototype</h3><p>At this stage, I have completed <a href="https://github.com/ethereum/go-ethereum/pull/18329">a first geth prototype that can execute simple contracts and sync Rinkeby</a>. We created <a href="https://github.com/ewasm/ewasm-precompiles">Rust version of the precompiles</a>, compiled them to WASM, then embedded them into geth. Each contract is associated to a VM object that is created once and for all, thus removing from the measurements the overhead caused by decoding the binary on each contract execution. And a small subset (6 functions) of the EEI (ewasm helper functions) has been implemented, for the WASM precompiles to interact with geth.</p><h3>Performance</h3><p>For each transaction stored on Rinkeby, the native precompile was executed and timed, before executing its WASM counterpart. It makes the sync considerably longer, but it’s also very useful since it’s then possible to compare the output of both methods transaction by transaction, and thus to identify behavioral differences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w7Y1ffx2YS3i0DFKPZJXug.png" /><figcaption>Figure 1 — Initial, non-optimized benchmark of a Rinkeby sync using a 8 core, 8th gen Intel Core i7 at 1.80GHz. The chart on the left represents the <strong>logarithmic</strong> difference in performance between the native implementations of the precompiles and their WASM counterparts. The chart on the right represents the slowdowns.</figcaption></figure><p>In first approach, these numbers are far from impressive, but there’s more than meet the eye:</p><ul><li>For starters, it shows that the longer a native contract takes to execute on average, the longer its WASM counterpart runs as well. So there is a direct relationship, which indicates that speeding up the interpreter is going to have some real impact. That’s great, those tests were made with a slower interpreter. So it’s only going to get better from here! The next steps include looking at <a href="https://github.com/ewasm/hera">hera</a>, <a href="https://github.com/perlin-network/life">life</a> and <a href="https://github.com/tsavola/wag">wag</a>.</li><li>Looking at the diagram on the right, we also see which contracts are in dire need of optimization. Luckily, they are the ones that are used the least. In the next step, we’re going to optimize them. For example, expmod uses a big integer library that is likely under-performing and there are no doubt a lot of gains to be made in this direction.</li></ul><p>But the most important conclusion, is that WASM precompiles are not intended to be run on interpreters once compilers are audited for consensus. It does makes adoption by every client easier when you create a new precompile (e.g. some SNARK precompiles that have been requested): you just fire up the good ol’ interpreter to execute your shiny new WASM precompiles until you can replace those WASM precompiles with an <a href="https://en.wikipedia.org/wiki/Ahead-of-time_compilation">AOT</a> version. Safety comes first, then performance. After all, the choice of WASM has always been about the tooling, ease of adoption and simpler gas rules. Speed is an implementation detail.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66ee7e7345d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>