<?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 Hugo Nguyen on Medium]]></title>
        <description><![CDATA[Stories by Hugo Nguyen on Medium]]></description>
        <link>https://medium.com/@hugonguyen?source=rss-3efc6d31e61c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*r9EmtrBApyLQoBvjewy3hQ.jpeg</url>
            <title>Stories by Hugo Nguyen on Medium</title>
            <link>https://medium.com/@hugonguyen?source=rss-3efc6d31e61c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 02:20:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hugonguyen/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[Passphrases Are Not the Solution for Bitcoin Custody]]></title>
            <link>https://hugonguyen.medium.com/passphrases-are-not-the-solution-for-bitcoin-custody-4f967a339b1b?source=rss-3efc6d31e61c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f967a339b1b</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[passphrase]]></category>
            <category><![CDATA[self-custody]]></category>
            <dc:creator><![CDATA[Hugo Nguyen]]></dc:creator>
            <pubDate>Fri, 30 Jun 2023 13:17:11 GMT</pubDate>
            <atom:updated>2023-08-07T08:14:04.148Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>The problems with passphrases</strong></h3><p><a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">BIP39 passphrases</a> have weaknesses that are often overlooked, including:</p><p>(1) Combination of secrets: The private key and passphrase must be combined in a single location for every single spend.</p><p>(2) Exposure of secret: The passphrase must be manually entered for every single spend.</p><p>In terms of security, requirement (2) is particularly unique. Unlike seed phrases or private keys, passphrases must be frequently entered, exposing them to the outside world.</p><p>As an example of how this weakness could be exploited: Recent advancements in AI technology have reached a point where <a href="https://www.vice.com/en/article/y3p7xj/scientists-are-getting-eerily-good-at-using-wifi-to-see-people-through-walls-in-detail">WiFi routers can now be utilized as motion trackers</a>, as demonstrated in <a href="https://arxiv.org/abs/2301.00250">a recent study</a>. In a similar vein, researchers have shown that <a href="https://www.bleepingcomputer.com/news/security/new-acoustic-attack-steals-data-from-keystrokes-with-95-percent-accuracy/">the sounds of keystrokes recorded over Zoom could reveal what you typed with 93% accuracy</a>. What this means is that in the future, any electronic signal-rich environment could potentially capture passphrase inputs.</p><p>Attackers may not need to learn all characters of a passphrase; even partial knowledge or the length alone can provide clues for cracking it.</p><p>To summarize this problem:</p><ul><li>Keeping a secret is most effective when it is exposed to the environment as little as possible.</li><li>BIP39 passphrases are designed to be frequently exposed.</li></ul><p>This contradiction creates a significant attack vector that cannot be ignored. The problem already exists without AI, but with AI, it becomes an even more substantial concern.</p><p>Other weaknesses of passphrases include:</p><ul><li>The lack of standardized key lengths often leads to users employing weak or non-random passphrases, making them susceptible to brute-forcing.</li><li>The absence of a checksum leaves no room for error when it comes to memorization or when sharing access for inheritance purposes.</li><li>The need to combine the private key and the passphrase for each spend means that attackers can time when these secrets are brought together to gain access to both secrets. They can even lure victims into combining them, such as by pretending to offer high-value goods in exchange for bitcoins.</li><li>The introduction of a passphrase might create a false sense of security and cause the users to be more lax in securing the seed phrase (e.g. making multiple copies of it).</li></ul><p>Most critically, passphrases represent single points of failure. Instances of users being <a href="https://twitter.com/HODLneverSODL/status/1674541827532238850">locked out of their wallets due to forgotten passphrases</a> have been, and will continue to be common as long as passphrases are promoted without sufficient guidance and warnings.</p><p>To make matters worse, certain hardware vendors offer products without protection against physical threats, by <a href="https://blog.trezor.io/is-banking-grade-security-good-enough-for-your-bitcoins-284065561e9b">not including Secure Elements in their designs</a>. To compensate for this lack of security, these vendors often promote the reliance on passphrases.</p><p>However, this approach does not provide a genuine solution but merely shifts the burden of security and key management onto end users, leaving them to fend for themselves.</p><p><strong>Conclusion</strong></p><p>While the scenario of AI targeting Bitcoin users may seem far-fetched, attacks on Bitcoin users will undoubtedly become increasingly sophisticated. Recent incidents, such as the wave of <a href="https://twitter.com/PrestonPysh/status/1672795687283568641">SIM swap attacks</a>, serve as reminders.</p><p>Passphrases have inherent weaknesses that make them ill-suited for an adversarial environment and the future of Bitcoin custody.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f967a339b1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitcoin and the Dunbar Limit]]></title>
            <link>https://hugonguyen.medium.com/bitcoin-and-the-dunbar-limit-5c820c4e5632?source=rss-3efc6d31e61c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c820c4e5632</guid>
            <category><![CDATA[dollar]]></category>
            <category><![CDATA[dunbars-number]]></category>
            <category><![CDATA[cooperation]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Hugo Nguyen]]></dc:creator>
            <pubDate>Wed, 24 Nov 2021 10:12:05 GMT</pubDate>
            <atom:updated>2021-12-01T16:54:07.841Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SdAyqiquKE_5jpy_.png" /><figcaption>Image by <a href="https://commons.wikimedia.org/w/index.php?title=User:JelenaMrkovic&amp;action=edit&amp;redlink=1">JelenaMrkovic</a>, CC BY-SA 4.0</figcaption></figure><p><em>Disclaimer: This essay contains my personal opinions and deductions.</em></p><p>When it comes to cryptocurrencies, my main interest lies in Bitcoin, not “blockchains”. The blockchain hype has been blown so out of proportions in the last few years that it immediately brings to mind the fresh memory of the Dotcom era and other bubbles in the past. When things that make zero sense on multiple fronts start reaching billion-dollar valuations and everyone around you is shouting “FOMO!”, it should bother you deeply.</p><p>To be clear, I can imagine a future where a few select digital assets will co-exist with Bitcoin. It is not out of the realm of possibilities. Nevertheless, when it comes to having an impact, Bitcoin will likely dwarf everything else for reasons that I will expand on below.</p><p>I have also written about the infeasibility of projects such as <a href="https://hugonguyen.medium.com/why-ethereum-architecture-is-flawed-d4eefd15db3e">Ethereum</a>, <a href="https://hugonguyen.medium.com/work-is-timeless-stake-is-not-554c4450ce18">Proof-of-Stake</a>, <a href="https://twitter.com/hugohanoi/status/976261540419534848">utility tokens</a>, <a href="https://twitter.com/hugohanoi/status/1368050381922529288">NFTs</a>, etc. but these will not be the topic of this essay.</p><p>So what’s the big idea? Fundamentally, I believe that Bitcoin will help us co-operate much more efficiently at scale, and change the way we organize society. In other words, Bitcoin will raise our “Dunbar level”.</p><p>What is a Dunbar level? How is it relevant to Bitcoin? Time for some stories.</p><h4><strong>Chapter 1: Columbus vs. the Ming Dynasty</strong></h4><p>For many born in this day and age, it is often taken for granted that the West is the more dominant power of the world. The West is relatively richer per capita, more developed and more technologically-advanced than the East. The East was only able to slowly catch up when it opened itself up to Western ideas and philosophies. This started with Japan during the Meiji era in the late 19th century (led in particular by thinkers like Fukuzawa), followed by the four Asian tigers (South Korea, Taiwan, Singapore and Hong Kong) in the second half of the 20th century. In the last and current wave, it has been China, Vietnam and Southeast Asia driving the growth. We don’t have to look very far for evidences. Just look around in our daily life: anything that brings material improvement to our standard of living — such as the Internet, smartphones, automobiles, air conditioners, self-cleaning toilets — they all have deep Western imprints.</p><p>Yet, this wasn’t always the case. For thousands of years, the East, particularly China, was at the peak of civilization.</p><p>Long before Columbus “discovered” America, the Ming dynasty commanded Admiral (and eunuch) Zheng He to take to the sea and discover what lay beyond the horizon. These Chinese voyages featured hundreds of ships and tens of thousands of troops, with the largest ships measured up to 500–600 feet long. These ships were 10 times bigger than the ships that Columbus later commanded. The Chinese expeditions reached lands far and away, including pretty much all of Southeast Asia, the Indian Ocean, the Persian Gulf and the coast of eastern Africa. Glamorous was an understatement.<br> <br>Yet in many ways these expeditions were a failure, especially when compared to the European ones that changed the fate of the world a century later. There were a couple of reasons as to why.<br> <br>First, the main purpose of the Chinese expeditions was to show off the strength and glory of the Chinese empire, and to collect tributes from foreign lands. But the exotic tributes alone could not cover all the costs. Second, these oversized (and high-maintenance) ships were not a good fit for sea commerce. What that meant was that these voyages had little commercial value. For these reasons, when times turned bad the Ming had to shut them down to focus on the Mongol threat up North.</p><p>But what the Zheng He voyages demonstrated was that the power of the Chinese empire was unmatched during those times. In any era, the discovery of new territories perhaps only reflects one aspect of society, but these expeditions and discoveries are a great proxy for approximating the wealth and the level of technology of said society. The Zheng He expeditions were not unlike how NASA, CSNA, SpaceX, or BlueOrigin are vying for space dominance today. Only the most powerful and technologically-advanced entities on Earth can afford these kinds of endeavors.</p><p>Up until the 19th century, China was still the largest economy in the world, their GDP was approximated to be a third of global GDP. China invented the compass, paper, printing and gunpowder. (Chinese porcelains, once considered “white gold”, were so advanced that it took Europeans a few centuries to be able to copy their manufacturing techniques.) Just imagine what would have happened if those early Zheng He expeditions had a different, conquering-leaning mindset, combined perhaps with the use of gunpowder, we would perhaps be living in a totally different reality. As it turned out, it was the West that used gunpowder on China first, a few centuries later.</p><p>But China’s dominance started to fade back around 400 years ago. What was the main reason for this decline? Or perhaps more accurately, what enabled the West to leap-frog the East during these 400 years?</p><h4><strong>Chapter 2: The Power and Limit of Belief Systems</strong></h4><p>If you have read Harari’s Sapiens, you have heard of “Dunbar’s number”. Due to our cognitive limit, humans can only maintain around 150 stable social relationships per person. This number was proposed by the British anthropologist Robin Dunbar in the 1990s, who “found a correlation between primate brain size and average social group size.”</p><p>It is worth noting that the exact number probably varies depending on the person and circumstances, but the theory is likely directionally correct.</p><p>I want to take the liberty here to expand on this concept and very roughly define “Dunbar levels”: the idea is that certain tools will help humans become better at cooperation games, and each one of those tools likely has a limit [1] in terms of (a) how many people it can help cooperate and (b) how well it does so. These are Dunbar levels. As we create better tools for co-operation, we “level up”, so to speak. [2]</p><p>For humans to go beyond the initial Dunbar limit (level 1) and organize ourselves into larger groups, there needs to be some special forces that can unite strangers. Otherwise, we would still be living in small tribes.</p><p>Religion was such a force.</p><p>Religion was the first human invention that enabled thousands, millions of people to share a common outlook on life and “march to the same drum”, so to speak. They can go even as far as dying for their belief. Before religion, uniting groups of humans in such a way was impossible.</p><p>By the 11th century, Christianity has spread to all corners of Europe. The Kings of the Middle Ages, as powerful as they were, were second to the Church. At the peak of their power, it was the Pope that crowned kings and emperors. The center of power of Europe wasn’t in England, France or Spain. It was Vatican city.</p><p>In the East, it was Confucianism that played a similar role.</p><p>From the Han dynasty (206 BCE–220 CE), Confucianism became the central piece of organized Eastern societies. Thanks to Confucianism, the state doesn’t have to intervene in their subjects’ daily life, and let them self-regulate instead.</p><p>Confucianism was how people in the East overcame the Dunbar limit, by sharing a set of common beliefs and self-organized themselves into various professions and classes that made up the feudal Eastern societies.</p><p>Both Christianity and Confucianism were incredibly powerful at uniting people, capable of creating highly complex social structures, but at the same time, they held back our ancestors.</p><p>Christianity put the words of God above all else. Everything in life must follow the Bible to the letter. If the Bible said that Earth is the center of the universe, then that is an undeniable truth. If the Bible said that sinners shall be stoned or burned to death, so be it.</p><p>Confucianism, on the other hand, over-emphasizes harmony and the role of humans in maintaining harmony. <em>“Let the prince be a prince, the minister a minister, the father a father and the son a son.“</em> Confucians tend to think that every person is born with a clearly-defined role in life, with little room for deviation. Confucians take the natural world as it is, not something to be explored or understood but something to make peace with. It elevates the mind, and downplays what the eyes and the ears see and hear, because Confucianism in essence put humans at the center of its philosophy, not nature. Confucianism also doesn’t encourage thinking outside-the-box as it would disrupt harmony and endanger the social order. In short, Confucianism is a highly constrained, oppressive thinking system.</p><p>The major changes in Europe started with Copernicus and Galileo. They were the first people that dared to go against the words of the Church, claiming that Earth was not the center of the universe. Together with the invention of the Gutenberg’s press in the 15th century, the spread of knowledge through books, the inspirations from Columbus travels, all these events slowly changed people’s perception of life. These seeds laid the foundation for the scientific revolution, which brought fourth an era of great discoveries. Since the scientific method was invented, people became less and less reliant on religion. Instead of blindly following the words of some religious texts, people honed their observation skills to find hidden secrets of the natural world.</p><p>So now we can answer the question in the first story: the reason the West was able to leap-frog the East was because the West was able to lose the shackles of their earlier belief system — Christianity — while the East was unable to do the same for theirs — Confucianism.</p><p>Through this story we can see that belief systems are double-edged swords. They often have the power to unite, but they can also be oppressive and hold back progress.</p><p>If the belief systems steer us to truly better things in life (for examples: don’t kill, don’t steal), society will likely be better off in the long run. But if they stop us from advancing our understanding of the world, we can stop progressing or even decline.</p><h4><strong>Chapter 3: The Dollar Religion</strong></h4><p>Christianity and Confucianism were some of the earliest belief systems that helped us overcome the Dunbar limit.</p><p>But there is a belief system even stronger than religion, and that is money.</p><p>To borrow Harari’s words:</p><blockquote>“Money is more open-minded than language, state laws, cultural codes, religious beliefs and social habits. Money is the only trust system created by humans that can bridge almost any cultural gap, and that does not discriminate on the basis of religion, gender, race, age or sexual orientation.”</blockquote><p>Thanks to money, any two strangers — no matter how far apart or how culturally different — can trade with one another. Thanks to money, we can have markets and vibrant economies. Thanks to money, we can create abstract economic concepts such as corporations and shareholders. Thanks to money, a society of hundreds of millions can operate smoothly.</p><p>For most of money’s history, gold was king. Humans have been fascinated with and have been collecting gold going back as far as 5,000 years ago. But the dollar has replaced gold as the world’s number one currency in the 20th century. And this has been entirely due to the two world wars and the unique geography of the United States.</p><p>The US spent much of the 19th century expanding its territories. When war broke out across the Atlantic at the turn of the 20th century, the US had consolidated much of its land mass and owned both the coast lines of North America, ultimately acquiring natural shields on both sides. As a result of this, the United States was by far the least damaged industrialized country during WW1 and WW2.</p><p>Not only it was least effected, it benefited greatly from the wars. Before WW1, the US was just one of many powers on the world stage. During the wars, it supplied weapons and goods to the participating countries. It adjusted its industrial base to the demands of the wars. It gave out loans and became an increasingly large creditor. Slowly but surely, the wealth of the entire world gravitated towards the US.</p><p>This trend culminated post-WW2: the US at that point had possession of more than half of the world’s gold reserve (some figures said up to 75%). At the same time, the rest of the world had been badly destroyed and currencies from former imperial powers lost much of their values. Under this environment, the Bretton Woods agreement came into place in 1944, officially making the US dollar the world’s reserve currency. At the time, the dollar was still pegged to gold. Owning the dollar was indirectly owning gold.</p><p>But everything changed again in 1971. The US, ensnared in Vietnam, became heavily indebted and financially strained from both the war and LBJ’s Great Society programs. Then US president Nixon made one of the most pivotal decisions in modern history by unilaterally ending the Bretton Woods system, removing the gold peg and floating the dollar. The dollar’s long 200-year relationship with gold officially ended in 1971.</p><p>(The role of gold in US history was deemed so important that the US founders added a “Gold &amp; Silver” clause to the Constitution in 1787.)</p><p>Connecting the dots, we can come to this conclusion: it was war that propelled the US and the US dollar into dominance, and it was again war that indirectly helped create the global financial system that we know of today. [3]</p><p>Since 1971, the total supply of the dollar is controlled by a cabal known as the US Federal Reserve. Instead of anchoring our universal exchange value in a neutral, scarce and unforgeable metal like gold, we have turned to trust this small group of people.</p><p>We can also say that since 1971, the dollar became a full-fledged religion. Just like Christianity, the dollar has its gospel (the dual mandate), its churches (the central banks), its missionaries and enforcers (mainstream economists and politicians), and its Popes (the Chairmen of the Federal Reserve).</p><p>The fact that we are willing to trust the dollar is not unlike how people in the Middle Ages believed that the earth was the center of the universe. We believe in it purely because other people do, too.</p><p>The power of the Federal Reserve is as far-reaching as it was for Vatican city. Markets around the world collectively hold their breath whenever the Fed makes policy announcements. The Fed sneezes and the world catches a cold.</p><p>And just like Christianity, the dollar has great oppressive power.</p><p>Along with the rise of the dollar, the US became the “policeman” of global economic activities.</p><p>The fact that most international payments are denominated in dollar means that the US has discretionary power to intercept and interrupt the flows of global economic activities, even activities that have nothing to do with the US. This is the basis of the US sanction system.</p><p>The primary ways the US achieves sanctions are through Chips (the US Clearing House Interbank Payments System) and indirectly through SWIFT (the Society for Worldwide Interbank Financial Telecommunication). Chips processes about $1.5 trillion a day and has a 96% market share on large-value domestic and international USD payments. SWIFT does not settle transactions but it is a communication network that connects 11,000 global banks, and is heavily controlled by the US.</p><p>In recent years, especially after 9/11, the US has ramped up its sanctioning activities. This angered many countries, including Russia, China, and even the US’s own allies. When President Trump started imposing sanctions on Iran, the EU encouraged its members to maintain economic ties with Iran. In 2019, England, France and Germany briefly set up a vehicle called INSTEX to skirt around US sanctions, but ultimately failed. The US’s control of the global financial machinery was simply too powerful.</p><p>As we speak, the EU, Russia and China are all actively finding ways to promote their own currencies and to become independent of the dollar.</p><p>The sanctions on Iran are a prime example of how a centralized currency system can become oppressive. Without such a system in place, there could have been billions of value created through trade, but the US single-handedly stopped this from happening, against many countries’ wishes.<br> <br>If we stop and think about it, the mere concept of sanction is bizarre. How does one single country, out of almost 200 countries in the world, put another country into total economic isolation? This would only be possible if that country has complete control over economic flows of all other countries. If the world is a village, then the US must be the village’s biggest bully.</p><p>An even bigger problem with a state-issued currency is the threat of inflation and hyperinflation.</p><p>The blind trust that people place in state-issued currencies makes it easy for the state to abuse that trust and print money irresponsibly. Throughout history, there has been many state-issued currencies that experienced hyperinflation. This was the case for the currencies of the Roman Empire, the Tang dynasty and the Ming dynasty. More recently, it was Argentina, Venezuela, Zimbabwe and Turkey.</p><p>When a currency hyper-inflates, it causes major long-term structural problems. First, it kills trust and wreaks havoc on the economy. Second, it fuels deep-seated conflicts, which could turn violent quickly (some historians suggested that Roman currency debasement was the primary cause of their civil wars and eventual collapse). Third, it massively increases wealth inequality, as the upper classes typically have more means at their disposal to hedge the impact of inflation, such as parking their wealth in rare commodities or real estate.<br> <br>It wasn’t a coincidence that global wealth inequality has accelerated sharply since 1971. The level of wealth inequality today is the worst it has been in a few centuries, going back to the Middle Ages. High wealth inequality causes a lot of social friction and the reason why so many have taken to the street in protests across many countries.</p><p>More than 20% of all dollars in circulation were printed in 2020, which was unprecedented. Inflation pressures in 2021 can now be observed everywhere across the board, from the prices of gas to vegetables to construction materials.</p><p>Whether the fiat dollar — a currency with merely 50 years of history — can survive or it is fated to inflate itself out of existence, we will have to wait and see. But past evidences are not encouraging.</p><h4><strong>Chapter 4: Bitcoin’s Mission</strong></h4><p>Bitcoin has great potential because it can become a better currency standard than both gold and the dollar.</p><p>Bitcoin is better than the dollar because similar to gold, it is not controlled by anyone, and truly scarce. The Bitcoin supply is fixed at 21 million and cannot be arbitrarily changed.</p><p>Bitcoin is better than gold because it is digital and inherits all the properties of digital things, such as moving at the speed of light, efficient storage, etc. The costs associated with transportation, storage, as well as verifying the authenticity of gold are extremely high. For these reasons, gold ownership has historically been susceptible to improper confiscation. In contrast, Bitcoin is easy to store and transport, and its authenticity can be verified cheaply. Bitcoin is a perfect fit for the Internet economy because just like the Internet, it is borderless.</p><p>Bitcoin is similar to gold in the sense that they are both <a href="https://nakamotoinstitute.org/shelling-out">unforgeably costly</a>, and they are ultimately backed by energy. Gold atoms were created billions of years ago during the collision of neutron stars — this is gold’s “<a href="https://bitcointechtalk.com/the-anatomy-of-proof-of-work-98c85b6f6667">Proof-of-Work</a>”. Because of the enormous amount of energy required to create or synthesize gold, gold is hard to fake. In the same way, to create fake bitcoin would require an amount of energy so large that it would be impossible to go unnoticed if any person or group ever attempts to do so.</p><p>With all that said, Bitcoin is not perfect. Bitcoin has a relatively short history compared to gold, which has been tested through many millennia. The decentralization properties of Bitcoin, which are needed to maintain its neutrality, are relative, and can change with time. Bitcoin requires continual vigilance from its participants (developers, users, businesses, exchanges and miners) to ensure that the system stays open and permission-less.</p><p>So far, Bitcoin has been positively moving in this direction, improving its decentralization and resilience metrics over time.</p><p>Early in Bitcoin’s history, mining was concentrated in China, but now it has completely moved out of China and spread to other countries. Self-custody is another area that has seen major improvements. Early on, the majority of bitcoin were held on a few exchanges, but the options for safe self-custody are rapidly expanding, which will make the system more robust in the long run.</p><p>Bitcoin’s biggest test came in 2017, when a significant faction of the network, comprised of some of the biggest Bitcoin businesses and ~80% of total mining power, wanted to force a rule change onto the Bitcoin protocol that would weaken decentralization. Yet they failed spectacularly and would serve as a major deterrent to future take-over attempts.</p><p>Bitcoin is the only software network that has a 99.99% uptime since its inception. In its short history, it has already served as a lifeboat for so many people around the world who live under totalitarian regimes, war-torn countries or economic sanctions.</p><p>When it comes to the future of money, no other blockchain project can even come close to Bitcoin’s network effects and strengths.</p><h4><strong>Conclusion</strong></h4><p>The reason humans are at the top of the food chain is because of our ability to co-operate with one another. Without special tools that unite people and improve our co-operation skills, we could only live in small tribes of a few hundred people. This is the Dunbar limit.</p><p>Religion and belief systems in general were the first human inventions that allowed us to break the Dunbar limit. Christianity played this role in the West, while Confucianism did the same in the East. While incredibly powerful, belief systems can also be oppressive and hold back progress.</p><p>Money is also a belief system. The unifying force of money is even stronger than that of religion. Thanks to money, we can exchange goods and services with people we have never met. But similar to religion, a currency operated purely based on belief and controlled by a small group of people can create an oppressive financial environment. The US and the dollar rose to dominance in the 20th century, but since Nixon unilaterally ended the Bretton Woods system in 1971, the US has increasingly turned the dollar into a financial weapon.</p><p>Bitcoin has great potential to change the world because it is superior to gold and the dollar in many aspects. Bitcoin is apolitical money, and does not discriminate. Bitcoin gives us an anchor of value in a world that has lost its sense of values. If successful, Bitcoin will help us co-operate much more efficiently at scale, remove gate-keepers, unlock frictionless commerce, and bring wealth and prosperity to large populations of the world.</p><p>[1] For example, Bitcoin probably will not work inter-planetary if the distance is too large.</p><p>[2] Nick Szabo called it “<a href="http://unenumerated.blogspot.com/2017/02/money-blockchains-and-social-scalability.html">Social Scability</a>” and expertly argued how Bitcoin improves social scalability. This essay has been influenced by Szabo’s writings.</p><p>[3] The relationship between war and money is a two-way street.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c820c4e5632" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Nunchuk: Multisig Made Easy]]></title>
            <link>https://hugonguyen.medium.com/introducing-nunchuk-multisig-made-easy-1b9846e6b3ca?source=rss-3efc6d31e61c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b9846e6b3ca</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[multisig]]></category>
            <dc:creator><![CDATA[Hugo Nguyen]]></dc:creator>
            <pubDate>Sat, 31 Oct 2020 16:23:51 GMT</pubDate>
            <atom:updated>2020-10-31T23:24:43.399Z</atom:updated>
            <content:encoded><![CDATA[<p>Bitcoin, year 12.</p><p><em>Alice: This year sucks. You know what’s almost as bad as 2020?</em></p><p><em>Bob: Yeah?</em></p><p><em>Alice: Multisig is still scary.</em></p><p><em>Nunchuk: Hold my beer.</em></p><p>It’s somewhat ironic that for a technology that reveres decentralization as its central operating principle, Bitcoin still heavily relies on single point of failure as the dominant method of ownership. This despite the fact that the unique risk profile of digital assets desperately calls against such a practice.</p><p>The highest barriers are technical challenges. Multisig is not for the faint of heart. Many pitfalls await around the corner.</p><p>Did you back up all your seeds? Do you need seeds? Are you sure the signing devices use the same derivation path? What about that change address? What do you mean you lost your device in a boating accident? Oops, some vendor has just made an update that bricks my setup.</p><p>And the list goes on.</p><p>What if we tell you you don’t have to worry about any of this anymore. What if there’s something. THAT. JUST. WORKS.</p><p>Say hello to Nunchuk. The app that makes multisig feel like a walk in the park.</p><figure><img alt="Nunchuk" src="https://cdn-images-1.medium.com/max/1024/1*dPyDFv12JilmRiXYwmRnBQ.png" /><figcaption>Nunchuk</figcaption></figure><p>But before we talk about features, let’s talk about design philosophy.</p><p>If we were to design a multisig wallet today, what should our goals be?</p><p>Our answer:</p><ul><li>It must be secure.</li><li>It must be seamless.</li><li>It must be future-proof.</li><li>It must go above and beyond to empower the user.</li></ul><p>Let’s see how Nunchuk meets these goals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RJ_ektZ4w504L92NQAjQYA.png" /></figure><ol><li><strong>It must be secure.</strong></li></ol><p>Security starts by knowing our limits. We defer to specialists in the most security-sensitive areas.</p><p>That means delegating the task of managing private keys to single-purpose hardware.</p><p>That means sticking close to Bitcoin Core for consensus code, for standardness rules, for future upgrades. That means avoiding reinventing the wheel in Bitcoin-specific areas.</p><p>That also means ruthlessly cutting down on the number of software dependencies, because each dependency is a potential attack surface. That means going with the desktop first and not the browser. That means outside of Core, only using battle-tested software. We can’t completely eliminate all attack surfaces. But we can minimize them.</p><p><strong>2. It must be seamless.</strong></p><p>Going from a single signer to multiple signers necessarily requires some level of friction. The goal is to avoid <em>further friction</em> in every other part of the multisig process.</p><p>In the early days of Bitcoin, wallet vendors were often incompatible with one another, which complicated multisig setups. On this front, there have been great developments in the last few years, notably PSBT and the descriptor language. Both have greatly improved the ecosytem’s interoperability.</p><p>Nunchuk treats descriptors and PSBTs as first-class citizens. The consequence of this is that you can use Nunchuk with many different hardware vendors, or easily recover a multisig wallet created by Nunchuk on other wallet software such as Core.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3_tBydbLbmkWlQa9JZzDKA.png" /></figure><p>Being seamless also means the ability to switch between singlesig and multisig use cases.</p><p>Nunchuk introduces a third type of wallet: an Escrow. It is a one-time-use multisig wallet specially created for the purpose of holding funds temporarily. With Nunchuk, you can easily move funds among these three types of wallets.</p><p><strong>3. It must be future-proof.</strong></p><p>It would be a shame if we design a brand new multisig solution, only for it to get outdated quickly by tomorrow’s protocol changes. Many multisig solutions in the past no longer serve us well, because they were designed at a time when tools were lacking, and ended up being needlessly complex. Multisig is bound to evolve further in the coming years.</p><p>Because Nunchuk stays close to Core code, it can immediately reap all the benefits of future protocol upgrades.</p><p>When Taproot is ready, Nunchuk is ready.</p><p><strong>4. It must go above and beyond to empower the user.</strong></p><p>Last but not least, we want to offer the user granular control over their wallet, and most importantly, their privacy. That’s why we invested time and effort to add support for things like coin control, replace-by-fee, personal server, TOR support, among others. The reason is simple: we ourselves are users of multisig. If someone else designs this app, these features would be high on our wish list.</p><p>That, in a nutshell, is Nunchuk.</p><p>Nunchuk’s mission is to make multisig the gold standard — no pun intended — for owning Bitcoin.</p><p>Nunchuk beta is now available for download at <a href="http://nunchuk.io/">nunchuk.io</a>. We look forward to hearing your feedback.</p><p>Keep stacking.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b9846e6b3ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Ethereum Architecture is Flawed]]></title>
            <link>https://hugonguyen.medium.com/why-ethereum-architecture-is-flawed-d4eefd15db3e?source=rss-3efc6d31e61c------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4eefd15db3e</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Hugo Nguyen]]></dc:creator>
            <pubDate>Wed, 16 Jan 2019 15:17:22 GMT</pubDate>
            <atom:updated>2021-02-14T05:56:08.198Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*06HdXsCMTaqjWouZQrzlcw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/bj8U389A9N8?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Thought Catalog</a></figcaption></figure><p>In its 3+ years of existence, Ethereum has had no shortage of controversies. From the <a href="https://www.coindesk.com/understanding-dao-hack-journalists">DAO hack</a>, to the long-anticipated <a href="https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQs">transition to Proof-of-Stake</a>, to the <a href="https://twitter.com/ConsenSys/status/1084498950957264896">Constantinople upgrade</a> that reduces mining reward and changes the inflation schedule on-the-fly (not that Ethereum had a clear one to begin with). Ethereum’s culture seems to be diametrically opposed to Bitcoin’s. Everything that Bitcoin shuns, Ethereum loves to embrace.</p><p>If one were to ignore all the noise and dig under the hood, one would find that Ethereum’s #1 problem is not a problem of product-market-fit but one of engineering soundness. Ethereum architecture is based on a flawed and unscalable idea: it assumes that “<a href="https://medium.com/@jimmysong/the-truth-about-smart-contracts-ae825271811f">smart contracts</a>” need computations to be replicated on thousands and thousands of machines.</p><p>The rest of this article explains why. It was originally a <a href="https://twitter.com/hugohanoi/status/1079639446088118272">tweet storm</a>, now converted to blog format.</p><p>Bitcoin is no magic. It sacrifices all manners of efficiencies, which goes against our intuition and “best practices”, in order to give us something special.</p><p>Bitcoin is specifically inefficient in 2 dimensions:</p><ul><li>It mandates that rate of blocks produced must be slow</li><li>It uses broadcast communication</li></ul><p>To highlight how counter-intuitive this is. How often do you:</p><ul><li>Purposely make a job slower, even if you figured out a way to make it faster?</li><li>Tell everyone you know about every single thing that you did, every minute of the day?</li></ul><p>To do this in a network setting is even more insane. Not only you are slow, everyone else must be slow. Not only you scream at everybody, everybody screams at everybody else.</p><p>Furthermore, this network has hundreds of thousands of members. If you have a giant insane asylum in mind, you have the right mental image.</p><p>Doing things the Bitcoin’s ways is literally insane, in most contexts.</p><p>It turns out that being maximally inefficient has its advantages. By intentionally forcing things to be slow, Bitcoin makes it costly to cheat. By using broadcast communication, it minimizes the need to trust individual members (or maximize fault-tolerance, in computer science terms).</p><p>By doing both, slow blocks and broadcast communication, Bitcoin solves the <a href="https://en.wikipedia.org/wiki/Byzantine_fault_tolerance#Byzantine_Generals%27_Problem">Byzantine Generals’ Problem</a>. A huge breakthrough in computer science.</p><p>But doing things Bitcoin’s ways comes at a heavy cost. It walks a thin line between brilliance and uselessness. Blockchain systems work well as long as the data flowing through them grow at a manageable rate.</p><p>A data growth rate of anything but linear is unsustainable, and a certain death sentence. Non-linear data growth will quickly kill the individual nodes one-by-one, and inevitably revert the system back to a less trust-minimized model.</p><p>As blockchain systems are already maximally inefficient, there is little to fall back on if the data grows too quickly. Blockchain systems, as they are, tread on very thin ice.</p><p>So <strong>when it comes to blockchain data, you need to be ruthlessly efficient</strong>. This is to compensate for being maximally inefficient in areas mentioned above.</p><p>This is precisely why Ethereum’s architecture of “rich statefulness” is such a bad idea. Ethereum states are needed purely for computation purposes, but they grow at an unmanageable rate.</p><p>Ethereum’s design deciscions are even more questionable when the reasons for embracing rich states at the core layer are vague and dubious.</p><p>To simulate <a href="https://en.wikipedia.org/wiki/Turing_completeness">Turing-completeness</a>? There can be no real Turing-completeness on the blockchains as all programs must somehow be halted. So “Turing-complete” is a total gimmick. Vitalik himself admitted to this.</p><p>To make programmable smart contracts easier to write? Ease of use is the least of your worries when it comes to blockchain engineering. Backward priorities. Remember, with blockchains you’re already treading thin ice, without adding rich states.</p><p>So why? To support computations otherwise not possible with Bitcoin-style scripting alone? Not really. Any computations that can be done with Ethereum smart contracts can be done on Bitcoin, just at a higher layer.</p><p>And this is the crux of the problem. Ethereum is solving problems at the wrong layer and by doing so, needlessly bloating its core design.</p><p>Kicking the can down the road and hope difficult problems resolve by themselves is not a solution either. <a href="https://en.wikipedia.org/wiki/Shard_(database_architecture)">Sharding</a> is not the solution, as sharding implies scaling down the level of broadcast communication — which is <em>a feature in the context of blockchains</em>, not a bug!</p><p>Pinning all hope on sharding as the magical cure-all typifies Ethereum’s attitude towards engineering: Hopium.</p><p>Ethereum’s problems are even more serious if you consider that Bitcoin, despite it being extremely conservative towards the type of data and growth of data it handles, still has very real chance of failure. IMHO, Bitcoin is very much still an experiment.</p><p>If you’ve read my recent article on <a href="https://medium.com/@hugonguyen/bitcoins-incentive-scheme-and-the-rational-individual-dc20effa4715">Bitcoin’s incentive-scheme</a>, you’ll notice that I’ve left a few questions open-ended which I still don’t know the answers to. I’m optimistic on Bitcoin, but cautiously optimistic.</p><p>To recap: Bitcoin is already stretching things to the limits to get something useful. Despite this its success is not guaranteed. Ethereum stretches things out much further, without having good justifications. Ethereum’s architecture is flawed from the get-go for this reason.</p><p>A few more words on the engineering side of things. The story of Ethereum is actually not uncommon. We’ve seen this movie before:</p><ul><li>RISC vs. CISC in the 70s</li><li>Linux vs. Windows in the 90s</li></ul><p>In these episodes we’ve learned that hardware and software work best when they are built as modular, simple layers, exemplified by RISC and Linux (another example is TCP/IP). The reason is that these systems tend to be more flexible, more elegant and can adapt easier to changing environments / use cases.</p><p>This insight is immortalized in the <a href="https://en.wikipedia.org/wiki/Unix_philosophy">Unix design philosophy</a>: “Flexibility, simplicity, and freedom are the foremost considerations”.</p><p>The Unix design philosophy also gets a vote of confidence from nature. Ant colonies exhibit emergent intelligence even though individually the ants are dumb and highly specialized. Similarly, our brain is composed of simple neurons that individually perform simple tasks.</p><p>Ethereum’s kitchen-sink approach at the core layer bears resemblance to the idea of a complex instruction set. Or the idea of building software out of big, complex components, instead of smaller and more specialized ones. Complexity for complexity’s sake, not through emergence.</p><p>In summary, Ethereum has questionable design decisions without strong justifications for them. We’ve also seen similar engineering mistakes to Ethereum before. My guess is that Ethereum will eventually be another lesson of what-not-to-dos in the history book.</p><h3>Notes</h3><ul><li>I use “blockchain systems” to refer to Bitcoin-like blockchains that are based on Proof-of-Work.</li><li>Additional reading: Gregory Maxwell explained verification-not-computation <a href="https://bitcointalk.org/index.php?topic=1427885.msg14601127#msg14601127">here</a>. Below is a snippet.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*syD1HGiDSUy06_XCexVcIA.jpeg" /></figure><p>Bob McElrath also described the problem <a href="https://twitter.com/BobMcElrath/status/1078997712840937472">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4eefd15db3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitcoin: Two Parts Math, One Part Biology]]></title>
            <link>https://hugonguyen.medium.com/bitcoin-two-parts-math-one-part-biology-b45ef48a0422?source=rss-3efc6d31e61c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b45ef48a0422</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[incentives]]></category>
            <category><![CDATA[genesis-block]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[proof-of-work]]></category>
            <dc:creator><![CDATA[Hugo Nguyen]]></dc:creator>
            <pubDate>Thu, 03 Jan 2019 07:16:22 GMT</pubDate>
            <atom:updated>2019-08-24T02:02:07.345Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“The Times 03/Jan/2009 Chancellor on brink of second bailout for banks”</blockquote><p>Ten years ago today Satoshi Nakamoto immortalized these words by embedding them in Bitcoin’s very first block — the genesis block. They are a solemn reminder of the unfair and broken system we all live under, and likely the reason Satoshi created Bitcoin in the first place: to wrest control of money back from governments and central bankers [1].</p><p>The last 10 years has been nothing short of a miracle. The Bitcoin network has been up 24/7, boasting an impressive record of 99.98% <a href="http://bitcoinuptime.com/">uptime</a> [2]. What is most amazing is that Bitcoin achieved this without anyone being in control.</p><p>Bitcoin is a unique invention because it uproots the very foundation of our society: it redefines money. Money, together with language, are considered the 2 most important tools we humans use to cooperate and build civilizations.</p><p>My personal journey into Bitcoin has also been extremely rewarding. Very few things are as intellectually stimulating as Bitcoin. Grokking Bitcoin means going down the rabbit hole that is finance, money, history, economics, computer science and biology. It means retracing the footsteps of giants such as Cardano, Pascal, Turing, Plato &amp; Aristotle, Locke, Hume, Adam Smith, Nash, Kahneman &amp; Tversky, Darwin, John Maynard Smith, Dawkins, Diffie, Hellman &amp; Merkle, Szabo, to name a few. It means asking fundamental questions about the nature of the world we live in — much of which we often take for granted.</p><p>Over the last several months I have written a series of articles — which I have called the Bitcoin Fundamentals series. My goal is to go down the rabbit hole as far as I could, to see what Bitcoin is really made of.</p><p>Writing these concepts down also forces me to articulate my thinking and helps my understanding of Bitcoin. I hope they will help others as well. The rest of this article will sum up what we have learned in the series.</p><p>Full index of the series:</p><ul><li><a href="https://bitcointechtalk.com/the-anatomy-of-proof-of-work-98c85b6f6667">Part 1 - The Anatomy of Proof-of-Work</a></li><li><a href="https://medium.com/@hugonguyen/bitcoin-chance-and-randomness-ba49a6edf933">Part 2 - Bitcoin, Chance and Randomness</a></li><li><a href="https://medium.com/@hugonguyen/how-cryptography-redefines-private-property-34cd93d86036">Part 3 - How Cryptography Redefines Private Property</a></li><li><a href="https://medium.com/@hugonguyen/bitcoins-incentive-scheme-and-the-rational-individual-dc20effa4715">Part 4 - Bitcoin’s Incentive Scheme and the Rational Individual</a></li><li>Part 5 - Bitcoin: Two Parts Math, One Part Biology (this article)</li></ul><h3>The three sublayers of Bitcoin</h3><p>Bitcoin is composed of 3 fundamental building blocks:</p><p>(i) Randomness-based Proof-of-Work</p><p>(ii) Public-key cryptography</p><p>(iii) Incentive scheme</p><p>If we consider Bitcoin as a base layer upon which further layers can be built upon (such as the Lightning Network, TumbleBit or sidechains), then these building blocks can be viewed as sublayers within the base layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*9Qk1ByPWR94ul0d-gkIARA.png" /><figcaption>The 3 sublayers of Bitcoin base protocol</figcaption></figure><p>There is an implicit hierarchy among these sublayers. That is:</p><p><strong>Sublayer 1</strong>: Proof-of-Work (PoW) forms the first sublayer. PoW approximates energy burnt and is the bridge between the digital world and the physical world. PoW gives digital blocks — which are just strings of 1s and 0s — real-world significance. With PoW, the Bitcoin ledger becomes an unforgeable and costly asset, with real weight behind it.</p><p><strong>Sublayer 2</strong>: Public-key cryptography (PKC) forms the second sublayer. If PoW enables a new digital asset, then PKC and specifically digital signatures “tokenize” that asset, chopping it into pieces. Individuals can then store these pieces privately and exchange them with each other.</p><p><strong>Sublayer 3</strong>: Finally, Bitcoin’s incentive scheme forms the third sublayer, which sustains the system created by sublayers 1 and 2. Bitcoin is a dynamic network. It resembles a living organism whose heart beats roughly every 10 minutes. Bitcoin’s incentive scheme provides the engine for this heartbeat, and is built on the token natively generated by sublayer 2.</p><p>Sublayer 2 wouldn’t matter without sublayer 1. Sublayer 3 wouldn’t matter without sublayers 1 and 2.</p><p>These sublayers together form the three-legged stool that is the foundation of the entire Bitcoin ecosystem. [3][4]</p><h3><strong>Two Parts Math, One Part Biology</strong></h3><p>From the exploration in the series, we have also learned that under the hood:</p><ul><li>Randomness-based PoW is based on math</li><li>Public-key cryptography is also based on math</li><li>Incentive scheme is based on human behavior</li></ul><p>It can be said then, that Bitcoin is two parts math, one part biology.</p><p>It’s worth noting that both randomness-based PoW and PKC rely on the same mathematical concept underneath, namely <a href="https://en.wikipedia.org/wiki/One-way_function">one-way function</a>, but they form very distinct parts of the system. PoW creates the digital asset, while PKC tokenizes it.</p><p>The third sublayer of Bitcoin, incentive scheme, is arguably Bitcoin’s weakest link. Unlike the first 2 sublayers, it relies on human behavior, which is less consistent and rigorous than mathematical principles. Human behavior exhibits <a href="https://en.wikipedia.org/wiki/Bounded_rationality">bounded rationality</a>, which is coded at the gene level, but imperfect. Humans are prone to miscalculations and occasional irrational behavior.</p><p>It remains to be seen whether Bitcoin’s incentive scheme would be strong enough to hold the network together for the long term.</p><h3>Final Words</h3><p>I would like to close out the series by saying that in no way does this constitute a complete understanding of Bitcoin. But I hope it will serve as a good starting point for someone who is new to Bitcoin. Some of the content in this series are my own personal opinions. The reader would do well to do his or her own research and form their own opinions. “Don’t trust, verify” works equally well in Bitcoin and in learning.</p><h3>Acknowledgements</h3><p>Special thanks to <a href="https://medium.com/u/a063100e6515">Nic Carter</a>, <a href="https://medium.com/u/6b2bf8e09e20">Steve Lee</a>, <a href="https://medium.com/u/4acb12744ff8">Jimmy Song</a>, <a href="https://medium.com/u/90326a938400">Hasu</a>, <a href="https://medium.com/u/e1c7b66721d6">Murad Mahmudov</a> and <a href="https://medium.com/u/405d30706535">Dan Held</a> for their extremely valuable feedback in the writing of this series.</p><p><em>[1] The genesis message also doubled as proof that Satoshi did not unfairly premine before January 3rd, 2009.</em></p><p><em>[2] Bitcoin has experienced </em><a href="https://www.reddit.com/r/Bitcoin/comments/8d4fp3/bitcoin_has_worked_non_stop_for_9_years_without"><em>a dozen hours</em></a><em> of “downtime”: a combined total of 77 blocks where the network accidentally split, from 2 incidents in 2010 and 2013. This record is as impressive if not better than that of AWS, Google Cloud and Microsoft Azure.</em></p><p><em>[3] The term “cryptocurrency” derives from the use of public-key cryptography (sublayer 2), which ironically captures only one of many crucial aspects of this technology.</em></p><p><em>[4] These are the high-level building blocks. In practice the high-level building blocks are implemented using even smaller blocks. This includes hardware devices, software components, and communication protocols such as TCP/IP — each one bringing their own unique set of challenges.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b45ef48a0422" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitcoin’s Incentive Scheme and the Rational Individual]]></title>
            <link>https://hugonguyen.medium.com/bitcoins-incentive-scheme-and-the-rational-individual-dc20effa4715?source=rss-3efc6d31e61c------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc20effa4715</guid>
            <category><![CDATA[incentives]]></category>
            <category><![CDATA[rationality]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[bounded-rationality]]></category>
            <dc:creator><![CDATA[Hugo Nguyen]]></dc:creator>
            <pubDate>Mon, 24 Dec 2018 09:47:48 GMT</pubDate>
            <atom:updated>2023-08-30T13:54:42.919Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*RPBSdmDV_cNMhBMbGvm4PA.jpeg" /></figure><p>Unlike Proof-of-Work and Public-Key Cryptography, the third component of Bitcoin is not based on math, but human behavior. Specifically, Bitcoin relies on a system of financial incentives and people chasing these incentives to sustain itself.</p><p>That sounds a bit scary, and a sharp shift from the strong mathematical foundation that underlies most modern technologies, such as the computer or artificial intelligence. If we have learned anything from history, it is that humans are not always predictable. We are, after all, biological creatures made up of “wet” matter. We’re not like “dry”, cold-hearted machines who can calculate things accurately or consistently. We change our mind in a heartbeat. Not only that, we constantly bicker, and hardly seem to be able to agree on anything.</p><p>So <strong>how can we create a technology out of fickle human behavior?</strong> Bitcoin’s 10-year track record is evidence that perhaps we can, and this aspect of Bitcoin is as innovative as the novel uses of Proof-of-Work and Public-Key Cryptography, which we explored in-depth in the first 3 parts of the series.</p><p>Bitcoin’s incentive scheme relies on the assumption that people are <em>rational</em> actors. If people are rational, they would be incentivized to participate in mining, buying and holding Bitcoin. The concept of rationality is incredibly important, but often taken for granted, so it’s worth a background discussion.</p><h4>Economic Rationality</h4><p>In economics, the definition of <a href="https://www.britannica.com/topic/economic-rationality">rationality</a>, or the <em>economically-rational individual</em>, has been a topic of great debate, and economists still disagree on the precise definition. At the heart of economic rationality however is the central premise that individuals act to maximize their expected utility. That is, when presented with several choices, individuals will choose the one that they think will make them the happiest, i.e., maximizing net benefit, which is equal to total benefits minus total costs. This is known as the <a href="https://en.wikipedia.org/wiki/Expected_utility_theory">Expected Utility Theory</a>.</p><p>Gabriel Cramer and Daniel Bernoulli gave birth to the idea in the 18th century, and it gained in importance as time went by. Nowadays, Expected Utility Theory dominates the field of economics and is widely used in many economic models and real-life policies.</p><p>Towards the later half of the 20th century however, doubts started to creep in: do people actually behave like economically-rational individuals, as described by the Expected Utility Theory?</p><p>When the choices and consequences are clear and measurable, we have little problem in making optimal decisions. But when the choices are complex, consequences less clear, less measurable, we can be wildly off the mark. And real-world situations are typically of the latter type. So perhaps humans are rational, but due to limited information and our own cognitive limitations, we can only be rational up to a certain point.</p><p>Put another way, humans are only rational when the math involved is relatively simple. This is the idea of “<a href="https://en.wikipedia.org/wiki/Bounded_rationality">bounded rationality</a>”, which Herbert Simon introduced in 1950s.</p><p>Going further, Daniel Kahneman and Amos Tversky, observing that irrational behavior is actually quite common and non-random, created what they termed the <a href="https://en.wikipedia.org/wiki/Prospect_theory">Prospect Theory</a> in their <a href="https://scholar.princeton.edu/sites/default/files/kahneman/files/prospect_theory.pdf">seminal paper</a> in 1979. Prospect Theory describes several systemic biases — such as <a href="https://en.wikipedia.org/wiki/Loss_aversion">loss aversion</a> — in human behavior, which often cause us to act irrationally.</p><p>Prospect Theory became the foundation of the new field of Behavioral Economics. It also started a movement towards a better way of doing economics: theories that are based less on abstract, <a href="https://plato.stanford.edu/entries/rationality-normative-utility">normative</a> ideas, and more on hard evidence and data.</p><h4>Rational Behavior: Biological Roots</h4><blockquote>“We are survival machines — robot vehicles blindly programmed to preserve the selfish molecules known as genes.”<br>“Prediction in a complex world is a chancy business. Every decision that a survival machine takes is a gamble, and <strong>it is the business of genes to program brains in advance so that on average they take decisions that pay off</strong>. The currency used in the casino of evolution is survival, strictly gene survival, but for many purposes individual survival is a reasonable approximation.” — Richard Dawkins [1]</blockquote><p>Rationality might also have roots in biology, especially if you view survival of the fittest as competition at the gene level and not at the individual level [2]. This is also known as the <a href="https://en.wikipedia.org/wiki/Gene-centered_view_of_evolution">Selfish Gene Theory</a>, developed by John Maynard Smith, W.D. Hamilton and Richard Dawkins, among others. The Selfish Gene Theory postulates that DNA is the main means of information transfer between generations and over time, populations will move towards <a href="https://en.wikipedia.org/wiki/Evolutionarily_stable_strategy">evolutionarily stable strategy</a>.</p><p>Because the world has very limited amount of resources and because each of us is wired biologically to survive and pass on our genes, we are bound to compete for these resources. That means that all else being equal:</p><ul><li>When the opportunity to extract gains (material or non-material) presents itself, our default mode of behavior is to take it to maximize our chance of survival, in the face of future uncertainty.</li><li>When two or more such opportunities arise, we will take the one that gives us more gains, provided that the gains can be accurately measured. Again, this is so that we maximize our chance of survival, in the face of future uncertainty.</li></ul><p>This is similar to Expected Utility Theory, only rephrased from the evolutionary standpoint.</p><p>In reality, measurement of gains are subjective and only transferable between individuals under a common Unit-of-Measurement (UoM), such as prices in dollar or gold. In the case of <a href="https://en.wikipedia.org/wiki/Prisoner%27s_dilemma">Prisoners’ Dilemma</a> for example, the UoM is the number of years in prison. Difficulty arises when there is no consistent UoM or UoMs are not easily convertible, e.g., how much money is worth staying one year in prison?</p><p>So rationality, even if coded at the gene level, is likely very rough heuristics. Genes, after all, can’t make worldly information suddenly more available, or reduce the complex math inherent in the natural world. But genes can ensure a basic high-winning-percentage strategy: to program us to take resources in a resource-constrained world. You might end up taking more than you need, but it is better to err on the side of your action being <em>maybe</em> unnecessary, than being <em>for sure</em> sorry the next day.</p><h4>Bitcoin’s Incentive Scheme</h4><p>Above we have established that human behavior, although fickle and suffers from systemic biases, likely exhibits bounded rationality, coded at the gene level. The simpler the problem and the simpler the math involved, the more likely we will make the optimal, rational decision.</p><p>As it occurs, Bitcoin’s incentive scheme mostly falls into this category. What is Bitcoin’s incentive scheme?</p><p>(a) <strong>Fixed supply</strong>:<strong> </strong>There can be no more than <a href="https://satoshi.nakamotoinstitute.org/posts/bitcointalk/46/">21 million bitcoins</a> ever.</p><p>(b) <strong>Mining subsidy</strong>: Bitcoins are <a href="https://en.bitcoin.it/wiki/Mining#Reward">created</a> each time a miner discovers a block. The number of bitcoins generated per block is set to decrease geometrically, with a 50% reduction every 210,000 blocks, or approximately four years. As of this writing (Dec 2018), the current subsidy is 12.5 bitcoins per block.</p><p>(c) <strong>Transaction fees</strong>: Users include <a href="https://en.bitcoin.it/wiki/Miner_fees">transaction fees</a> in their transactions as payment to miners for processing those transactions. Transaction fees follow the market forces of supply and demand. When blocks are full, fees are high. Vice versa, when blocks are empty, fees are at their lowest.</p><p>Let’s briefly go through each one and see how rationality plays a role in making these incentives work.</p><p>(a) A fixed supply is Bitcoin’s primary financial incentive. If successful, Bitcoin would be one of the scarcest assets ever existed — much scarcer than gold. All else being equal, if people are rational, they should prefer the scarcest asset to store value in, given a number of available assets.</p><p>(b) Mining subsidy is a temporary incentive, but it is essential to the initiation of Bitcoin. Bitcoin, as with most networks, had a chicken-and-egg problem: why should the first few people participate in an infant network when there were barely anyone else? Relying purely on non-profit-minded volunteers to support the network would be unsustainable. Bitcoin solved this problem by giving early adopters higher amounts of rewards, in the form of subsidy. If people were rational, and estimated Bitcoin to have <em>any</em> chance of success, then the subsidy should serve as a strong enough incentive to overcome the initial risks and uncertainty associated with Bitcoin mining. The subsidy bought Bitcoin time until it is strong enough to protect itself from external attacks. This was also the fairest way to distribute bitcoins: by giving them to people who most strongly believed in and contributed to the project when no one else did. However, mining subsidy is irrelevant in the long run, past the bootstrapping stage.</p><p>(c) Transaction fees are Bitcoin’s true second main incentive. As stated, in the long run Bitcoin has to remove mining subsidy altogether in order to not violate the scarcity incentive from (a). As Satoshi <a href="https://satoshi.nakamotoinstitute.org/posts/bitcointalk/57">put it</a>: “In a few decades when the reward gets too small, the transaction fee will become the main compensation for nodes.”</p><p>If transaction fees are high enough, and people are rational, there should be a healthy mining industry to keep the network secure. Worth noting that due to transaction fees being a <a href="https://twitter.com/hugohanoi/status/1004875492128768000">highly variable factor</a> — which is a stark contrast to the predictability of a fixed supply and fixed inflation schedule — the math involved in calculating opportunity costs of pursuing transaction fees is more complex. Bitcoin’s transition to a fee-driven model is untested, and it remains to be seen whether the transition would happen smoothly.</p><p>So we see how Bitcoin’s sustainability greatly depends on rational human behavior at the core. This is a crucial point and an aspect where Bitcoin is inferior to gold, the previous standard of sound money. If people choose to stop using gold as money (perhaps irrationally), gold is fine. It would still exist in nature, and could make a comeback as money centuries later. If people choose to stop using or mining Bitcoin (perhaps irrationally), it will need to be bootstrapped later, or might fail to be bootstrapped ever again.</p><p>In return for this inferiority, Bitcoin is superior to gold in <a href="https://medium.com/@vijayboyapati/the-bullish-case-for-bitcoin-6ecc8bdecc1">almost all other departments</a> desirable for a monetary asset, e.g., transferability and portability.</p><h4>Side Note: Development Incentive</h4><p>Since Bitcoin exists as software and requires active development and maintenance [3], a few words are warranted on the issue of development incentive. Since this issue is more about resource allocation than the creation of digital scarce money itself, feel free to skip this section. Development incentive in general is orthogonal to Bitcoin’s incentive scheme as described above.</p><p>Unlike miners, developers do not have a direct financial incentive in the protection and development of Bitcoin. Instead, Bitcoin software development relies on a voluntary <a href="https://en.wikipedia.org/wiki/Open-source_software">open-source-software</a> system — where developers who are most philosophically-aligned with the cypherpunk ethos of Bitcoin are motivated to work on it on their own free time. This might seem inefficient, and perhaps due to the success of Bitcoin’s incentive scheme so far, several altcoins have been trying to address this problem by adding development incentive to their protocols.</p><p>However, in-protocol development incentive is highly challenging. The reason is that it is very different to Bitcoin’s original incentive scheme, which has some very special properties:</p><ul><li>The common goal can be <strong>mathematically-defined</strong>: miners get paid for a hash that is smaller than or equal to the current difficulty target.</li><li>The common goal is <strong>computationally-verifiable</strong>: miners’ work towards the goal is verifiable by anyone, cheaply; and miners only get rewarded after the fact.</li></ul><p>This makes Bitcoin’s incentive scheme <em>automatable</em>. That is, it doesn’t need any human intervention to work, and can exist safely as fixed rules within the protocol. In general, in-protocol incentives make sense if the goals can be mathematically-defined and computationally-verifiable.</p><p>Development goals, however, are often highly fuzzy [4], neither mathematically-defined nor computationally-verifiable. For example, a typical development goal is to scale Bitcoin to handle twice the traffic without degrading overall network security or Bitcoin’s essential attributes. However, opinions differ wildly on what “network security” or Bitcoin’s “essential attributes” mean. These goals, even if somehow met, are hard to be verified or verified cheaply. Ultimately what that means is that these goals require subjective human inputs. Thus, they are poor candidates to be built into the protocol, adding overhead without being necessarily beneficial. Development incentive is better off being handled off-chain.</p><p>In summary, Bitcoin is unlike any other technologies ever created in that human behavior is one of its core moving parts. It is the first of its kind.</p><p>Bitcoin’s reliance on human behavior implicitly assumes that humans are rational actors. This rationality assumption might break down in certain situations, such as when information is limited, or when the opportunity costs calculations become too complex. Or within a community of Buddhist monks who were trained from birth to reject material gains. Or imagine a world where resources are infinitely abundant: it’s likely that the beings there will develop behavior not wired to compete or maximize utility [5].</p><p>Despite that, there is strong evidence that we humans do possess some degree of rationality, or at least a bounded version of rationality. It is this bounded rationality that Bitcoin’s survival hinges on. Bitcoin needs rational actors to bootstrap its network. Bitcoin needs rational actors to buy into its promise of sound money, <a href="https://en.bitcoinwiki.org/wiki/Hodl">HODL</a> at all costs, and consequently raise its price. Bitcoin needs rational actors to keep participating in mining and sustain the network for the next 100-1000 years. Can we, and future generations, stay rational at all times and forever? Or would we be foolish and prematurely abandon this idea, no matter how sound it is?</p><p><em>*This is part 4 of the Bitcoin Fundamentals series. Check out the full series here: </em><a href="https://bitcointechtalk.com/the-anatomy-of-proof-of-work-98c85b6f6667"><em>part 1</em></a><em>, </em><a href="https://medium.com/@hugonguyen/bitcoin-chance-and-randomness-ba49a6edf933"><em>part 2</em></a><em>, </em><a href="https://medium.com/@hugonguyen/how-cryptography-redefines-private-property-34cd93d86036"><em>part 3</em></a><em>, </em><a href="https://medium.com/@hugonguyen/bitcoins-incentive-scheme-and-the-rational-individual-dc20effa4715"><em>part 4</em></a><em>, and </em><a href="https://medium.com/@hugonguyen/bitcoin-two-parts-math-one-part-biology-b45ef48a0422"><em>part 5</em></a><em>.</em></p><h4>Acknowledgements</h4><p>Special thanks to <a href="https://medium.com/u/e1c7b66721d6">Murad Mahmudov</a>, <a href="https://medium.com/u/a063100e6515">Nic Carter</a> and <a href="https://medium.com/u/6b2bf8e09e20">Steve Lee</a> for their extremely valuable feedback.</p><p><em>[1]: </em><a href="https://www.amazon.com/Selfish-Gene-Popular-Science/dp/0192860925"><em>The Selfish Gene</em></a><em>, by Richard Dawkins.</em></p><p><em>[2]: “Some research suggests there is a genetic basis for greed. It is possible people who have a shorter version of the ruthlessness gene (AVPR1a) may behave more selfishly; </em><a href="https://www.nature.com/news/2008/080404/full/news.2008.738.html"><em>Ruthlessness gene discovered</em></a><em>.” (</em><a href="https://en.wikipedia.org/wiki/Greed"><em>Wikipedia</em></a><em>). Also see </em><a href="http://archive.boston.com/bostonglobe/ideas/articles/2012/05/13/webhed_are_we_born_to_be_poor_the_rise_of_genoeconomics/?page=full"><em>related work</em></a><em> on the burgeoning field of Genoeconomics.</em></p><p><em>[3]: Recently a consensus-critical bug, </em><a href="https://bitcoincore.org/en/2018/09/20/notice/"><em>CVE-2018–17144</em></a><em>, has been discovered then quickly fixed in Bitcoin. If it was exploited, some Bitcoin nodes could have been tricked into accepting a block that inflates the supply beyond 21 million bitcoins. This event highlights the difficult nature of software development, despite the quality of development team (read my analysis of that bug </em><a href="https://medium.com/@hugonguyen/code-reusability-vs-accidental-commonness-89e2b2b007cd"><em>here</em></a><em>). There is also a good chance that the Bitcoin protocol will get ossified at some point in the future, which lessens the need for active development, if not completely removes it (i.e.: critical bugs might still need to get fixed).</em></p><p><em>[4]: The fuzzy nature of software requirements and difficulty in writing precise “specs” are problems well-known within the software industry.</em></p><p><em>[5]: Note that in this last example one can argue that this behavior is not really irrational in that context. However we are using “rationality” loosely here to mean utility maximization, not necessarily about being based on logic or reason.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc20effa4715" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Cryptography Redefines Private Property]]></title>
            <link>https://hugonguyen.medium.com/how-cryptography-redefines-private-property-34cd93d86036?source=rss-3efc6d31e61c------2</link>
            <guid isPermaLink="false">https://medium.com/p/34cd93d86036</guid>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[private-property]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[property]]></category>
            <dc:creator><![CDATA[Hugo Nguyen]]></dc:creator>
            <pubDate>Tue, 27 Nov 2018 00:30:35 GMT</pubDate>
            <atom:updated>2019-01-03T14:08:09.613Z</atom:updated>
            <content:encoded><![CDATA[<p>Cryptography is the art of protecting and breaking secrets. Bitcoin employs a special type of cryptography, called <a href="https://en.wikipedia.org/wiki/Public-key_cryptography">public-key cryptography</a>, in order to facilitate its system of storing and transferring of value. It is through this mechanism that Alice can keep her bitcoins secure or send some of them to Bob, or that <a href="https://www.mycryptopedia.com/coinbase-transaction-explained/">coinbase rewards</a> are issued to the miners. The term “cryptocurrency” derives its name from this usage. In this third part of the Bitcoin Fundamentals series, we will explore the pivotal role public-key cryptography plays in the creation of digital hard money, as well as its ramifications on society at large.</p><p>To fully understand the significance of public-key cryptography, we must first take a few steps back and understand how our society is principally organized around the concept of property.</p><h3><strong>What is Property?</strong></h3><blockquote>Property never has been abolished and never will be abolished. It is simply a question of who has it. And the fairest system ever devised is one by which all, rather than none, [are] property owners. — A. N. Wilson</blockquote><p>Property has wide-ranging definitions. The idea of what constitutes property often changes to reflect contemporary beliefs and circumstances. For example, early discussions of property almost always exclusively referred to land. Since it was mostly land that was the source of constant conflicts and struggle for power, it was natural that land occupied the minds of ancient thinkers. Later, as society develops, property was expanded to include intangible assets such as patents and copyrights, and then expanded again to encompass all things deemed necessary for life and liberty.</p><p>Formally speaking, property is a legal concept defined and enforced by <a href="https://en.wikipedia.org/wiki/Property#Overview">a local sovereignty</a>. The specific implementation varies greatly depending on the political system, from monarchy to communism to democracy, among others.</p><p>Discussions on property dated back to Greek civilization. Plato and Aristotle, the two fathers of Western philosophy, laid much of the groundwork for the fierce and at times extremely bloody debates that followed in the subsequent 2,500 years.</p><p>Plato, likely inspired by the Spartans, was against private property of all sorts, including men’s wives and children. He rejected the idea of “mine” and “not mine”, “his” and “not his”. According to him, private property corrupts the human soul: it fosters greed, jealousy and violence. An ideal Platonic society would eradicate private property entirely. This school of thought was later developed into a full-fledged system, most notably by Karl Marx, the father of communism.</p><p>Aristotle, Plato’s best student, had other ideas. Aristotle rejected Plato’s argument that common property would remove vices and violence, arguing that people who share stuff tend to fight more than those who own them personally. Aristotle also believed that private ownership is crucial to progress because people would only be incentivized to work hard for the things they own. Furthermore, only when private property rights are respected, people can have the opportunity to fully grow and afford to be virtuous. As the late historian Richard Pipes eloquently put it: “Human beings must have, in order to be.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VAJUWiuxvM6oBR3jM0iaDg.jpeg" /><figcaption>Plato (427–347BC) and Aristotle (384–322BC)</figcaption></figure><p>Plato’s central argument against private property rested on morality. Aristotle also responded to Plato on the ground of morality. But some of Aristotle’s arguments went beyond morality and into the realm of economic reality. (Interestingly, like his teacher, Aristotle was <a href="https://mises.org/library/aristotle-private-property-and-money">against trade and profit-seeking</a>, so he did not develop a consistent economic framework.)</p><p>The discussions on property since Plato &amp; Aristotle have evolved to include mainly four aspects: morality, politics, psychology, and economics [1]. Among these, psychological and economical arguments for private property probably bear the most weight, since they address the world as it is, not how it should be.</p><p>One of the fundamental questions regarding property is that <strong>between property and sovereignty, which comes first?</strong></p><p>Some influential thinkers, such as Harrington &amp; Locke, believed that property predated sovereignty. They believed humans intuitively understand property, even without the existence of a state.</p><p>To them the primary function of a state is to protect property rights. A sovereign state is judged on its merits to fulfill this responsibility. Locke went further and stated that individuals have the right to rebel against the state if it fails in its duty to preserve property rights. Adam Smith, the father of capitalism and modern economics, had a similar view. Smith recognized that property and government were dependent on each other, and argued that “civil government could not exist without property, as its main function is to safeguard property ownership”. (Smith differed with Locke, however, on whether property rights are “natural” — he believed property rights are “acquired” rights, not “natural” rights).</p><p>In contrast, other thinkers, most prominently Hobbes, believed it was the opposite, that property is a creation of the state. He regarded property simply as the product of authority and the acceptance of that authority [2].</p><p>There has been mounting evidence, particularly in the later half of the 20th century, that vindicated Harrington’s &amp; Locke’s view. The 20th century saw a large-scale social experiment in attempting to abolish private property via the spread of communism. This experiment resulted in the Cold War and numerous proxy wars across the globe, culminated in the Cuban Missile Crisis in 1962, and ended dramatically when the Soviet Union finally collapsed in 1991. Following this collapse, the remaining communist states were split into two camps. Some switched to capitalism, as many Central &amp; Eastern European countries did. Some retained only a nominal form of communism, as China &amp; Vietnam did — in these countries the political regime purports to represent the “bourgeois”, but the economy functions much like that of a capitalist state. Almost all surviving communist states have adopted free-market ideology, and were forced to respect property rights (to a certain extent) in order to survive.</p><p>In summary, what the 20th century has shown us is that governments that failed in their primary role of protecting property ended up either dead or forced to eventually respect private property. This proves that the state is subservient to, and is a derivative of, property needs, not the other way around. Property, by and large, comes before the state.</p><p>Despite this, in the short to medium term, individuals do have to depend on the state for preserving their property rights, and suffer a great deal when it fails to do so. We will see how cryptography can help break this cycle of dependency. But first, let’s quickly look at how modern cryptography came about.</p><h3><strong>Public-Key Cryptography</strong></h3><p>Until recently, the development of cryptography has been driven mainly by wars and rivaling states.</p><p>Prior to WW2, classical cryptography was more about obscurity than mathematical rigor. If there was any math involved, it was simply accidental. This changed with a couple of developments:</p><ul><li>The invention of the telegraph dramatically increased the amount of data that needed to be secured</li><li>The invention of the radio heightened the need to encrypt public communication channels, as opposed to relying on stealth methods</li><li>The invention of the computer brought incredible computational power to cryptanalysis; breaking codes became much easier</li></ul><p>These developments culminated in WW2 and saw the Allies heroically break Germany’s state-of-the-art cryptographic device, the Enigma machine, with notable help from Alan Turing. <a href="https://en.wikipedia.org/wiki/Cryptanalysis_of_the_Enigma">The breaking of Enigma</a> decidedly concluded the era of classical ciphers (a cipher is a particular method of doing encryption and decryption) and called on cryptographers to look for stronger ciphers — ciphers that are based on a more solid, mathematical ground.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BmRM383wPnY9BBrPX-COBA.jpeg" /><figcaption>End of an era: the Enigma machine — image by <a href="https://commons.wikimedia.org/wiki/User:LukaszKatlewa">LukaszKatlewa</a>, <a href="https://creativecommons.org/licenses/by-sa/3.0">CC 3.0</a></figcaption></figure><p>Luckily, there were hints for where to look. One major problem with classical ciphers was the problem of <a href="https://en.wikipedia.org/wiki/Key_distribution">secret keys distribution</a>—a problem common to all <a href="https://en.wikipedia.org/wiki/Symmetric-key_algorithm">symmetric ciphers</a> (symmetric ciphers are ciphers that use the same key for encryption and decryption). Basically, with symmetric ciphers, since it is not recommended to reuse secret keys, the number of keys that need to be distributed is proportional to the amount of data that need to be secured — which as mentioned, exploded at an unprecedented rate. As a result, one big research area at the time was to find ways to cheaply and securely distribute keys at scale. The insight for asymmetric ciphers began when a few cryptographers flipped this problem on its head and pondered: do we actually need to distribute the secret keys at all?</p><p>This research direction eventually narrowed the search down to <a href="https://en.wikipedia.org/wiki/One-way_function">one-way functions</a>, and it was not long until a brand new solution was found — one which does not require the distribution of secret keys. Diffie, Hellman &amp; Merkle discovered public-key cryptography, the first ever <em>asymmetric</em> cipher, in 1976. One year later, Rivest, Shamir &amp; Adleman published the first implementation, the now-famous <a href="https://en.wikipedia.org/wiki/RSA_(cryptosystem)">RSA algorithm</a>. Public-key cryptography was also independently discovered, but not implemented, a few years earlier by Ellis &amp; Cocks in Great Britain. However, Ellis &amp; Cocks’ research was classified and not publicly acknowledged for 27 years.</p><p>Thus, public-key cryptography, today considered the greatest cryptographic achievement in two thousand years, was born. It took several decades for this technology to filter down to the masses, largely thanks to the efforts of the <a href="https://en.wikipedia.org/wiki/Cypherpunk">cypherpunk</a> movement. The cypherpunks, foreseeing that the state’s monopoly on this new technology creates a huge imbalance of power and a potential threat to individual liberty, took incredible risks to bring public-key cryptography to civilians. When they successfully did, the gates were flung wide open. For the first time in history, individuals could afford encryption as strong as the military’s.</p><p>But it was not until the invention of Bitcoin that public-key cryptography realizes its full potential. Its application in digital hard money would redefine private property.</p><h3><strong>Privately-Owned Digital Goods: An Oxymoron?</strong></h3><p>The arrival of the personal computer and the Internet introduced a new asset class: <a href="https://en.wikipedia.org/wiki/Digital_goods">digital goods</a>. Digital goods are intangible digital <a href="https://en.wikipedia.org/wiki/Bit">bits</a> of information, packaged in various encoding formats. Examples are Wikipedia articles, MP3 files, software, etc.</p><p>Digital goods ushered in a new era of information-sharing never before seen. Any piece of information could be instantly reproduced and distributed at scale, at almost zero marginal cost.</p><p>However, early on digital goods did not significantly change the nature of private property. As it turns out, digital goods are notoriously bad at staying private.</p><p>The problem with trying to establish exclusive ownership over digital goods is that they are infinitely copyable. But that did not stop people from trying anyway. The state and businesses’ preferred method of imposing control over digital goods is through regulations. For example, the US created a complex <a href="https://www.state.gov/strategictrade/overview/">export control &amp; regulations</a> program to prevent secrets, particularly knowledge of advanced technologies, from leaking to other states. In business, the <a href="https://en.wikipedia.org/wiki/Music_industry">Big 3 music labels</a> and the <a href="https://en.wikipedia.org/wiki/Film_studio">Big 5 movie studios</a> spend a large amount of money lobbying for anti-piracy laws, and suing people for violations. Similarly, big software companies learn to build patent war chests. In the process they exploit the patent system and cripple smaller companies. At best, regulatory solutions at enforcing digital exclusivity are expensive and ineffective. At worst, they create an environment where a few players can <a href="https://en.wikipedia.org/wiki/Patent_troll">game the system</a> to their advantage.</p><p>Non-regulatory solutions are equally inefficient. One such example is <a href="https://en.wikipedia.org/wiki/Digital_rights_management">Digital Rights Management</a> (DRM), an access-control technology designed to restrict the use of digital goods. DRM does provide some basic level of security against piracy. However, DRM suffers from a fatal flaw: the security only needs to be bypassed once, and there would be no recourse.</p><p>One area where we saw limited success at creating digital exclusivity came from the gaming industry. Game creators figured out that if they could create <a href="https://en.wikipedia.org/wiki/Virtual_goods">virtual goods</a> (a subset of digital goods) within the games they designed, these goods could serve to add to the gameplay, as well as a nice bonus source of revenue. Since the game creators control 100% of the environment within which these virtual goods operate, they could impose restrictions on them that are not possible otherwise, including making them inaccessible or rare. However, in-game virtual goods have limited application, and game users are dependent on the game creators to not change the game rules.</p><p>So it might have seemed like digital goods and private property are at odds. If something is digital, it is almost impossible for it to be private or for someone to have sole possession of it. <em>Privately-owned digital goods</em> sounds like an oxymoron.</p><p>The inability to exclusively own digital goods means that everyone can take advantage of them. Individuals can use them to empower themselves, but the state is also able to become more powerful through data collection, surveillance, and propaganda — all made easier with digital goods. Digital goods, in their pure form, do not change the power structure between the individuals and the state.</p><p>But there is a way for digital goods to become private property, only if we can overcome 2 major hurdles:</p><ul><li><strong>Scarcity</strong>: the ease of reproducing and redistributing digital goods in unlimited quantity is precisely what makes exclusive ownership difficult.</li><li><strong>Transferability</strong>: the ability to dispose of an asset by sale is a crucial component of ownership. Without this, ownership loses much of its power.</li></ul><p>It turns out that these two desired attributes are also <a href="https://nakamotoinstitute.org/shelling-out/#attributes-of-collectibles">the prerequisites of money</a>. If we are able to create a digitally-scarce, transferable digital good, not only this good could be privately owned, it would become a great store-of-value and ultimately a new form of money. Digital “<a href="https://en.wikipedia.org/wiki/Hard_currency">hard</a>” money.</p><p>Bitcoin solves both problems. Bitcoin creates digital scarcity by imposing a fixed supply on itself in software (a.k.a. consensus rule), and then protecting that consensus rule with a large amount of energy (in the form of <a href="https://en.bitcoin.it/wiki/Proof_of_work">Proof-of-Work</a>) through a decentralized network of <a href="https://en.bitcoin.it/wiki/Mining_rig">mining machines</a>. As long as mining is sufficiently decentralized, it would be nearly impossible to change this fixed supply rule or bring down the network. We discussed this key innovation in-depth in <a href="https://bitcointechtalk.com/the-anatomy-of-proof-of-work-98c85b6f6667">Part 1 of the series</a>.</p><p>The problem of transferability, on the other hand, can be solved by using public-key cryptography. Specifically, a unique application of public-key cryptography is to generate unforgeable <a href="https://en.wikipedia.org/wiki/Digital_signature">digital signatures</a>. The digital asset could be coupled with a public-private key pair. This single key pair could then generate as many digital signatures as needed, each one represents a piece of the underlying asset. These digital signatures effectively “tokenize” the asset, making it transferable between individuals [4].</p><p>In short, public-key cryptography, together with digital scarcity, have given us digital hard money. Digital hard money inherits all the strengths of digital goods: instant, borderless, and impossible to regulate or control. Most importantly, this digital hard money can be privately owned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3kU8AEVLfiqRqXY7m5j50Q.png" /><figcaption>Digital signatures using public-private key pair — image courtesy of Wikipedia, <a href="https://creativecommons.org/licenses/by-sa/4.0">CC 4.0</a></figcaption></figure><p>It is hard to overstate how big of a disruption this is.</p><p>For the first time in history, a form of private property exists that is completely independent of jurisdiction or the law [5]. Private keys and the bitcoins they control are private property <em>de facto</em>, not de jure.</p><p>Public-key cryptography’s application in digital hard money greatly changes the social contract that has bound human societies for thousands of years: that individuals need the state for the protection of property, and the state in turn needs individuals to finance its continued existence. One has to wonder, if securing property is the primary function of a state, then will its role — and power — be significantly reduced in a world run on digital hard money?</p><p>In summary, public-key cryptography’s application in digital hard money redefines private property and has the potential to uproot the very foundation of society as we know it. The consequences might take decades to play out, but when it happens, the impact will likely be incredibly far-reaching.</p><p><em>*This is part 3 of the Bitcoin Fundamentals series. Check out the full series here: </em><a href="https://bitcointechtalk.com/the-anatomy-of-proof-of-work-98c85b6f6667"><em>part 1</em></a><em>, </em><a href="https://medium.com/@hugonguyen/bitcoin-chance-and-randomness-ba49a6edf933"><em>part 2</em></a><em>, </em><a href="https://medium.com/@hugonguyen/how-cryptography-redefines-private-property-34cd93d86036"><em>part 3</em></a><em>, </em><a href="https://medium.com/@hugonguyen/bitcoins-incentive-scheme-and-the-rational-individual-dc20effa4715"><em>part 4</em></a><em>, and </em><a href="https://medium.com/@hugonguyen/bitcoin-two-parts-math-one-part-biology-b45ef48a0422"><em>part 5</em></a><em>.</em></p><h3>Acknowledgments</h3><p>Special thanks to <a href="https://medium.com/u/4acb12744ff8">Jimmy Song</a>, <a href="https://medium.com/u/90326a938400">Hasu</a>, <a href="https://medium.com/u/a063100e6515">Nic Carter</a> and <a href="https://medium.com/u/6b2bf8e09e20">Steve Lee</a> for their extremely valuable feedback.</p><p><em>[1]: </em><a href="https://www.amazon.com/Property-Freedom-Richard-Pipes-ebook/dp/B000XU4UI0"><em>Property and Freedom,</em></a><em> Richard Pipes</em></p><p><em>[2]: </em><a href="https://plato.stanford.edu/entries/property"><em>Property and Ownership</em></a><em>, Jeremy Waldon</em></p><p><em>[3]: </em><a href="https://www.amazon.com/Code-Book-Science-Secrecy-Cryptography/dp/0385495323"><em>The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography</em></a><em>, Simon Singh</em></p><p><em>[4]: It is very possible that public-key cryptography is the only way to tokenize a digital asset this way. Imagine implementing Bitcoin using a symmetric cipher.</em></p><p><em>[5]: Physical assets like gold can be and often is heavily regulated. For example, </em><a href="https://mises.org/library/great-gold-robbery-1933"><em>FDR outlawed &amp; confiscated private gold</em></a><em> during the Great Depression.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34cd93d86036" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Work is Timeless, Stake is Not]]></title>
            <link>https://hugonguyen.medium.com/work-is-timeless-stake-is-not-554c4450ce18?source=rss-3efc6d31e61c------2</link>
            <guid isPermaLink="false">https://medium.com/p/554c4450ce18</guid>
            <category><![CDATA[proof-of-stake]]></category>
            <category><![CDATA[time]]></category>
            <category><![CDATA[proof-of-work]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Hugo Nguyen]]></dc:creator>
            <pubDate>Fri, 12 Oct 2018 15:30:33 GMT</pubDate>
            <atom:updated>2018-11-04T18:31:42.069Z</atom:updated>
            <content:encoded><![CDATA[<p>Much has been written about Proof-of-Stake (PoS).</p><p>There are many ways to slice and dice PoS and uncover its weaknesses. Mainly:</p><p><strong>Evolutionary Psychology/History</strong>: “Collectibles” or “proto-money” in history all had one thing in common, <a href="https://nakamotoinstitute.org/shelling-out"><em>unforgeable costliness</em></a> [1] — or at least unforgeable costliness in the context of their times. From sea shells, furs, teeth, to precious metals to minted coins. As PoS merely involves the temporary lockup of existing capital and does not consume said capital, it does not satisfy the unforgeable costliness requirement that Nick Szabo identified as one of the 3 key properties of money.</p><p><strong>Economics</strong>: If an object has value, people will spend effort to chase it, up to whatever the object is worth (<a href="http://www.truthcoin.info/blog/pow-cheapest"><em>MC=MR</em></a>). This effort is also “work”. Paul Sztorc correctly concluded that PoS is an obfuscated form of PoW.</p><p>Work manifests in different ways in PoS, whether it is taking out a loan from the bank, running 24/7 staking servers, or attempting to steal online staking keys.</p><p>Not only PoS is obfuscated PoW, it is inferior PoW. Any potential cost saving PoS gives you, it pays back in <em>equal measure</em> in the reduction in security.</p><p>As we shall see below, a dollar [2] fleetingly locked up in staking creates nowhere near the same level of security as a dollar spent in mining.</p><p><strong>Computer Science</strong>: Andrew Poelstra wrote <a href="https://download.wpsoftware.net/bitcoin/pos.pdf">one of the first formalized critiques of PoS</a>, in which he coined the terms costless simulation (aka nothing-at-stake) and long-range attacks.</p><p>A <a href="https://arxiv.org/abs/1809.06528">recent paper</a> by Jonah Brown-Cohen, Arvind Narayanan &amp; co. also showed surprising barriers to having a good and reliable source of randomness in PoS protocols [3].</p><p><strong>Engineering</strong>: I myself have written a 2-part series [<a href="https://medium.com/@hugonguyen/proof-of-stake-the-wrong-engineering-mindset-15e641ab65a2">Part 1</a>] [<a href="https://medium.com/@hugonguyen/proof-of-stake-private-keys-attacks-and-unforgeable-costliness-the-unsung-hero-5caca70b01cb">Part 2</a>] looking at PoS weaknesses from the practical engineering perspective, and listed specific worst-case scenarios where PoS is particularly vulnerable: network partition, private keys theft, or low rate of participation in staking.</p><p>But perhaps one of the simplest ways to look at PoS is through the lenses of Time, which I alluded to in my series, but want to expand on here.</p><h3>Proof of Stake is Proof of Temporary Stake</h3><p>Proof-of-Stake is a misnomer. The correct, fully descriptive name for Proof-of-Stake should be Proof-of-Temporary-Stake (PoTS). This name is more accurate because it captures the time element, or lack thereof, of PoS.</p><p>To understand the effects of Time, let’s first analyze how Time plays a role in PoW.</p><p>The ongoing energy expenditure in PoW contributes to network security in 2 ways:</p><ul><li>Energy expended per block not only secures the UTXOs belonging in that block but also <a href="https://medium.com/@laurentmt/gravity-10e1a25d2ab2">retroactively secures all global UTXOs that occurred in past blocks</a>. The reason for this is because it would be impossible to revert past UTXOs without reverting the current block first. Each new block effectively “buries” all existing UTXOs under its weight.</li><li>Investment in specialized mining equipment, in essence, represents the <a href="https://medium.com/@hugonguyen/bitcoin-stock-flow-c4d4db98b751">potential stream of rewards earned in the future</a>, discounted back to the present. When a miner invests in a new piece of mining equipment, it is akin to buying a share of stock that pays regular dividends. What that means is that mining hardware in totality roughly represents potential energy expenditure of future blocks.</li></ul><p>One way to visualize this is to imagine a timeline. Units of work expended in the past <em>accumulate</em> in the ledger. Units of work expended in the future <em>accumulate</em> in the current mining hardware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*VCWgCW8hegFheUw3UjfUSw.png" /><figcaption>Ledger accumulates past work; Mining hardware accumulates future work.</figcaption></figure><p>As time moves forward, units of work on the right side materialize and move to the left side. Mining hardware can also be seen as a “buffer”, a place where units of work deposit before making their way to their final destination: the ledger [4].</p><p>The official term to describe this sort of time-based accumulation phenomenon is <em>stock &amp; flow</em>, which occurs often in nature. Bitcoin is essentially protected by high stock-to-flow ratios in 2 areas: the ledger, and the mining hardware. (<a href="https://medium.com/@hugonguyen/bitcoin-stock-flow-c4d4db98b751">Go here</a> for a detailed discussion of stock &amp; flow.)</p><p>In contrast, PoS has no equivalent of this.</p><p>Past stakes (left side of the timeline) do not accumulate in the ledger, as stake is released after some arbitrary bonding period [5]. Long-range attack is the manifestation of this weakness: it works because of PoS’s inability to secure the past. Long range attack is at the heart of the problems with PoS, because it shows that in the long run PoS fails to guarantee the integrity of the ledger — the most important asset of all this innovation.</p><p>Future stakes (right side of the timeline) also do not accumulate in the validators in the present time, as again the act of staking only has meaning within the short window that it occurs — what happens in the future does not count <em>today</em>. <a href="https://medium.com/@hugonguyen/proof-of-stake-private-keys-attacks-and-unforgeable-costliness-the-unsung-hero-5caca70b01cb">Current-private-keys-theft</a> is the manifestation of this weakness: it works because of PoS’s inability to secure the future. Keys theft sidesteps altogether the financial cost supposedly required to acquire controlling stake — whereas in PoW there’s no sidestepping the fact that an attacker needs to overcome the mining hardware and ongoing energy costs to pull off <em>and</em> sustain a majority attack [6].</p><p>(There is one form of accumulation in PoS. That is, the periodic staking rewards that accrue to the validators. However, unlike accumulation in PoW, rewards accumulation is only beneficial to the individual PoS validators, not to overall network security.)</p><p>In summary: the further one moves away from the present time in PoS, the faster stake loses its meaning, until stake becomes meaningless.</p><p>Work is robust against the ravages of time [7]. Stake is not.</p><p>The fact that the cost of PoW mining is irretrievably sunk and accumulates both in the ledger and the mining hardware, is an important feature, not a bug. PoS research is often based on the fundamental misconception that this is a bug and a source of inefficiency.</p><h3>Acknowledgments</h3><p>Special thanks to <a href="https://medium.com/u/9efdc740067f">Vijay Boyapati</a>, <a href="https://medium.com/u/8485c52f63d3">Bob McElrath</a>, <a href="https://medium.com/u/1852b393b452">LaurentMT</a>, <a href="https://medium.com/u/a063100e6515">Nic Carter</a> and <a href="https://medium.com/u/6b2bf8e09e20">Steve Lee</a> for their valuable feedback.</p><p><em>*Note: Another major criticism of PoS is that PoS pretty much guarantees a plutocracy system (rich getting richer). That is not discussed here as it is not related to security strength per se, and deserves its own separate discussion.</em></p><p><em>[1] Some might confuse unforgeable costliness with the </em><a href="https://en.wikipedia.org/wiki/Labor_theory_of_value"><em>labor theory of value</em></a><em>, but they are not the same thing. Energy cost alone is not enough, the asset must be unforgeable.</em></p><p><em>[2] Dollar is only used as a unit here for convenience, it could be any other unit of account.</em></p><p><em>[3] For a PoS currency, relying on an external source of randomness involves </em><a href="https://medium.com/@hugonguyen/feedback-loop-vs-circular-reasoning-1544ae7fd457"><em>circular reasoning fallacy</em></a><em>. Therefore it is highly desirable that PoS generates randomness internally, using the content of its own ledger. However, this proves to be a difficult problem that has its own trade-offs.</em></p><p><em>[4] Not all units of work make it all the way to the ledger. Some are thrown away, but even thrown-away work are necessary to keep the network decentralized.</em></p><p><em>[5] The concept of “</em><a href="https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQs#what-is-economic-finality-in-general"><em>finality</em></a><em>” does not change the (lack of) accumulation aspect of PoS, as new/long-dormant/partitioned nodes can see different “finalities”.</em></p><p><em>[6] Hardware seizure (e.g. by a state actor) is a risk in PoW, however this risk can be mitigated as long as mining is sufficiently decentralized. Disperse hardware, however, is not a defensive option for PoS, as PoS validators are just software nodes — which can be targeted from anywhere remotely. More importantly, even with seized hardware, an attacker still can’t avoid ongoing energy costs.</em></p><p><em>[7] Work is timeless / robust in terms of number of hashes, not energy required. New hardware technologies could improve mining efficiency — although at some point the efficiency gains will slow down as we run into hard physical limits. The robustness of Bitcoin’s PoW also relies on SHA256 not being broken.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=554c4450ce18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Code Reusability vs. Accidental Commonness]]></title>
            <link>https://hugonguyen.medium.com/code-reusability-vs-accidental-commonness-89e2b2b007cd?source=rss-3efc6d31e61c------2</link>
            <guid isPermaLink="false">https://medium.com/p/89e2b2b007cd</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[code-reusability]]></category>
            <category><![CDATA[bugs]]></category>
            <dc:creator><![CDATA[Hugo Nguyen]]></dc:creator>
            <pubDate>Wed, 03 Oct 2018 23:34:54 GMT</pubDate>
            <atom:updated>2018-10-15T21:45:41.100Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the nastiest, consensus-critical bugs (<a href="https://bitcoincore.org/en/2018/09/20/notice/">CVE-2018–17144</a>) has been recently discovered in the Bitcoin Core software, which prior to that point had an almost immaculate history. <a href="https://medium.com/u/4acb12744ff8">Jimmy Song</a> has written <a href="https://medium.com/@jimmysong/bitcoin-core-bug-cve-2018-17144-an-analysis-f80d9d373362">an excellent breakdown of this bug</a>.</p><p>The short summary of the bug is that there are 4 cases where the Bitcoin Core software needs to check for double-spending. All 4 cases initially shared the same code execution flow. After some subtle iterations of the code over several years, one of the 4 cases (“single-tx-double-spend-in-a-block”) got skipped, which would allow a miner to potentially trick some nodes into accepting a block that inflates the supply of Bitcoin.</p><p>The nature of this bug reminds me of the constant conflict between:</p><p>(a) the need for code reusability &amp; optimization</p><p>(b) the danger of falling for what I call <em>accidental commonness: </em>things that are similar not by design, but by accident</p><p>Accidental commonness creates a fertile ground for refactoring nightmares and potential bugs like <a href="https://bitcoincore.org/en/2018/09/20/notice/">CVE-2018–17144</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*SpIlnejfRIJekG_30YG9oA.jpeg" /><figcaption>Accidental Commonness</figcaption></figure><p>Some background, if you’re not familiar with software engineering:<br> <br>In software there is this grand vision of software components being perfectly modular — similar to their physical engineering counterparts. There is a good reason you don’t have to carry a different type of charger or USB wire everywhere you go.</p><p>So there has always been a strong push for code reusability. Writing redundant code is often frowned upon. Why do the same work twice when you can do it once?</p><p>There’s also a long history of reinventing-the-wheel in software which gives code reusability even a higher priority on the priority list. Code reusability is often considered one of the industry’s “Best Practices”. An aspiring junior software developer might be inclined to think that there is zero downside to code reusability.</p><p>But there’s a hidden danger — and I don’t believe this stuff is ever properly taught in schools — of extreme code reusability.</p><p>Extreme code reusability means collapsing any two similar-looking pieces of code into one, regardless of their use cases &amp; original intention.</p><p>Which a lot of times end up with code that has accidental commonness.</p><p>It might not be obvious why accidental commonness is bad, but one only has to maintain a sufficiently large software project for a long period to understand why.</p><p>It is bad because product requirements change and software is an ever-evolving, never-quite-finished product.</p><p>This constant-moving-target problem is something quite unique to software. If you are a structural engineer you are not expected to turn a house into a 20-story high-rise, or a car into a flying saucer. Yet in software we constantly do this.</p><p>When product requirements and use cases change, the underlying assumptions that the software were initially written for might no longer be applicable.</p><p>So that proud piece of common code that you refactored (but now have completely forgotten) no longer works the way you think it would.</p><p>I’ve lost count of how many painful refactoring projects or nasty bugs I’ve seen that are a direct result of premature optimization or accidental commonness — to the point where I now avoid things like Inheritance like a plague.</p><p>Things that have accidental commonness will quickly reveal their differences when they evolve beyond their initial state. Any rigidity in code commonness then would be a massive bane to get rid of.</p><p>The more layers of accidental commonness there are in the code, the more of a minefield it is to navigate. CVE-2018–17144 is a perfect example of that.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89e2b2b007cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Feedback Loop vs. Circular Reasoning]]></title>
            <link>https://hugonguyen.medium.com/feedback-loop-vs-circular-reasoning-1544ae7fd457?source=rss-3efc6d31e61c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1544ae7fd457</guid>
            <category><![CDATA[proof-of-work]]></category>
            <category><![CDATA[feedback-loop]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[proof-of-stake]]></category>
            <category><![CDATA[circular-reasoning]]></category>
            <dc:creator><![CDATA[Hugo Nguyen]]></dc:creator>
            <pubDate>Fri, 28 Sep 2018 19:37:45 GMT</pubDate>
            <atom:updated>2018-10-01T02:19:36.389Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*brqfGm3Fxptyrj8TpMk-7A.jpeg" /><figcaption>All circles are not created equal :-)</figcaption></figure><p>Feedback loop and circular reasoning fallacy are highly common, but they involve very different types of circularity.</p><p><strong>Feedback loop</strong>: action induces further action, but the extra action also requires work, it doesn’t come from thin air.</p><p>Feedback loops typically weaken and end by themselves, although they can last longer <em>as long as more work is put into the system</em>. Feedback loop is essentially about amplification &amp; second-order effects.</p><p>Think: deforestation that leads to land erosion, which leads to further deforestation.</p><p>Another example of a feedback loop is economic bubbles. Hype leads to more hype which leads to more hype, until all people who could be hyped up have been hyped up. Each stage in a hype cycle requires more work. Bubbles therefore could misallocate capital &amp; cause waste.</p><p>Another example is the adoption curve of Bitcoin. Bitcoin was initially known only among geeks &amp; cypherpunks. An early wave of early adopters built demand which raises the price. Rising prices in turn draws more attention and further increases adoption.</p><p>The important thing to remember about feedback loop is that feedback loop requires work. There is no magic.</p><p><strong>Circular reasoning fallacy</strong>: the proposition is supported by the premise, which is supported by the proposition.</p><p>In terms of “work”, circular reasoning can also be generally described as creating work out of thin air. Work is the supposed “proof” that backs the argument, which for circular reasoning actually has zero substance.</p><p>So circular reasoning is essentially about <em>creating something out of nothing</em>.</p><p>Think: a hypothetical wheel that keeps spinning forever on its own.</p><p>This manifests in Proof-of-Stake protocols, for example, by naively moving the problem of distributed consensus from finding blocks to what is the source of randomness.</p><p>If the PoS source of randomness is external, it is circular reasoning because to agree on the same external randomness (without Proof-of-Work) also requires solving distributed consensus, which is the original problem.</p><p>If the PoS source of randomness is internal, it is <em>not</em> circular reasoning but the scheme breaks down for a different reason: if you use purely the content of a blockchain to determine the content of the blockchain, your process cannot be truly random. No good randomness means that your protocol is predictable and exploitable. For a detailed exploration of the role of randomness in Bitcoin, check out my other article: <a href="https://medium.com/@hugonguyen/bitcoin-chance-and-randomness-ba49a6edf933">Bitcoin, Chance &amp; Randomness</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1544ae7fd457" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>