<?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 Calvin Kim on Medium]]></title>
        <description><![CDATA[Stories by Calvin Kim on Medium]]></description>
        <link>https://medium.com/@kcalvinalvinn?source=rss-3ba174cdbbd4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*Jujdxk7Vd18p6MyJI5CPeg.jpeg</url>
            <title>Stories by Calvin Kim on Medium</title>
            <link>https://medium.com/@kcalvinalvinn?source=rss-3ba174cdbbd4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 23:19:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kcalvinalvinn/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[ELI5: Utreexo — A scaling solution]]></title>
            <link>https://medium.com/@kcalvinalvinn/eli5-utreexo-a-scaling-solution-9531aee3d7ba?source=rss-3ba174cdbbd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/9531aee3d7ba</guid>
            <category><![CDATA[lightning-network]]></category>
            <category><![CDATA[scaling]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain-scaling]]></category>
            <dc:creator><![CDATA[Calvin Kim]]></dc:creator>
            <pubDate>Sun, 12 Apr 2020 14:51:31 GMT</pubDate>
            <atom:updated>2020-04-13T03:38:35.869Z</atom:updated>
            <content:encoded><![CDATA[<h3>ELI5: Utreexo — A scaling solution</h3><p>About me: I’ve been actively contributing to the Utreexo implementation for the past 7 months and have been actively looking into Bitcoin and surrounding tech for the past 2 years as a co-organizer for the <a href="http://meetup.com/seoulbitcoin">Seoul Bitcoin Meetup</a>.</p><p>Utreexo is a <a href="https://en.wikipedia.org/wiki/Accumulator_(cryptography)">hash accumulator</a> for Bitcoin, proposed by Tadge Dryja, the co-author of the <a href="https://lightning.network/lightning-network-paper.pdf">Lightning Network paper</a>. It introduces the following trade-offs.</p><h3>Pros &amp; Cons</h3><h4>4 huge benefits to Bitcoin:</h4><ol><li>A new full node mode in a few kilobytes that syncs as fast as an ssd on an hdd.</li><li>Allows for parallelization of the initial block download.</li><li>Strengthens the security of Bitcoin by allowing consensus to be independent of the database implementation (the <a href="https://github.com/google/leveldb">current one</a> in usage is made by Google).</li><li>No forks needed to bring Utreexo to Bitcoin.</li></ol><h4>2 main downsides:</h4><ol><li>Around 20% more bandwidth usage for the initial block download.</li><li>Additional storage requirements for Utreexo archival nodes.</li></ol><h3>How it works</h3><p><em>Quick Overview: In Utreexo, a full node has the ability to keep only one hash per block, vs a traditional pruned full node where you have to keep all the UTXOs per block.</em></p><p>To understand Utreexo, it is important that we take a look at how hash trees work. We’ll look at Merkle trees since it’s used in Bitcoin.</p><p>A Merkle tree with 8 leaves would look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uixkl5lFpDsatlSx9B_1zg.png" /><figcaption>A typical Merkle tree</figcaption></figure><p>Every number in this tree represents a <a href="https://en.bitcoin.it/wiki/Hash">hash</a>.</p><p>All the numbers in the bottom-most row, in Bitcoin, would be a <a href="https://bitcoin.org/en/glossary/txid">TXID</a>. 08 would be the result of concatenating and hashing of 00 and 01. 13 would be the result of concatenating and hashing of 10 and 11.</p><p>Currently in Bitcoin, the Merkle tree is used for generating the merkle root in the <a href="https://bitcoin.org/en/glossary/block-header">block header</a>. Utreexo takes this Merkle Tree concept and applies it to the UTXOs. It is important to note that Utreexo doesn’t replace the Merkle tree in the block header.</p><p>Currently, as a Bitcoin full node, you must store all the UTXOs that are existent. In Utreexo, you can be a full node and <strong>only </strong>store the root of the UTXOs. The tree would look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I9dA2x5VCaCX-YHKTGSj0Q.png" /><figcaption>Utreexo tree with just the root. Note that all the other hashes are deleted.</figcaption></figure><p>All the other hashes from 00 to 13 are thrown away after validation and only 14, the root, is kept.</p><p>If a user wants to spend UTXO 07, they would have to prove to you that the transaction exists. This would be done by providing: 06, 07, 10, 12. Then the validating node would make a separate tree with the received hashes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LK9teQh-kigfQiNaix4N4A.png" /><figcaption>Tree for verifying. Note how the root can be calculated from this tree</figcaption></figure><p>The empty spaces 11, 13, and 14 can be calculated by the verifying node. If this tree’s 14, the root, matches the one we stored, we can say that the transaction exists.</p><p>Utreexo is a bit more complicated and is different in how it works from this example, but this is a quick rundown of its concept and how you can only store one hash instead of all the hashes and still be a full node.</p><h3>The Good</h3><h4><strong>1.</strong> A full node in a few kilobytes that syncs as fast as an ssd on a hdd</h4><h4>Full node in a few kilobytes</h4><p>Currently, there are two full node types: Archival and pruned. In a pruned node, the user only keeps the unspent transaction outputs (aka UTXO). Utreexo allows for another full node mode called the <strong>Compact State Node</strong> (or CSN) in which we only store roots and wallet information. This enables a full node to be a less than a kilobyte in data vs the current state where the user has to store a couple of gigabytes of data.</p><p>This ability to <strong>only</strong> store UTXOs that belong to the user becomes more important as the adoption of Bitcoin increases. With one user needing at least one UTXO (and much more for privacy reasons), it will result in the <strong>increase</strong> of UTXOs. We can clearly see this growth of UTXOs from the below chart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gf2XgPWPVtCxDtVZGVE8Ig.png" /><figcaption>UTXO count. Excludes OP_RETURNs</figcaption></figure><p>Because of this, the storage requirement for a pruned node <strong>will</strong> grow, increasing the minimum storage requirement for a Bitcoin full node. Utreexo thwarts this by allowing a user to prune the UTXOs that doesn’t belong to them.</p><h4>Initial block download as fast as an ssd on a hdd</h4><p>Because a Compact State Nodes (CSN) can represent the entire Utreexo state in less than a kilobyte, there is no need to query the disk during the initial block download. This allows for the initial block download to happen <strong>solely</strong> <strong>on RAM, </strong>allowing for an hdd node to sync as fast as an ssd node.</p><h4>2. Allows for the parallelization of the initial block download</h4><p>UTXO snapshotting is saving the state of all the UTXOs at a particular block height. One potential use case for this is the <a href="https://github.com/bitcoin/bitcoin/issues/15605">assumeUTXO</a> project, which allows blockchain syncing from the snapshotted height. The main hurdle for snapshotting is that the size of this snapshot is fairly big at it currently being around 5GB. The size of a snapshot will grow as the state above in Advantage 1. With Utreexo, this is possible with <strong>less than a kilobyte</strong> <strong>in the worst case scenario</strong>¹ (best case is around 100 bytes). UTXO snapshotting with Utreexo is so easy that the <a href="https://medium.com/stellar-developers-blog/zkvm-a-new-design-for-fast-confidential-smart-contracts-d1122890d9ae">ZKvM</a> project has already <a href="https://github.com/stellar/slingshot/blob/c0d0cdc927fa0f3a5a9b175a844a6f87bf3a1609/zkvm/docs/zkvm-blockchain.md">implemented</a> Utreexo and is using it for saving the blockchain state by including the Utreexo tree roots in the block header.</p><p>With snapshots being so cheap, it is feasible to have a snapshot at <strong>every block height</strong>. With this, future implementations of the blockchain sync can be done in parallel, meaning that one computer (or cpu core) can sync from block height 0 to 300,000 and another can sync from block height 300,001 to 600,000. With CPU optimizations now focused on <a href="https://www.tomshardware.com/news/amd-cto-mark-papermaster-more-cores-coming-in-the-era-of-a-slowed-moores-law">core count</a> rather than <a href="https://software.intel.com/en-us/blogs/2014/02/19/why-has-cpu-frequency-ceased-to-grow">clock speed</a> and the emergence of <a href="https://en.wikipedia.org/wiki/General-purpose_computing_on_graphics_processing_units">GPGPU</a>, this asynchronous block sync will help in further reducing the time needed to start up a Bitcoin Full node.</p><h4>3. Utreexo strengthens the security of Bitcoin</h4><h4>Allows consensus code to be separated from the database</h4><p>The <a href="https://bitcoincore.org/en/meetings/2016/10/20/">libconsensus</a> project was aimed at separating the consensus code from Bitcoin Core so that:</p><ol><li>Non-consensus code can be changed without fear of breaking consensus.</li><li>Allow for one consensus API across different Bitcoin implementations.</li></ol><p>It was ultimately abandoned since it was very difficult for the database (leveldb) to be separated from the consensus code. This is a hugely important problem to solve, <a href="https://blog.bitmex.com/bitcoins-consensus-forks/">as in 2013</a>, Bitcoin Core moved away from Berkeley DB to levelDB and suffered an unintended temporary hardfork, an unintended temporary softfork, and a hardfork (BIP50).</p><p>Currently, consensus is dependent on levelDB functioning correctly as you need to fetch the stored transaction. This means if levelDB is not functioning correctly, there can be a fork vs another client that is using a different database.</p><p>With Utreexo, you can validate an incoming transaction or block against the Utreexo tree without needing the database. The existence of a UTXO that the incoming transaction is spending would be checked upon with the included proofs.</p><h4>4. No forks needed</h4><p>The <a href="https://eprint.iacr.org/2018/1188.pdf">RSA accumulator</a>, proposed by Boneh et al. is more efficient in size vs Utreexo. However, the implementation of this would have to be done with a soft fork. With a conservative system like Bitcoin where even soft forks are done with extreme caution, these types of accumulators are very hard to implement into Bitcoin. <strong>Utreexo doesn’t require any forks</strong>. Users just have to opt into using Utreexo by running Utreexo nodes.</p><h3>The Bad</h3><h4>1. Needs Around 20% more bandwidth</h4><p>In a hypothetical situation in which one is syncing a bitcoin node with a really beefy computer, but lives in the middle of nowhere with very small bandwidth, Utreexo is gonna hurt, not help. The aforementioned proofs would have to be sent over along with the TXO, leading to around 20% more data to download from a peer.</p><p>Utreexo can be seen as a trade-off between bandwidth and storage requirements in this sense. If you think the price for storage (hdd, ssd) is a bigger hurdle compared to internet speed (and cost), Utreexo helps with decentralization efforts. If you think internet speed is a bigger hurdle, Utreexo hurts decentralization efforts.</p><h4><strong>2.</strong> Additional storage requirement for an Utreexo archival node</h4><p>Utreexo archival nodes are the current Bitcoin archival nodes that store the aforementioned proofs that Utreexo nodes require.</p><p>Utreexo archival nodes store:</p><ol><li>All blocks starting from genesis</li><li>All proofs starting from genesis</li></ol><p>Because of #2, this will put additional storage burden on archival nodes. If an Utreexo archival node stores all proofs for every block, this will be around 100% extra data to store.</p><p>However, this can be improved upon by not storing proofs for every block. One can store proofs for every odd block and “resync” if a node requests for proofs from an even block. For example, if proofs for block 566 is requested, the Utreexo archival node would:</p><ol><li>Retrieve block 566.</li><li>Retrieve Utreexo tree that was formed at block 565.</li><li>Apply the transactions from block 566 to the Utreexo tree, re-generating the proofs.</li><li>Send out generated proofs to the node that requested it.</li></ol><p>This could be taken even further and one can store proofs for every 10 blocks and so on, further lessening the storage burden.</p><p>Ultimately, a user can choose their own trade-off between cpu usage and storage. If a user has access to cheap data storage, they can choose to store all the proofs for all blocks. If a user has limited storage but has cpu time to spare, they can choose to store less and compute more.</p><h3>Conclusion</h3><p>Overall, Utreexo represents some trade-offs like any other system. I believe that Utreexo will aid in decentralization of Bitcoin by giving users the option to pick what trade-offs fit best for themselves.</p><p>An implementation is in active development at github.com/mit-dci/utreexo. Any contribution is greatly appreciated :)</p><p>Many thanks to <a href="http://twitter.com/tdryja">Tadge Dryja</a>, <a href="http://twitter.com/SomsenRuben">Ruben Somsen</a>, <a href="http://twitter.com/graycoding">Paul Grau</a>, and <a href="http://twitter.com/ysangkok">Janus Troelsen</a> for reviewing this article.</p><h4>Additional Resources</h4><p><em>In order of least technical to most technical</em></p><p><a href="https://www.whatbitcoindid.com/podcast/tadge-dryja-on-scaling-bitcoin-with-utreexo">What Bitcoin Did podcast interview with Tadge Dryja</a></p><p><a href="https://medium.com/mit-media-lab-digital-currency-initiative/grey-mirror-1-tadge-dryja-digital-currency-initiative-utreexo-and-bootstrapping-bitcoin-upgrades-51975411002">MIT DCI grey mirror podcast with Tadge Dryja</a></p><p><a href="https://bitcoinmagazine.com/articles/bitcoins-growing-utxo-problem-and-how-utreexo-can-help-solve-it">Bitcoin Magazine article by Ellie Frost and Aaron van Wirdum</a></p><p><a href="https://www.youtube.com/watch?v=xlKQP9J88uA">Bitcoin Edge talk by Tadge Dryja</a></p><p><a href="https://diyhpl.us/wiki/transcripts/bitcoin-core-dev-tech/2019-06-06-utreexo/">Core Dev meeting transcript</a></p><p><a href="https://www.youtube.com/watch?v=edRun-6ubCc">MIT Bitcoin Expo Utreexo introduction by Tadge Dryja</a></p><p><a href="https://eprint.iacr.org/2019/611.pdf">Original Utreexo paper by Tadge Dryja</a></p><p><a href="http://github.com/mit-dci/utreexo">Reference Implementation (Golang)</a></p><h4>Footnote</h4><p>¹ In Utreexo, you have to keep multiple roots at times. Some block heights have less roots to keep vs others. This is explained in more detail in the <a href="https://eprint.iacr.org/2019/611.pdf">Utreexo paper</a> as well as the <a href="https://www.youtube.com/watch?v=edRun-6ubCc">MIT Bitcoin Expo Utreexo introduction video</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9531aee3d7ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blockchain Simplified]]></title>
            <link>https://medium.com/@kcalvinalvinn/blockchain-simplified-9776bb6b2a60?source=rss-3ba174cdbbd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/9776bb6b2a60</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[decentralization]]></category>
            <dc:creator><![CDATA[Calvin Kim]]></dc:creator>
            <pubDate>Sat, 04 Aug 2018 15:38:11 GMT</pubDate>
            <atom:updated>2018-08-04T17:38:36.744Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Blockchain</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*d9AIfrD_DOLtXfKVnadN6w.png" /></figure><p>Bitcoin, created in 2008, solved this problem: asynchronous network when decentralizing a ledger. Satoshi grouped transactions into a single ID called the Merkle Root and forced computers to prove that they have spent electricity in order for the Merkle Root to be acceptable by other computers that received it. This results in what is called a Block Header. Furthermore, by requiring the previous Block Header to be included in the new Block Header, he created connections between the old Block Header to the new. This is what he called the block chain and this is what we call the Blockchain.</p><p><strong>The Courthouse</strong></p><p>Blockchain does one thing and one thing only: creating orderliness where there were none before. The Blockchain is a court that decides which transaction came first in a situation where everyone is spread around. A decentralized network is analogous to a city of people all spread around and in separate places. A decentralized digital payment would be if Bob was shouting that he paid Carol 10 dollars to everyone. Some might hear it later than others and some might only hear it by word of mouth. If Bob yells that he is buying a coffee and shortly after yell that he is buying a pen <em>with his only 10 dollars</em>, someone that is two blocks away might hear that he is buying a pen before they hear that he actually bought a coffee first by word of mouth. He only has 10 dollars but some believe he bought coffee from Carol while some believe he bought a pen from Alice. To whom does the 10 dollar bill belong to? The court decides where Bob spent his money which decide who gets paid. The court is free to choose who gets paid. You can even tip the a judge with money to make sure Alice gets paid.</p><p><strong>Limitation of the Judge</strong></p><p>Miners can be seen as judges. When the a judge decides on a transaction and has proven that he has spent his a certain amount energy on this case, everyone accepts the judge’s decision on which transaction came first. Let’s say that Bob paying Alice is case #1. Then the judge goes on to work on case #2, which is Alice spending her 10 dollars to David. Then he goes on to work on case #3 and so forth. When the judge has worked up to case #3, case #1 can still be overturned. When the judge has worked up to case #463, case #1 can still be overturned. However, if you want to overturn case #1, a judge or a group of judges have to spend their energy <em>again</em> on cases #2 ~ case #462. If you want to overturn a previous case, all the cases that are in between that case and the latest case must be reworked on. The more cases that have been built on top of the case that your transaction is in, the less likely it is for it to be overturned. Another important thing to note is that when a judge finishes a case, they get compensated for their work. So if you want to overturn case #1 while the judge has worked up to case #463, not only do they have to rework the cases in between, they give up their compensation that they have previously earned for their work. They do not get paid twice.</p><p>What if a judge dislikes you and refuses to work on a case that has your transaction in it? Fortunately, there are many judges out there and you can just go to a different one. The judges work for their compensation and are in competition with each other for their salary. If one judge won’t take a case with your transaction, there are others that will.</p><p>What if a judge tries to pass off a case that he hasn’t he hasn’t worked on with his energy? We the people reject his case. All the judge has power to do is order transactions. The judges cannot pass off an invalid case. We the people choose what is a valid case.</p><p><strong>What a Blockchain is</strong></p><p>That’s it. That’s all the Blockchain does. It puts an order to a decentralized network. A decentralized network is just individual computers spread around in the world. Blockchain introduces a court to decide on which transaction came first. Because not everyone receives the transactions at the same time as they are spread around. Because it introduces an extra step to decide which transaction happened first, it by definition introduces an extra step and it becomes more inefficient by having it.</p><p>So with all the information that we have now, does it make sense to have a court where everyone is in the same room? Does it make sense to have a court with 3 people? Does it makes sense to have a court where everyone trusts each other? The answer is no. No no and no.</p><p>Blockchain doesn’t make a network decentralized. Blockchain brings order to a network that is decentralized. If one introduces Blockchain to a centralized network all they would achieve is less efficiency. Blockchain is the means to bringing order not the means to brining decentralization.</p><p><strong>Conclusion</strong></p><p>There are many projects in this space that use Blockchain. I invite everyone to judge for themselves to see if bringing a court that achieves order is really necessary for that project. I encourage everyone to go beyond the promises of each team and look at their project with objectivity and with diligence. I encourage everyone to not trust, but everyone to use their own deductions and use their own knowledge to see if the project is worth putting your hard earned money into. Do not trust. Trust has no place in such a place with misinformation and deception. Truth only emerges from verification.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9776bb6b2a60" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>