<?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 Brandon Arvanaghi on Medium]]></title>
        <description><![CDATA[Stories by Brandon Arvanaghi on Medium]]></description>
        <link>https://medium.com/@brandonarvanaghi?source=rss-771b82fd92bd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*itZbZypEkXgDhn7Mg-Z73A.jpeg</url>
            <title>Stories by Brandon Arvanaghi on Medium</title>
            <link>https://medium.com/@brandonarvanaghi?source=rss-771b82fd92bd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 00:33:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@brandonarvanaghi/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[How decentralization dies: the killer concessions]]></title>
            <link>https://medium.com/@brandonarvanaghi/how-decentralization-dies-the-killer-concessions-86dd1ca86da3?source=rss-771b82fd92bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/86dd1ca86da3</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[peer-to-peer]]></category>
            <category><![CDATA[market]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[decentralization]]></category>
            <dc:creator><![CDATA[Brandon Arvanaghi]]></dc:creator>
            <pubDate>Tue, 05 Nov 2019 16:35:52 GMT</pubDate>
            <atom:updated>2019-11-06T16:42:32.439Z</atom:updated>
            <content:encoded><![CDATA[<p>Decentralization has never been an end-state. In hindsight, it has always been a <strong>vessel</strong> <strong>for achieving</strong> <strong>a</strong> <strong>concession</strong> from a centralized body it is <strong>protesting</strong>.</p><p>Every decentralization play has followed a simple pattern:<strong> protest</strong> a market inefficiency, <strong>win</strong> that protest via a major concession, and then <strong>disappear</strong> back to fringes of society.</p><p>You can see this throughout history.</p><h3>MUSIC [1999–2008]</h3><blockquote>If you want to legitimately pay for downloadable music you need to access dozens of Web sites using a variety of different programs that may or may not be compatible with your hardware. And there’s a good chance that what you want isn’t even available.</blockquote><blockquote>On the other hand, if you pay nothing you can find whatever you want in a heartbeat... This isn’t the world I want to leave to my grandchildren, but if the many players of the recording industry don’t get their act together, it’s what they’ll get.</blockquote><blockquote>— BILL BARNES, Slate Magazine, 2002</blockquote><ol><li><strong>THE PROBLEM (1999–2002)<br>• </strong>Major record labels did not make popular music available online<br>• When they did, it spanned across multiple different sites and formats</li><li><strong>THE PROTESTS<br>• </strong>Napster, an application with a library of <em>all</em> music in mp3 format<br>• Gnutella protocol (behind LimeWire), and derivations<br>• BitTorrent</li><li><strong>THE CONCESSIONS<br>• </strong>Record labels agreeing to 99¢ music on the iTunes Music Store<br>• Freemium licensing model behind Spotify</li></ol><p>Online music had a tumultuous road to what I call its “steady-state” product-market fit: a paid subscription to stream any song you want from a single service.</p><p>The mp3 file was a revolution, and it was how the world wanted to access music in the late 1990s through the early 2000s. It was lightweight, supported by multiple clients, and easy to copy across devices. Record labels had not gotten their acts together to find a reasonable, user-friendly way to provide customers music by top artists online. This market inefficiency bore the protest called <strong>Napster</strong> in 1999.</p><p>By 1999, Napster had <a href="https://www.reuters.com/article/spotify-ipo-timeline/spotifys-winding-road-from-outsider-to-music-industry-ally-idINKCN1HA1M9">150,000 registered users trading 3.5 million files</a>. By 2000, an even more resilient decentralized protocol called Gnutella was born, giving birth to popular peer-to-peer applications like LimeWire. By 2001, Bram Cohen invented BitTorrent, an even more decentralized way to download files — and Napster had 60 million registered users.</p><p>The “centralized” world tried to respond to this sudden uptick by having a legal alternative. In 2000, mp3.com released <em>my.mp3.com</em>, a service that would let you <em>legally</em> stream songs after you could prove possession of a CD containing that song by inserting it into your computer.</p><p>Even this was unacceptable. Universal Music Group, EMI, Warner Brothers, BMG and Sony, banded together under the RIAA and <a href="https://www.wired.com/2000/04/riaa-wins-suit-against-mp3-com/">successfully sued mp3.com</a> in 2000 for what the court deemed was not “fair use” of the copyrighted materials. mp3.com settled for $54 million, which led to their share price plummeting, and eventually the discontinuation of their service.</p><p>But Napster was <strong>worse than mp3.com </strong>for the record labels. It was built on a peer-to-peer network, meaning these mp3 files lived on computers from regular people across the world. This made it easy for record labels to come after the company of Napster for <em>helping people find</em> these songs, but difficult (and soon, impossible) to actually cut off access to the millions of computers actively <em>sharing</em> these songs on the underlying network. In laying the groundwork for a <a href="https://medium.com/@jbackus/resistant-protocols-how-decentralization-evolves-2f9538832ada">resilient, decentralized protocol</a>, Napster taught the world how to protest market inefficiencies from central companies.</p><p>As of 2001, no concession had been made by the record labels to the protests known as Napster, LimeWire (and its many derivatives), and soon BitTorrent. The Business Software Alliance estimated that the <a href="https://digitalcommons.law.villanova.edu/cgi/viewcontent.cgi?article=1329&amp;context=vlr">worldwide software piracy rate was forty percent</a>, costing the music industry $10.97 billion in lost revenues.</p><p>Noticing that these protests were growing, the record labels sought to <strong>get their act together </strong>— the first step on their way to <strong><em>conceding</em>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vPSwMhcC40oI4HHxbd3h_A.png" /></figure><h4>Attempt #1: pressplay</h4><p>In December of 2001, Universal and Sony Music partnered to came up with pressplay.</p><blockquote>‘’We are now spending tens of millions of dollars to help launch pressplay in the hope that a legitimate response to the illegitimate services will provide an attractive alternative to consumers.”</blockquote><blockquote>“This is truly a time for artists and record companies to be working together.’’</blockquote><blockquote>— <strong>Rand Hoffman, Head of Business Affairs for multiple record labels</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*ehNvUnbVHvcD6v5A.jpg" /><figcaption>pressplay, an attempt by the music industry to gain back market share from Napster</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f5hw2AyeE9vaTTnUQHpN7Q.png" /><figcaption>The pressplay pricing model</figcaption></figure><p><strong>Why it was rejected: </strong>Among pressplay’s <a href="https://web.archive.org/web/20060615062804/http://www.pcworld.com/reviews/article/0,aid,125772,pg,3,00.asp">tone-deaf problems</a> were:</p><ul><li>Not every song was available for streaming, and among those that were, not all could be downloaded</li><li>You couldn’t burn more than two tracks from the same artist</li></ul><p>Because of serious issues with how they compensated artists, pressplay did not have access to the breadth of artists that decentralized applications did. <a href="https://www.nytimes.com/2002/02/18/arts/record-labels-answer-to-napster-still-has-artists-feeling-bypassed.html">One manager computed</a> that an artist would need four of their songs downloaded for that artist to earn <em>one penny!</em></p><h4>Attempt #2: MusicNet</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T5Dzd384-HHjSeQ0BGOnIw.png" /><figcaption>MusicNet, another attempt by the music industry to address the Napster protest</figcaption></figure><p><strong>Why it was rejected: </strong>MusicNet cost $10 per month for 100 streamed songs and 100 downloads. Each downloaded audio file expired after only 30 days. Each time you listened to a song, it counted against your stream total. This was a far cry from the flexibility LimeWire and BitTorrent provided.</p><p>Both companies had only a segment of popular artists with completely incompatible ways to listen to that music. To compete with the decentralized options, the music executives would need to do more.</p><blockquote>Neither [pressplay nor MusicNet]’s paltry music selections could compete against the virtual feast available through illicit means.</blockquote><blockquote>— <strong>PCWorld.com, 2006</strong></blockquote><h3>The Concessions Trickle In</h3><blockquote>I came up with 99 cents per track download. [Steve Jobs] liked it; a lot of others didn’t like it. But at that time, there was nothing going on except free downloads.</blockquote><blockquote>— <strong>Paul Vidich, VP of Warner Music Group</strong></blockquote><p>In 2003, Apple launched the iTunes music store. Key to its value proposition was that it included the distribution rights for <em>the most popular copyrighted songs on the market</em> in one single location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sS4FWt8bjdW5quw3g3jdVA.png" /><figcaption>A quote from Paul Vidnich, VP of Warner Music Group. iTunes would be the first legal, all-in-one competitor to Napster</figcaption></figure><p>The record labels came to the negotiating table with Jobs because their half-baked concessions had not worked. What ensued were <a href="https://www.hollywoodreporter.com/news/steve-jobs-apple-itunes-warner-music-group-286265">famously intense negotiations</a> leading to concessions the record industry had never-before made, namely around pricing and digital rights management.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TJqVs_aZHNWsNfSTE9OcOA.png" /><figcaption>The record labels made major concessions in dealing with Apple, on both digital rights management, and 99¢ pricing. From <a href="https://www.latimes.com/archives/la-xpm-2006-may-03-fi-apple3-story.html">https://www.latimes.com/archives/la-xpm-2006-may-03-fi-apple3-story.html</a>.</figcaption></figure><blockquote>We believe that 80% of the people stealing stuff don’t want to be, there’s just no legal alternative. So we said, ‘Let’s create a legal alternative to this.’</blockquote><blockquote>— <strong>Steve Jobs, 2003</strong></blockquote><p>You did not “rent-to-own” the music you purchased for 99¢. You owned it, and the iTunes store interface — and its ease-of-integration with products like the iPod — made it <em>friendlier than any decentralized application</em>. To this effect, the iTunes Music Store <a href="https://www.apple.com/newsroom/2003/05/05iTunes-Music-Store-Sells-Over-One-Million-Songs-in-First-Week/">sold over 1 million songs in its first week</a>, and had <a href="https://www.apple.com/newsroom/2004/04/28iTunes-Celebrates-Its-First-Anniversary-Over-70-Million-Songs-Purchased/">over 70 million purchases its first year</a>.</p><p>The iTunes concession by record labels was a resounding success, as money starting flowing into the iTunes ecosystem. As the years went on, users became less interested in <em>owning</em> an mp3 than being able to stream any song on-demand; specifically, in a <em>freemium</em> model.</p><h4>The Spotify Concession</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PeWWLfTxBgb1RPega8R_2Q.png" /><figcaption>Unlimited streaming services pushed music piracy protests to the fringes of society</figcaption></figure><p>Spotify’s co-founder Daniel Ek used the <strong>exact same language </strong>to describe Spotify’s value proposition that Steve Jobs did when announcing iTunes. Just as Jobs several years earlier, Ek lamented that legal options did not provide a “better experience than piracy”!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w5jvttdbonagolPntwZaLg.png" /><figcaption>Daniel Ek, co-founder of Spotify, shifts the goalposts further by calling iTunes a worse UX than piracy. From <a href="https://www.nytimes.com/2011/07/14/technology/spotify-music-streaming-service-comes-to-us.html">https://www.nytimes.com/2011/07/14/technology/spotify-music-streaming-service-comes-to-us.html</a>,</figcaption></figure><p>Though Spotify launched in Europe in 2008, it took until 2011 for the service to become available in the US. Digital music services like Spotify needed to negotiate rights with <em>each record label and copyright holder</em>, unlike radio, which could pay one up-front fee.</p><p>Though the record labels in the U.S. made licensing deals with similar offerings Rhapsody and MySpace music, they were reluctant to make any such deal with Spotify due to its <em>freemium model</em>. Spotify was the only proposed music streaming service where users <strong>did not have to pay up-front</strong>. Advertising would drive revenues from free users, a model that record labels resisted.</p><blockquote>“Free streaming services are clearly not net positive for the industry, and as far as Warner Music is concerned, it will not be licensed.</blockquote><blockquote>[The freemium model] strategy is not the kind of approach to business that we will be supporting in the future.”</blockquote><blockquote><strong>— Edgar Bronfman, Warner Music CEO, 2010</strong></blockquote><p>The negotiations between Spotify and record labels once again came down to the pressure of the <em>protests</em>, and how to end them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*MFR3p62-vU1HXeA5QChFkQ.png" /><figcaption>“Daniel Ek profile: ‘Spotify will be worth tens of billions’”, the Telegraph (2010)</figcaption></figure><p>Convincing them about their freemium model, which gave record labels less control than ever, was the only way to do so.</p><h4>Effects of the Spoify concession</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*N89huTBDg40B5wu6jjr41Q.png" /><figcaption>The Telegraph article, 2016</figcaption></figure><p>Once the record labels conceded to the protests by accepting Spotify’s freemium model, the protests once again got pushed to the fringes of society. This is largely because decentralized protocols have a worse user experience than centralized alternatives. Rather than communicating with a single computer, you have to interact with several around the world, some of which may not have the information you need.</p><blockquote>Forty percent of respondents to the NPD survey who decreased their illegal file-sharing said they did so because of access to legal streaming services like Pandora and Spotify, which are easier to use and don’t present the threat of spyware or viruses</blockquote><blockquote>— <strong>Victor Luckerson, TIME, 2013</strong></blockquote><h3>MOVIES [2000–2011]</h3><blockquote>The music industry lost a lot of money when it dithered over this transition [to user-friendly content], and now the movie business seems to be making the same mistake. It could be raking in a lot of cash… until it works out a plan to do so, there’s always BitTorrent.</blockquote><blockquote>— <strong>Farhad Manjoo, SLATE, 2009</strong></blockquote><ol><li><strong>THE PROBLEM (2000–2011)<br>• </strong>Popular movies had an 11-year lifespan before becoming available for digital, subscription-based streaming</li><li><strong>THE PROTEST<br></strong>• BitTorrent for downloading movies</li><li><strong>THE CONCESSIONS<br>• </strong>Starz licensing deal with Netflix for premiere content in 2008<br>• Floodgates opening to more premium channels agreeing to licensing with Netflix, future competitors</li></ol><p>The same <em>protest → concession → protest ends</em> pattern emerged in the movie industry. The concession was Netflix’s stream-all-you-want subscription model that studios resisted.</p><p>To understand the concession, it’s helpful to understand the <a href="https://slate.com/technology/2009/04/why-there-is-no-itunes-for-movies.html">lifecycle of rights around Hollywood movies</a>. In this “windowing system”, a movie starts in theaters, hits DVD after a few months, becomes available for pay-per-view, goes to premium channels with a roughly 15 month exclusive rights period, then goes to ad-driven broadcasters and networks like FOX and NBC. Finally, after <strong>11 years</strong>, the movie enters a “library” phase in which places like Netflix can stream it.</p><p>This brutal lifecycle made Netflix, at best, a collection bin for outdated movies. To break this mold, Netflix sought to inject itself into an earlier phase of the lifecycle: rather than wait 11 years, Netflix would negotiate deals with the premium channels to receive the licensing rights at the same time as cable networks did.</p><p>To this effect, Netflix <a href="https://latimesblogs.latimes.com/entertainmentnewsbuzz/2008/10/more-mainstream.html">struck a deal with Starz Entertainment</a> in 2008 to legally stream premiere titles like “Spider-Man 3” and “Superbad”. This deal cost Netflix only $25 million a year until 2012 when it would expire, and swelled Netflix’s user numbers from 9 million to 25 during that timeframe. Starz found it cannibalized their own sales; in fact, analysts estimated Starz <em>should have</em><a href="https://www.nytimes.com/2010/12/13/business/media/13bewkes.html"> priced the deal at $300 million</a><em>.</em></p><p>Though ill-advised for Starz, these premium titles’ availability on Netflix was very much the “concession” the rampant BitTorrent protest for movies sought: a subscription model for unbounded streaming of <em>premium content</em>. As evidence, in May of 2011 (when the Starz agreement was in place), <a href="https://www.wired.com/2011/05/netflix-traffic/">Netflix overtook BitTorrent in aggregate broadband traffic</a> from North America.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*ep64IlxLRrwlwPeu.png" /><figcaption>In 2011, Netflix accounted for 22.2% of all U.S. broadband traffic, <a href="https://www.wired.com/2011/05/netflix-traffic/">while BitTorrent accounted for 21.6%</a>. During peak times, Netflix accounted for 30% of all traffic.</figcaption></figure><p>More bodies of research show that when premium content was available on Netflix, there was a <a href="https://getd.libs.uga.edu/pdfs/welter_brennan_s_201212_ma.pdf">subsequent drop in BitTorrent downloads</a> for that title. Their exploding user numbers made premium channels reluctantly came to the table to offer similar licensing deals. Lionsgate <a href="https://mashable.com/2011/07/26/mad-men-netflix-instant/">agreed to license its <em>Mad Men </em>series</a> to Netflix in 2011, and CBS its <a href="https://mashable.com/2011/04/06/mad-men-netflix/"><em>Frasier</em>, <em>Medium</em> and <em>Cheers</em></a><em> </em>shows as well.</p><blockquote>The only fights now are over money… as firms like Netflix get more subscribers and studios get more desperate as traditional revenue channels dry up, we’ll see more deals to get better titles online. <br><br> — Farhad Manjoo, SLATE, 2011</blockquote><h3>What does this mean for cryptocurrencies?</h3><p>Cryptocurrencies are a decentralization play like any other. They are a protest seeking a concession.</p><h3>Brandon Arvanaghi on Twitter</h3><p>Decentralization has never been an end-state. Historically, it&#39;s a vessel to achieving a concession. The decentralization playbook: * Protest a market inefficiency ✊ * Win that protest via a major concession 🥇 * Disappear back to the fringes of society 👻</p><p>The killer concessions that might end much of the cryptocurrency protests include:</p><ol><li>Borderless transacting without intermediaries</li><li>Ease of access to banking and capital (creating a private/public keypair rather than being beholden to a bank)</li><li>Legal, digitized gambling</li></ol><p>They would never include:</p><ul><li>Censorship resistance</li><li>Anonymity in transactions</li></ul><p>These last two points are historically what mainstream users care <em>least about</em>. Not only that, but they are the culprit for why decentralized protocols uniformly have such a bad user experience. Conceding to the mainstream demands behind the protest, while eliminating the friction, are exactly why Spotify and Netflix beat out BitTorrent. For mainstream users, it’s a win-win.</p><h4>What are the “killer concessions” for cryptocurrencies?</h4><p>The profile of the “killer concession” I outline above, which concedes to the biggest drivers of the protests, are likely:</p><ol><li>A trusted “globalcoin” like <em>Libra</em>, where nations cooperate to regulate a currency spanning borders.</li><li>Nations digitizing their sovereign currencies on an interoperable (or single) blockchain, so people can easily transact with each<em> </em>currency<em>.</em></li></ol><p>A programmable “globalcoin”, or nations digitizing their sovereign currencies, would allow transacting with no intermediaries, ease of access to banking, and programmable money and smart contracts for applications like gambling. These chains would be more centralized, and thus not censorship-resistant, but consequently would also provide a better user experience.</p><p>If you want evidence of this “concession” model applying to cryptocurrencies, consider that China’s President recently announced they will emphasize <a href="https://www.coindesk.com/president-xi-says-china-should-seize-opportunity-to-adopt-blockchain">adoption of blockchain technology for China</a>, stating it is “necessary to implement the rule of law”, and also calling for “guidance and regulation.” If China’s proposal does not satisfy these global protests — say, capital controls are even stricter on their proposed “blockchain” than the status quo — it will be another <strong>MusicNet</strong>, and the protests will keep growing. However, in response to growing protests, every country will be forced to iterate on concessions until they finally arrive at a satisfactory response like iTunes or Spotify.</p><h4>Isn’t decentralization the point of cryptocurrencies?</h4><p>Many would argue that the <em>entire point</em> of cryptocurrencies is decentralization: trustless assets with fixed supply caps. To them, centralized concessions could never quell the protests, because decentralization <em>is</em> the value proposition. Governments can arbitrarily print money, but cryptocurrencies cannot change their supply schedule unless the majority of their network agrees to do so.</p><p>However, concessions could still adversely impact this seemingly “untouchable” property. First, the “globalcoin” concession would also support smart contracts, allowing every application that drives value to Ethereum — digital collectibles, lotteries, prediction markets, etc. — to also be built there. While these assets will be on a more “trusted” chain, it will also be free of the user experience issues plaguing blockchains today. Cryptocurrencies that arouse interest from the promise of smart contracts will be reduced to their core value proposition: as a <strong>trustless store of value</strong>. When that happens, developers, companies, miners, and users who may have sought <em>more</em> from these blockchains may leave in favor of centralized alternatives.</p><p>Second, the very <em>need</em> for an iron-clad safe haven asset may decrease with the advent of a globalcoin, or if several countries digitize their native currencies. Venezuelans suffering from hyperinflation today may seem like the perfect use case for a safe haven asset. In reality, their problem is one of <em>liquidity</em>: they seek to store value in something <strong><em>more stable </em></strong>than the bolívar. Capital controls currently make that impossible.</p><blockquote>I keep all of my money in Bitcoin. Keeping it in bolívars would be financial suicide...</blockquote><blockquote>I don’t have a bank account abroad, and with Venezuela’s currency controls, there’s no easy way for me to use a conventional foreign currency like American dollars.<br><br> — Carlos Hernandez, Venezuelan Economist, “Bitcoin Saved My Family” (NYT)</blockquote><p>In short, concessions could make the markets for currencies perfect: if the bolívar suffers, transactions may proceed in the digitized yuan, dollar, euro, globalcoin, or anything else. <strong>Liquid markets may lessen the need for failsafes.</strong></p><p>There will likely still be demand for a trustless, safe haven asset in this more liquid world. However, the “killer concessions” will still reverberate throughout the cryptocurrency industry as it exists today. At the very least, these concessions will eliminate all usage of projects where being <strong><em>completely trustless </em></strong>is not the <strong><em>primary demand driver.</em></strong> Everything else<em> </em>can, and will, be done better on a more trusting “globalcoin”, the same way Spotify is used over BitTorrent for music.</p><p>This is not a doom-and-gloom scenario. When the “killer concessions” are inevitably made, we will be living in a world that by definition has <em>less of a need for protest</em>. All protests seek concessions, so even if some market caps decrease, cryptocurrencies will have spurred meaningful change the same way Napster, LimeWire, and BitTorrent brought us iTunes and Spotify.</p><h4>Wrapping Up</h4><p>The concession for a globalcoin like Libra, or digitized national currencies, will not take place overnight. In fact, <em>Libra</em> will likely never see the light of day. Cryptocurrencies are so young that we are in the <strong>pressplay and MusicNet</strong> days of “concessions,” and what Facebook is doing today is the equivalent of proposing <strong><em>Spotify </em></strong>to music executives in the year 2000!</p><p>In a sense, the <strong>price of the token</strong> represents the <strong>health of the protest</strong>. When the protest ends, you would expect to see that health metric drop as well. This could be why the <a href="https://coinmarketcap.com/currencies/bittorrent/">BitTorrent token is doing so poorly</a>: it was created <em>after</em> the Spotify and Netflix concessions. Had this token been added <em>pre-concession</em>, we may have seen a different outcome. Bitcoin and ether have a token to capture the momentum of their protest while it is alive and well. Time will tell if mainstream concessions have a similar effect.</p><p>Napster caught the mainstream eye in 2000, and it took about 11 years for the Spotify concession to be made. Concessions around currencies require nations to cooperate, which is inherently more difficult than music and movie executives. If we assume a similar time schedule, we can expect the concessions I outlined above in the <em>late 2020s.</em> When that takes place, we will likely see the protests (use of decentralization for money) die down.</p><p><em>If you enjoyed this post, </em><a href="https://twitter.com/arvanaghi"><em>follow me on Twitter</em></a><em>. I post there more frequently.</em></p><p><em>A response I might hear:<br>&gt; “But money is different than music and movies. Money moves in two directions, whereas the incentive with files is just to download.”</em></p><p><a href="https://medium.com/@jbackus/private-bittorrent-trackers-are-markets-1d3cc3c9bacd"><em>Currency dynamics existed in BitTorrent</em></a><em> well before any token was added. These dynamics incentivized transacting in both directions (receiving and sharing), just like cryptocurrencies today. As you would expect, these “currencies” fell out of favor once the right concessions were made.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86dd1ca86da3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How do payments make their way across the Bitcoin Lightning Network?]]></title>
            <link>https://medium.com/@brandonarvanaghi/how-do-payments-make-their-way-across-the-bitcoin-lightning-network-9a9c2a5357e9?source=rss-771b82fd92bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a9c2a5357e9</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[announcements]]></category>
            <category><![CDATA[education]]></category>
            <dc:creator><![CDATA[Brandon Arvanaghi]]></dc:creator>
            <pubDate>Tue, 22 Oct 2019 12:35:28 GMT</pubDate>
            <atom:updated>2019-10-22T13:05:11.431Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zpns0fFEMeQ0Cw9zlP-XAw.png" /></figure><p>The Lightning Network is a Layer 2 solution that allows you to create micropayment channels with other Bitcoiners. It allows instant and trustless peer-to-peer transacting while limiting the amount of data needed on-chain. You can read more about how it works in our post <a href="https://medium.com/gemini/breaking-down-the-bitcoin-lightning-network-eltoo-c48554f5ae02">here</a>.</p><p>Any two individuals on the Lightning Network can transact without needing a direct payment channel open with one-another. The sender does not directly pay the intended recipient; instead, they pay a user with whom they <em>do</em> have a channel open. That user sends a payment to another such user, and so on until the intended recipient receives their payment.</p><p>But why are users along the way incentivized to help the sender route the payment, and how does the sender make sure these users can’t steal any of the Bitcoin intended for the recipient? The answer is with <strong>H</strong>ashed <strong>T</strong>ime <strong>L</strong>ocked <strong>C</strong>ontracts (<a href="https://lightning.network/lightning-network-paper.pdf">HTLCs</a>), which I will explore in this post.</p><p><strong>HTLCs and Routing Payments</strong></p><p>HTLCs are a clever way to trustlessly route payments in the Lightning Network. As the name suggests, they involve hashes, timelocks, and function as a contract between users in the Lightning Network.</p><p>Alice, Bob, and Charlie each run a lightning node. Alice has a channel open with Bob, and Bob has a channel open with Charlie. Alice and Charlie do not have a channel open directly with one another.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A4cu-Hdh7qi8KSZC" /><figcaption>Alice has a channel open with Bob, who also has one open with Charlie</figcaption></figure><p>Alice wants to pay Charlie 1 bitcoin. The first thing Charlie does is create a secret number <strong><em>R</em></strong> that he does not share with anyone.</p><p>Charlie places <strong><em>R</em></strong> into a <strong><em>cryptographic hash function</em></strong> and records the output. In short, when you place a number into a hash function, it produces a unique output. The design goal of a hash function is such that if you have the output of a hash function, there’s no way to figure out what the input was.</p><p>Charlie takes the output of hashing <strong><em>R</em></strong>, we’ll call this new number <strong>H</strong>, and sends it to Alice. Note that Alice does not know <strong><em>R</em></strong> — she only knows <strong>H</strong><em>, </em>which conceals the value of <strong><em>R</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4YWNK1IAnURrL7EF" /><figcaption>Charlie sends Alice H, the result of hashing his secret number R.</figcaption></figure><p>The Lightning Network is named as such because while Alice and Charlie may not have a payment channel open directly with one-another, a route exists between them in the <em>network</em> of users. Alice sees that a payment route to Charlie exists through Bob, so to pay Charlie, Alice must involve Bob.</p><p>Alice sends Bob a transaction for 1.1 bitcoin that Bob can redeem <em>if he finds out </em><strong><em>R</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1xfD4-HxFakNB1Dp" /><figcaption>Alice sends Bob a signed transaction in their payment channel that would pay him 1.1 bitcoin if he can prove he knows R.</figcaption></figure><p>She signs this transaction and sends it to Bob. At a high level, here’s what the new output might look like:</p><pre>…<br>OP_IF<br>  # Make sure the value provided equals H when hashed<br>  OP_HASH160 H OP_EQUALVERIFY<br>  OP_CHECKSIG # This branch only works if Bob signs it<br>OP_ELSE<br>  # If Bob doesn’t figure out R in X days, Alice can claim this<br>  # output using her signature alone.<br>OP_ENDIF</pre><blockquote>OP_HASH160 H OP_EQUALVERIFY</blockquote><p>This part of script:</p><p>1. Takes whatever value you provide it</p><p>2. Hashes it</p><p>3. Pushes <em>H</em>, the concealed secret, onto the stack</p><p>4. Compare H with the result of 2.</p><p>As you can see, only the secret Charlie knows, <strong><em>R</em></strong>, will make this part of the script work. Bob does not know <strong><em>R</em></strong>, so he has no way of claiming this 1.1 bitcoin for himself right now.</p><p>Bob knows that Charlie knows <strong><em>R</em></strong>, and he knows how much Alice promised to pay Charlie. Bob, who has a channel open directly with Charlie, creates the <strong>same kind of transaction with Charlie!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*60WJJVzVHxkWhaYC" /><figcaption>Bob sends Charlie a signed transaction in their payment channel that would pay him 1 bitcoin if he proves he knows R.</figcaption></figure><p>Once again, the locking script on Bob’s signed transaction might look like:</p><pre>…<br>OP_IF<br>  # Make sure the value provided equals H when hashed<br>  OP_HASH160 H OP_EQUALVERIFY<br>  OP_CHECKSIG # This branch only works if CHARLIE signs it<br>OP_ELSE<br>  # If Charlie doesn’t claim this in X days, Bob can claim this<br>  # output using his signature alone.<br>  …<br>OP_ENDIF</pre><p>Instead of being for 1.1 bitcoin, Bob signs a transaction that will give 1 bitcoin of Bob’s own money to Charlie <em>if Charlie knows </em><strong><em>R</em></strong>.</p><p>When Charlie sees that the amount Bob’s transaction would pay him is the amount he expected to receive from Alice, he signs a transaction claiming that output. As we have seen, to claim the output Bob created, you must provide <strong><em>R</em></strong> as an input to your transaction. <strong>Because the Bitcoin blockchain is public, when Charlie publishes his transaction claiming the output, he has revealed <em>R</em> to the world!</strong></p><p>Bob, seeing Charlie has published a transaction claiming the output he created, finds <strong><em>R</em></strong> from the <em>witness</em> (also called the <em>unlocking script</em>) Charlie used to claim the output. Having <strong><em>R</em></strong>, Bob can now claim the 1.1 Bitcoin from the output Alice created.</p><p><strong>What happened here?</strong></p><p>In the end, Alice pays Bob 1.1 bitcoin, and Bob pays Charlie 1.0 Bitcoin. The extra .1 bitcoin that Bob keeps is the reason he agrees to help Alice in the first place: he earns a <em>fee</em> in routing the transaction. Whenever someone wants to pay someone else on the Lightning Network, they must account for a small fee that every node collects along the way.</p><p>Charlie will only claim the output from Bob if it is for the amount Alice promised him. If Bob sneakily tried to net <em>half </em>of Alice’s bitcoin by sending Charlie a transaction that would only give him .5 bitcoin by revealing <strong><em>R</em></strong>, Charlie would simply not reveal <strong><em>R</em></strong>.</p><p>The pursuit of <strong><em>R</em></strong> is why nodes are invested in routing Alice’s payment to her intended recipient successfully. When <strong><em>R</em></strong> is publicly visible on the blockchain, it can mean only one thing: Charlie was paid in full. When that happens, all the users along the way can claim their output entitling them to a small fee.</p><p>For simplicity, this example assumes everyone claims their bitcoin by closing their payment channels. In reality, Charlie could reveal <strong><em>R</em></strong> directly to Bob, who could then show Alice he knows <strong><em>R</em></strong> as well. Alice, seeing that Bob knows <strong><em>R</em></strong> (which means Charlie can claim his money at any point), could then send Bob a new transaction for 1.1 bitcoin in their payment channel without any strings attached. Bob could then do the same with Charlie for 1 bitcoin. All three of them can keep their payment channels open this way, and have less clutter on the Bitcoin blockchain whenever they decide to publish the transactions.</p><p>Onward &amp; Upward,</p><p>Brandon Arvanaghi, Security Engineer</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a9c2a5357e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Quick Wins for Securing Your Online Accounts]]></title>
            <link>https://medium.com/@brandonarvanaghi/5-quick-wins-for-securing-your-online-accounts-b349e771b23c?source=rss-771b82fd92bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b349e771b23c</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[announcements]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Brandon Arvanaghi]]></dc:creator>
            <pubDate>Fri, 27 Sep 2019 13:01:04 GMT</pubDate>
            <atom:updated>2019-09-27T13:01:04.755Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UDcfeqM9-4XKAKrL2pN8Fg.png" /></figure><p>Attackers have well-defined tactics for targeting your online accounts. Following these simple steps will improve your security posture.</p><h3>#1: Disable SMS Account Recovery</h3><p>Your email provider likely allows you to set a <em>Recovery Phone Number</em>. That is, if you click Forgot Password? on the sign-in page, your email provider will text the phone number associated with your account a one-time code that, when entered, allows you to reset the password and log in to that account.</p><p>If you don’t know if you have this enabled, there’s a good chance you do, and having it enabled is a bad idea. Attackers can get control of your phone number via <em>phone porting</em>, where they call your phone carrier, pretend to be you, and ask them to start sending all calls and SMS texts to a phone <em>they </em>own.</p><p>If this happens, and you have SMS account recovery enabled anywhere, the attacker can click <strong>“Forgot password?”, </strong>receive the verification text to <em>their</em> phone, and successfully log in to <em>your</em> email account.</p><p>Gmail, for example, provides instructions on disabling SMS account recovery <a href="https://support.google.com/mail/answer/183723?co=GENIE.Platform%3DDesktop&amp;hl=en&amp;oco=0">here.</a></p><p><strong>Note:</strong> There are <strong>many services</strong> that allow SMS account recovery. It is particularly important to remove this option from your email, though, because your email address is often how you can reset passwords for <em>all</em> your sites and services.</p><h3>#2: Disable SMS Two-Factor Authentication</h3><p>Having a second factor of authentication (something <em>other</em> than your password you must provide to log in) is a must. But some options for that second factor are better than others.</p><p>First, understand that <em>SMS two-factor authentication</em> is different than <em>SMS account recovery</em>, which I just described earlier. If you have SMS two-factor authentication turned on, it means that when you log in with your password on a site, that site sends you a text with a one-time code that you need to enter <em>in addition to your password</em> to log in. This is different than <em>SMS account recovery</em>, where you click Forgot Password? and receive a one-time code to the phone number associated with your account to reset that account’s password. No password is needed in the latter case.</p><p>You should disable SMS two-factor authentication for the same <em>phone porting</em> risk I outlined in point #1.</p><p>When you remove SMS two-factor authentication, it’s important to add a more secure form of two-factor authentication before signing out. You can add an <em>authenticator application </em>like Authy, Duo, or Google Authenticator. When you use an authenticator app, the secret one-time codes are generated on your <em>physical device</em>, rather than texted to your phone number. That means an attacker with control of your phone number still can’t generate the one-time codes needed to log in to your account.</p><p>Even better than adding an authenticator app is adding a <em>security key</em>, which I describe later.</p><h3>#3: Turn off “Multi-Device” Support on your Authenticator App</h3><p>I just explained that authenticator apps codes are tied to a <em>physical device</em>, rather than get texted to your phone number, like with SMS.</p><p>However, some of these apps enable <em>Multi-device support</em>, which means you can enroll another device to generate the <em>exact same codes</em> as your current device. This allows you to have a backup device generate codes in case you lose or misplace your primary device.</p><p>Unfortunately, how you confirm that you want to add a second device is via <em>text message</em> to the phone number associated with your existing device. Thus, if an attacker has control of your phone number, they can take their phone, enroll it as a backup device for the authenticator app on <em>your </em>phone,<em> </em>receive the confirmation text, and successfully finish enrolling their phone’s authenticator app as your phone’s backup.</p><p>You can, and should, disable Multi-device support on your authenticator apps. Authy, as an example, explains how to do this <a href="https://support.authy.com/hc/en-us/articles/360016317013-Enable-or-Disable-Authy-Multi-Device">in their support pages</a>.</p><p><strong>Note:</strong> Disabling multi-device support means that if you lose that device, you will have no way of logging in to your accounts (assuming you don’t have backup codes, or another form of two-factor authentication like a security key enabled). However, it also means that if an attacker gets control of your phone number, they have no way of generating these one-time codes, or enrolling their device as a “backup” to your authenticator app.</p><h3>#4: Set a Voicemail PIN (or disable it!)</h3><p>You may not use voicemail, but if you don’t set a PIN, then yours is the default. Some carriers make the default the last 4 digits of your phone number. Others use the same PIN across all phones.</p><p>Voicemails are remotely accessible. That means an attacker does not need control of your phone number to listen to your voicemail messages — they just need an internet connection.</p><p>Worse yet, some services that allow SMS account recovery allow you to <a href="https://www.youtube.com/watch?v=ZpZbTPYB3cU">receive that one-time code via <em>phone call</em></a><em>.</em> An automated voice recites the one-time code to you on the call, and if you don’t answer, that recording goes to your voicemail. Thus, even if an attacker doesn’t have control of your phone number, they can click Forgot password? on your account, and have the site send the one-time code for reseting your password via phone call to your phone number. If you don’t answer the call (some attackers may wait until you are asleep), and you don’t have a voicemail PIN, the attacker can remotely log in to your voicemail and listen to that one-time code.</p><p>To prevent this attack, set a voicemail PIN on your phone, or call your carrier and disable voicemail on your phone entirely.</p><h3>#5: Advanced: Use a Security Key!</h3><p>Some people believe that using an authenticator app like Authy or Duo instead of SMS two-factor means they are no longer vulnerable to phishing. This is untrue.</p><p>The issue with one-time numerical codes is that anyone in the world can enter them. Even if those codes can only be generated on your physical device, if you get tricked into sharing that one-time code with a fake website or fake customer support rep, an attacker can quickly use it along with your password to log in to your account from anywhere in the world.</p><p>There’s a solution to this problem called <em>security keys </em>on sites that implement the <a href="https://medium.com/gemini/securing-your-gemini-account-with-webauthn-b5f369b8beec">WebAuthN</a> standard. A security key is a physical device that provides a <em>cryptographic signature</em> to confirm your identity to a site. Security keys can include:<br>• Yubikeys<br>• MacOS Touch ID<br>• Feitian keys<br>• Even more, outlined <a href="https://medium.com/gemini/securing-your-gemini-account-with-webauthn-b5f369b8beec">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/0*T0R5pahuH7YBOG3o" /><figcaption>Examples of security keys, provided by Yubico</figcaption></figure><p>Security keys have nothing to do with your phone number. The attacker would need physical access to that security key to try and authenticate as you. There’s no single-use <em>numerical codes</em> involved, so there is nothing you can provide a fake site or a fake customer support rep to log in to your account mistakenly.</p><p>Here’s an example of logging in with MacOS Touch ID to Gemini. After entering your password, Gemini prompts you to use the Touch ID feature of your Mac to complete the log in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a08Vgf_mZBr5Hpya6cyBYg.png" /><figcaption>Gemini prompting for Touch ID on MacOS</figcaption></figure><p>Gemini became <a href="https://medium.com/gemini/securing-your-gemini-account-with-webauthn-b5f369b8beec">the world’s first crypto exchange and custodian to support the WebAuthn security protocol</a>, which allows the use of security keys for logging in. You can add security keys to your Gemini account like so:</p><ol><li>Under <strong>My Account</strong>, select <strong>Security Settings</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*M5gwQIIh_yM2theOhMG5zA.png" /></figure><p>2. Scroll down to <strong>Add Security Key</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JbLL32X03lLrn5Xwmw82BA.png" /></figure><p>3. Enroll any of the security key options mentioned <a href="https://medium.com/gemini/securing-your-gemini-account-with-webauthn-b5f369b8beec">in the article above</a>.</p><p>If you enroll <em>at least two</em> security keys, you can then select the <strong>Yes, only use Security Keys</strong> option. This ensures that you can only sign in to your Gemini account with your password and one of your security keys!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K4eiMYNQq4HmMmBsc_UpgA.png" /></figure><p>These 5 steps will improve your security posture dramatically.</p><p>Onward &amp; Upward,</p><p>Brandon</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b349e771b23c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breaking Down the Bitcoin Lightning Network: eltoo]]></title>
            <link>https://medium.com/@brandonarvanaghi/breaking-down-the-bitcoin-lightning-network-eltoo-c48554f5ae02?source=rss-771b82fd92bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/c48554f5ae02</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[announcements]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Brandon Arvanaghi]]></dc:creator>
            <pubDate>Thu, 25 Jul 2019 15:40:27 GMT</pubDate>
            <atom:updated>2019-07-25T16:11:09.465Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LbO4Pcux5Lf9BsJNsl4OZQ.png" /><figcaption>Image Credit: Eltoo Whitepaper</figcaption></figure><p>The Lightning Network is a Layer 2 solution that allows you to create micropayment channels with other Bitcoiners. It allows instant and trustless peer-to-peer transacting while limiting the amount of data needed on-chain.</p><p>In this post, I break down exactly how it works, as well as a newly proposed update protocol within it called <strong><em>eltoo</em></strong> (named after <em>L2</em>).</p><h3>Unidirectional Channels</h3><p>Unidirectional payment channels are the simplest to implement in the Lightning Network because money only flows in one direction. The most common use case is streaming money; for example, a micropayment for each minute of a video you watch.</p><p>Say you want to start such a channel with Netflix. First, you create a <strong>funding transaction</strong>, which is you locking up a certain amount of your money that you are willing to pay to Netflix (but have not yet paid them).</p><p>Say you fund this transaction with 10 Bitcoin and publish it on the Bitcoin blockchain. After being mined, this funding transaction can be spent by a 2-of-2 multisig consisting of your’s and Netflix’s keys.</p><p>As Netflix starts streaming you bytes of video, you start streaming them money — say .000001 Bitcoin per minute of video — via partially signed transactions that spend this funding transaction.</p><p>Using the funding transaction as input, you create two new outputs: one sending .000001 to Netflix, and the other 9.999999 to you. You sign this transaction and share it with Netflix off-chain (that is, without attempting to publish it to the Bitcoin blockchain). This transaction is considered “partially signed” because it only contains one of the two signatures necessary to spend.</p><p>When Netflix receives this partially-signed transaction, they are in control. Netflix can choose to claim that .000001 Bitcoin immediately, and in the process send the remaining 9.999999 Bitcoin back to you, by adding their signature to the partially signed transaction and publishing it. This is considered <em>closing the channel</em> or a <em>settlement</em>.</p><p>Instead, Netflix will continue streaming you video so long as you keep providing larger partially signed transactions every minute. <br>After another minute, you send Netflix another partially signed transaction using the same funding transaction as the input. This new partially signed transaction would send .000002 Bitcoin to Netflix (to reflect the two minutes of watch time), and 9.999998 Bitcoin to you. You keep doing this every minute.</p><p>With unidirectional payment channels, there’s no possibility of cheating. If you stop sending Netflix partially signed transactions every minute for higher amounts each time, Netflix will stop streaming you video. They will sign the most recent partially signed transaction you sent them (which entitles them to the most Bitcoin), publish it, and thus close the channel.</p><p>Furthermore, there’s no risk of anyone publishing an “outdated” transaction. Netflix is the only one capable of spending any of the partially signed transactions (since Netflix has your signatures, but you don’t have any of theirs), and every newer partially signed transaction you send Netflix is strictly better for them than any older one. Netflix can only cheat <em>itself</em> by publishing an earlier transaction.</p><p>When money flows in both directions, this gets trickier. Both parties can publish transactions, so incentives exist to publish an outdated transaction.</p><h3>The Problem with Bidirectional Channels</h3><p>Say Alice and Bob open up a payment channel and each lock up .5 Bitcoin in the funding transaction. Now, Alice agrees to pay Bob .1 BTC for a carwash. She sends Bob a partially signed transaction that uses the funding transaction as its input with two outputs: one that sends .4 BTC to her, and one that sends .6 BTC for Bob.</p><p>By not publishing this transaction, Bob keeps their channel open. He later agrees to pay Alice .3 BTC for a painting.</p><p>If Bob sends Alice a partially signed transaction that uses the funding transaction as its input, they will each be in possession of a different, yet valid, spend of the same funding transaction. Transactions have no expiration date in Bitcoin, so their transactions will be valid forever.</p><p>It doesn’t matter if they keep sending partially signed transactions back and forth for other goods and services. Either of them can act maliciously by publishing any earlier transaction that entitled them to more Bitcoin, thereby closing the channel, and making all other signed transactions invalid.</p><p>Bidirectional channels need a way to <em>invalidate outdated transactions</em> so that only the <em>most</em> <em>recent</em> <em>signed transaction</em> can be used to close the channel. That’s where <em>eltoo</em> comes in.</p><h3>eltoo</h3><p>Bidirectional payment channels in the Lightning Network work out-of-the-box today because the <a href="https://lightning.network/lightning-network-paper.pdf">whitepaper</a> created a working protocol to invalidate outdated transactions. This protocol, named <em>LN-Penalty</em>, penalizes participants who try to publish outdated transactions by allowing the other party to steal the cheating party’s Bitcoin.</p><p>Though LN-Penalty works today, it has problems. Besides its complexity, edge cases exist where it risks accidentally penalizing an honest user. <a href="https://blockstream.com/eltoo.pdf"><em>eltoo</em></a><em> </em>is not yet usable because it relies on a proposed signature scheme <a href="https://github.com/bitcoin/bips/blob/master/bip-0118.mediawiki"><strong><em>SIGHASH_NOINPUT</em></strong></a><strong><em> </em></strong>which has yet to be adopted, but because it is not penalty-based, there’s no risk of losing your funds.</p><p>In eltoo, the two parties create the funding transaction denoted by <strong>Setup</strong> in the diagram below. The funding transaction could contain Bitcoin from both parties, because we anticipate money flowing in both directions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*USwvkUzr2-EHHkImnYz6gw.png" /><figcaption>Each circle represents a transaction output. Diagram from the eltoo whitepaper.</figcaption></figure><p>Before signing the funding transaction, Alice and Bob first sign a <em>settlement transaction </em>(<strong>Ts,0</strong> in the above diagram) which refunds the Bitcoin in the funding transaction to each appropriate party. In eltoo, the term “settlement transaction” describes any transaction that distributes funds back to the participants, rather than to a multisig output that they both control.</p><p>After they sign the first settlement transaction, the parties can safely sign the funding transaction. The locking script for the funding transaction looks as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*uwZjVnlT4wPXjWHP11YXyw.png" /><figcaption>Locking script for the funding transaction, and any other update transaction. Image from the eltoo whitepaper.</figcaption></figure><p>There are two ways to spend the funding transaction: one in the <em>IF</em> branch, and one in the <em>ELSE</em> branch. These two branches rely on two separate sets of keys: the <em>IF </em>branch requires<em> settlement keys</em>, and the <em>ELSE</em> branch requires <em>update keys</em>. The two parties, Alice and Bob, each control one key from both sets of keys.</p><p>You’ll notice that the settlement branch of this locking script contains <strong>10 OP_CSV</strong> (short for <strong><em>OP_CHECKSEQUENCEVERIFY</em></strong>) as its first instruction. Any transaction attempting to spend this funding transaction by unlocking the <em>IF</em> branch can only do so if 10 blocks have passed from when the funding transaction entered the blockchain. If Alice and Bob exchanged signatures for the settlement transaction, then published the funding transaction to the Bitcoin blockchain, then published that settlement transaction, it would take 10 blocks before their settlement transaction could be mined to give them control of their respective funds.</p><p>Instead of publishing the settlement transaction, Alice and Bob keep the channel open. Say Alice wants to send 1 Bitcoin to Bob, so their new balances are 4 Bitcoin for Alice, and 6 Bitcoin for Bob.</p><p>The first thing Alice and Bob do is exchange signatures for a <em>new</em> settlement transaction. This new settlement transaction will pay 4 Bitcoin to an address only Alice controls, and 6 Bitcoin to an address only Bob controls.</p><p>Here’s the key point of eltoo: this new settlement transaction does not spend from the same funding transaction. Instead, it spends the output of a transaction Alice and Bob have yet to make: an <em>update</em> <em>transaction</em>.</p><p>An update transaction’s purpose is effectively to double-spend the funding transaction, so that the original settlement transaction (that Alice and Bob both signed, which had a block delay of 10 blocks), becomes unusable.</p><p>Recall the locking script of the funding transaction:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*uwZjVnlT4wPXjWHP11YXyw.png" /><figcaption>The locking script from the funding transaction</figcaption></figure><p>While the settlement branch has a 10 block delay, the <em>update</em> branch does not. If Alice and Bob ever exchanged signatures from their respective <em>update keys</em>, they could spend the funding transaction by unlocking its update branch well before the settlement transaction they signed ever could.</p><p>After Alice and Bob sign the new settlement transaction that sends 4 Bitcoin to Alice and 6 to Bob with their settlement keys, they exchange signatures from their update keys to create the update transaction. With that, the old settlement transaction that refunded their initial balances becomes irrelevant, and the new settlement transaction — which spends the update transaction — is the only one that can issue payouts.</p><p>This process of creating update transactions and settlement transactions can continue like this indefinitely, as the image from earlier showed. The most recent settlement transaction <strong><em>Ts,i </em></strong>is the only one that matters, because Alice and Bob have signed a chain of immediately-publishable update transactions that guarantee none of the earlier settlement transactions could take effect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*USwvkUzr2-EHHkImnYz6gw.png" /><figcaption>Each circle represents a transaction output. Diagram from the eltoo whitepaper.</figcaption></figure><p>You’ll notice that while this proposed model works, it requires every intermediary update transaction to be published on-chain. This defeats the purpose of the Lightning Network, which transacts off-chain to keep on-chain data light.</p><p>That’s where <strong><em>SIGHASH_NOINPUT</em></strong> comes in. Instead of having to publish the entire sequence of update transactions all the way to your most recent settlement transaction, <strong><em>SIGHASH_NOINPUT</em></strong><em> </em>allows you to skip over all update transactions until the one you need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*2aMCUL09rzdMZCXXPty2XQ.png" /><figcaption><em>SIGHASH_NOINPUT allows “binding” to any earlier transaction.</em></figcaption></figure><p>Though an output’s locking script can dictate that a <em>specific set of keys</em> must provide a signature to spend it, it does not dictate <em>what that signature must contain</em>. Usually,<strong> </strong>you sign every input and output in your transaction, and inform Bitcoin nodes that you have done this by appending the <strong><em>SIGHASH_ALL</em></strong> flag next to your signature. This means that you are announcing to every Bitcoin node that your transaction should only be considered valid if the specific combination of inputs and outputs contained in your signature are present in your transaction. If any other combination — a different input, an output with a slightly different value, etc. — appeared than what you signed, you are telling Bitcoin nodes to consider your transaction invalid.</p><p>With <strong><em>SIGHASH_NOINPUT</em></strong>, you can instead create a “free floating” transaction. You are announcing to Bitcoin nodes examining your transaction that you <em>don’t care what the input</em> to your transaction is — you only care about the output. That means that your signature will be valid on <em>any unspent output</em> that required those specific keys to spend. You don’t care <em>which</em> unspent output you’re spending — you’re OK with spending any of them.</p><p>As in the diagram above, using the <strong><em>SIGHASH_NOINPUT</em></strong> flag allows us to bind the last update transaction to the funding transaction. The last update transaction has already been signed, and though it initially pointed its input to spend the update transaction just before it, we can change which unspent output it spends without making the signature invalid because we explicitly state that the input is not part of or relevant to our signatures. All other intermediate update transactions can safely be skipped.</p><p>Thus, only three transactions must be published by the end of the channel: the funding transaction, the last update transaction, and the last settlement transaction which distributes the final balances to each party by spending that last update transaction.</p><h4>Issue with Ordering</h4><p>You might notice that free floating update transactions present an issue. If the last update transaction can bind to to any earlier update transaction (including the funding transaction), then the opposite is true: any of the earlier update transactions can bind to the last update transaction as well. This would nullify the last settlement transaction!</p><p>To address this, eltoo cleverly invokes the concept of <em>state numbers</em> in its locking scripts. This maintains an ordering between update transactions, such that update transactions can bind <em>backwards </em>indiscriminately, but not <em>forwards</em>. Again, the locking script on any of our update transactions looks as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*uwZjVnlT4wPXjWHP11YXyw.png" /><figcaption>The locking script from the funding transaction</figcaption></figure><p>The <em>ELSE</em> branch is for update transactions, and the first instruction is:</p><blockquote><strong>&lt;Si + 1&gt;</strong> <strong>OP_CHECKLOCKTIMEVERIFY</strong> [OP_CLTV for short]</blockquote><p><em>OP_CLTV </em>in an unspent output checks the <strong>nLockTime</strong> of the transaction that attempts to spend it. When you submit a transaction with an nLockTime<strong> </strong>of over 500,000,000, Bitcoin interprets it as a Unix timestamp. That is, the spending transaction won’t be mined until that timestamp is met. Any value less than that is treated as a minimum block height; that is, your transaction can’t be mined until the Bitcoin blockchain is <em>this tall</em>.</p><p>But there’s a clever trick here! If you make <em>nLockTime</em> greater than 0, less than 500,000,000, <em>and </em>less than the Bitcoin blockchain’s height, then any transaction you publish can be mined immediately. This defeats the purpose of using nLockTime to delay transactions from being mined, but we can use that entire range of values to create an ordering between our update transactions without arbitrarily delaying them from being mined.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*USwvkUzr2-EHHkImnYz6gw.png" /></figure><p>Say the funding transaction specified an <em>OP_CLTV </em>of 1. This means that the first update transaction, denoted by <strong>Tu,1</strong>, would need an nLockTime of at least 1, so Alice and Bob make sure the next update transaction has an nLockTime of 1. The output produced by the first update transaction would then specify an <em>OP_CLTV</em> of 2 in its locking script. The next would specify 3, and so on.</p><p>Now, if Alice and Bob tried to bind the first update transaction to a later output — say, the third output — the Bitcoin blockchain would reject it, because the first update transaction’s nLockTime is 1, while the third output has a locking script requiring an nLockTime of at least 3.</p><p>Although all of the update transactions are signed with <strong><em>SIGHASH_NOINPUT</em></strong>, no earlier update transactions could bind to a later update transaction, because the nLockTime would be below the required <em>OP_CLTV</em> in that output’s locking script. This protects the integrity of the last settlement transaction, denoted <strong>Ts,i</strong>.</p><p>Settlement transactions must also use <strong><em>SIGHASH_NOINPUT</em></strong><em>. </em>In the event the output it spends changes its input to point to the funding transaction (because the channel is closing), that output’s transaction ID would change, because the input of a transaction is part of what makes up a transaction ID. Thus, any settlement transaction needs to be able to change its input to reflect the new transaction ID without making its existing signature invalid.</p><p>However, you’ll notice the settlement branch of the locking script does not contain any concept of state numbers like the update branch does.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*uwZjVnlT4wPXjWHP11YXyw.png" /><figcaption>The locking script from the funding transaction, and any subsequent update transaction.</figcaption></figure><p>At first glance, it would seem this would cause the same problem we described earlier: old settlement transactions could be applied to future update transactions, producing a race condition to see which settlement transaction would be mined on-chain.</p><p>Instead of using state numbers, the solution here is that each settlement transaction uses a <em>different keypair</em> that gets <em>derived from the state number</em> of the output it spends. Thus, while the settlement transaction maintains the flexibility of changing the transaction ID in its input without invalidating its signature by using <strong><em>SIGHASH_NOINPUT</em></strong>, it can still only spend <em>that specific output </em>because the keypair from its signature <em>only unlocks that specific update transaction</em>. Thus, settlement transactions maintain a unique binding to a specific output by having a specific keypair that only works with that output.</p><h3>Wrapping Up</h3><p>Bidirectional state channels can be complex, but eltoo provides a simple, innovative way to implement them. I hope you enjoyed this view into the Lightning Network — stay tuned for similar posts!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c48554f5ae02" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 ways I can attack you  if you don’t use U2F.]]></title>
            <link>https://medium.com/@brandonarvanaghi/7-ways-i-can-attack-you-if-you-dont-use-u2f-eed42f5521ce?source=rss-771b82fd92bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/eed42f5521ce</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[two-factor-authentication]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[phishing]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Brandon Arvanaghi]]></dc:creator>
            <pubDate>Thu, 06 Jun 2019 15:04:32 GMT</pubDate>
            <atom:updated>2019-06-10T15:04:07.028Z</atom:updated>
            <content:encoded><![CDATA[<h3>7 ways I can attack you if you don’t use U2F.</h3><p>These are the 7 ways I can attack you if you use any form of two-factor authentication other than Universal Two-Factor (U2F).</p><h3>If you use SMS instead of U2F…</h3><p>SMS 2FA is arguably the weakest kind possible. Instead of the second-factor being tied to your physical device, it’s tied to your <em>phone number</em>.</p><h4><strong>Attack #1: Retrieving codes by attacking voicemail systems</strong></h4><p>Many services like Gmail and LinkedIn allow <em>SMS-based account recovery</em>. If you forget your password, you can receive a text to your phone with a code that allows you to log in.</p><p>Some services let you receive that code via <em>phone call</em> as well. A robot reads you the code in the call, and if you don’t answer, it goes to your voicemail.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZpZbTPYB3cU%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZpZbTPYB3cU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZpZbTPYB3cU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/38e18673949b595f3f8de1a8b8fe2adc/href">https://medium.com/media/38e18673949b595f3f8de1a8b8fe2adc/href</a></iframe><p>But voicemails are remotely accessible. If I know your voicemail PIN, I can access yours right now. By default, carriers set a default voicemail PIN<strong> </strong>for your phone, so if you haven’t explicitly set a PIN, yours is the default.</p><p>Attackers are waiting for you to sleep, sending the account recovery call to your phone, and when it reaches your voicemail, <strong>logging into your voicemail remotely </strong>and listening for the code. Once they have the code — voila, they’re in!</p><p>Affected services today include <strong>WhatsApp, LinkedIn</strong>, and others.</p><h4><strong>Remediation:</strong></h4><ol><li>Don’t have phone-based account recovery on <em>any </em>site. <br>For WhatsApp, you can’t avoid this, so you’ll need to enable the two-factor WhatsApp PIN setting.</li><li>Call your carrier and disable voicemail. If you don’t want to disable voicemail, at least set a voicemail PIN if you haven’t already.</li></ol><h4>Attack #2: Phone porting</h4><p>As described earlier, this is what phone-based account recovery looks like in Gmail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*6i6tOJfxfo0G1wMhFwTt1w.png" /><figcaption>SMS-based account recovery on Gmail</figcaption></figure><p>If you have SMS account recovery set, or SMS 2FA, you are vulnerable to <strong>phone porting</strong> as well.</p><p>An attacker calls your phone carrier, pretends to be you, and asks them to transfer ownership of your phone number to a SIM card they control. All your calls and SMS texts now go to the SIM card they control.</p><p>If this happens, and you have SMS-based account recovery anywhere, the attacker can click <strong>“Forgot password?”, </strong>receive the verification text/call to <em>their</em> phone, and successfully log in as you.</p><h4><strong>Remediation:</strong></h4><ol><li>Call your carrier and set a <strong>customer support PIN or passphrase </strong>while on the phone with the representative. Any future caller claiming to be you can only make changes to your account if they provide the correct PIN/passphrase over the phone.</li><li>Tell your carrier to <strong>lock your phone number to your SIM card,</strong> and to reject all requests to port your number to another SIM.</li><li>Instead of ever using your real phone number, use <a href="https://voice.google.com/u/0/voicemail"><strong>Google Voice</strong></a><strong> </strong>or <a href="https://fi.google.com/about/"><strong>Google Fi</strong></a><strong>. </strong>There are virtual phone numbers which can’t be ported, and have the same authentication protections as a Google account.</li><li>Set a voicemail PIN or call your carrier and disable it entirely.</li></ol><h4>Attack #3: <strong>Intercepting texts and calls via fake cell towers</strong></h4><p>Attackers can intercept your texts and calls by spoofing <a href="https://techcrunch.com/2019/02/24/new-4g-5g-security-flaws/">cell towers</a>. If someone knows your password, or eavesdrops your recovery code, they will get access to your account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qhhp4zxgrOl2vSSQ.jpg" /><figcaption>BlackHat demo of spoofing a cell tower</figcaption></figure><p>There are about a <a href="https://slate.com/technology/2015/10/government-stingray-surveillance-technology-can-record-calls-track-phones-intercept-texts.html">million</a> ways that cell towers can be spoofed, so I won’t spend too much time here.</p><h3>If you use an authenticator app (Duo, Google Authenticator, etc.) instead of U2F…</h3><p>Authenticator apps are tied to your <strong>physical device </strong>rather than your phone number.</p><p>Despite authenticator apps being better than SMS, you are still vulnerable.</p><h4>Attack #4: Multi-Device Support</h4><p>I said earlier that authenticator applications are tied to your physical device, so gaining control of someone’s phone number (by phone porting them, for example), does nothing.</p><p>However, many of these authenticator applications have “multi-device” support. Meaning, you can turn off this physical tying to your device, and make the codes follow your phone number, just like SMS.</p><p>When you enable multi-device support, your authenticator application becomes as weak as SMS.</p><h4>Remediations:</h4><ol><li>Disable multi-device support in your authenticator app.</li></ol><h4>Attack #5: Shoulder-Surfing for your Seed</h4><p>When you go to enroll an authenticator app on a site, the site will often present you a QR code to scan with that authenticator app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/0*kUMJe_fQkIy2Ri0r" /><figcaption>Example QR code scanning for authenticator app</figcaption></figure><p>If someone from over your shoulder scans this QR code as well, they will have access to all the same two-factor codes that your app generates forever.</p><p><strong>Remediations:<br></strong>1. Make sure nobody is nearby when you enroll your authenticator app to a site.</p><h3>Attacks that work on both SMS and authenticator apps…</h3><h4>Attack #6: “Real-Time” Phishing</h4><p>When you enter your password on a site like Gmail, it will ask for you second factor (whether SMS or an authenticator app).</p><p>But if you visit a <em>fake</em> Gmail site and enter your password there, the attacker can take your password and enter it into the <strong>real Gmail site</strong> with your username.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*e25PosuIxayz28lo.png" /><figcaption>An example of real-time phishing from FireEye’s “ReelPhish” tool. The consultant is the attacker.</figcaption></figure><p>What happens next? <strong>You </strong>will get a push/text to your phone with a verification code to enter, because the attacker just logged in to the real Google with your password.</p><p>The fake site would then either prompt for that code you received, or you would just accept the push request thinking that you’re logging into the real site. In reality, the attacker just logged in to the real Google, and you accepting the push (or providing the code) allowed them to do it.</p><p>Here’s a live demo of another real-time phishing tool doing just this:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F308709275%3Fh%3D5d361f1aa5%26app_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F308709275&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F749353683-128d2510087c0447649be3966f18f0802e2d54260ebe70ca079a2604214ff131-d_1280&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/2fc4d2dd013a450df946ffa59afeb93b/href">https://medium.com/media/2fc4d2dd013a450df946ffa59afeb93b/href</a></iframe><h4>Remediations:</h4><ol><li>Always double-check the URL of any site to which you provide your password.</li></ol><h4>Attack #7: Mobile malware</h4><p>Many variants of malware are designed for mobile phones. These variants can read sensitive data from your phone, like one-time codes. Any Android application, for example, can read and send SMS texts when given permission. iOS devices do not allow any app to replace the default messenger for reading and sending texts.</p><p>Mobile malware comes in many shapes and sizes. Some rely on the phone being jailbroken, and other times they jailbreak the phone themselves. At a high-level, a malicious application on your phone can steal one-time codes from the device.</p><h4>Remediations:</h4><ol><li>Be cognizant of what applications you run on your phone.</li><li>Limit the permissions you give applications installed on your phone.</li></ol><h3>Why is U2F better?</h3><p>The problem with one-time codes is that anyone, anywhere in the world, can enter them.</p><p>A U2F-capable device <strong>doesn’t provide</strong> <strong>one-time codes</strong><em> </em>for authentication; rather, it provides a cryptographic <em>signature</em> that can <em>only be produced</em> by that physical device. The private key material can never be extracted from the device, because it’s tied to the hardware.</p><p>Here’s a simplified image from <a href="https://developers.yubico.com/U2F/Protocol_details/Overview.html">Yubico</a> on how U2F prevents phishing by having the device sign the URI, and prevents man-in-the-middle attacks by also signing the TLS channel ID:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aoqIMzqzjGaeztDsjAApNQ.png" /><figcaption>What gets signed by a U2F device.</figcaption></figure><p>Furthermore, these U2F devices support a “test of user presence” — that is, they may require a <em>physical touch</em> of the device to release a signature. To this effect, malware on your system cannot authenticate to a site without your physical input.</p><p>In short: when you have U2F set up, an attacker would need physical access to your U2F-capable device. There isn’t a one-time code they can simply enter from anywhere in the world — they need the device itself to generate the signature!</p><h4>Use U2F as your second-factor for sites that support it, and never worry about getting phished on that site again.</h4><p><em>If you enjoyed this post, you can </em><a href="https://twitter.com/arvanaghi"><em>follow me on Twitter</em></a><em>, where I post more frequently.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eed42f5521ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Analyzing Trezor Firmware: Mnemonic Seed Generation for Bitcoin and Ethereum]]></title>
            <link>https://medium.com/@brandonarvanaghi/analyzing-trezor-firmware-mnemonic-seed-generation-for-bitcoin-and-ethereum-4b03fbaad24d?source=rss-771b82fd92bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b03fbaad24d</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Brandon Arvanaghi]]></dc:creator>
            <pubDate>Tue, 07 May 2019 14:27:55 GMT</pubDate>
            <atom:updated>2019-05-07T18:02:36.668Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://github.com/trezor/trezor-firmware/tree/master/crypto">Trezor’s firmware</a> is open-source. Its crypto library is used widely by companies like <a href="https://github.com/TrustWallet/wallet-core">TrustWallet</a> for generating wallets in Bitcoin and Ethereum. Let’s examine how the Trezor crypto library generates mnemonic seed phrases for Bitcoin and Ethereum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*yUEJStVaQfAbka4-wE2pTg.png" /><figcaption>An example mnemonic seed phrase.</figcaption></figure><p>If you’re not already aware, mnemonic seed phrases pull from a well-defined <a href="https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt"><strong>wordlist</strong></a> containing 2048 words. Secure mnemonic phrase generation is a function of <strong>how you index into that wordlist</strong> to select words from it<em>. </em>Since there are 2048 words, you need 11 bits to reach every possible word.</p><p>The first function the <a href="https://github.com/trezor/trezor-firmware/tree/master/crypto">Trezor firmware</a> calls to generate a mnemonic seed phrase is <strong>mnemonic_generate()</strong>, which accepts a <em>strength </em>(the amount of entropy to encode, where 256 bits produces a phrase of 24 words). This function ultimately returns the character array which is your mnemonic seed phrase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*yzeIn7FVpDuAp-dYPrsLgA.png" /><figcaption>The first function called in generating the mnemonic phrase</figcaption></figure><p><em>uint8_t data[32] </em>gets passed to the <strong><em>random_buffer</em>()</strong> function, whose job is to populate it with <strong>randomly generated bytes</strong>.</p><p>The <strong><em>random_buffer()</em></strong> function looks as follows, where <em>uint8_t *buf </em>is our <em>data</em> array<em>, </em>and <em>size_t len</em> its length (32).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ajdloyray8KMNicycoHoyA.png" /><figcaption>random_buffer() function</figcaption></figure><p>Since each index in the array stores 8 bits, every 4 indices store 32 bits. The <em>for </em>loop shows that that every 4 indices into the array, we assign variable <em>r</em> the return value of the <strong><em>random32()</em></strong> function, whose job it is to return a random 32-bit value.</p><p>This<em> </em><strong><em>random32()</em></strong> function is the last function called in the Trezor library for generating randomness. Whatever <strong><em>random32() </em></strong>does — whether it returns the same 32 bits every time, or pulls from a cryptographically secure random number generator — is what will be used to select words for the BIP39 wordlist.</p><p>By default, the <a href="https://github.com/trezor/trezor-firmware/blob/master/crypto/rand.c#L36"><em>rand.c</em></a> file containing the <strong><em>random32()</em></strong><em> </em>function states:</p><pre>#pragma message( \    &quot;NOT SUITABLE FOR PRODUCTION USE! Replace random32() function with your own secure code.&quot;)</pre><pre>// The following code is not supposed to be used in a production environment. It&#39;s included only to make the library testable.<br>// The message above tries to prevent any accidental use outside of the test environment.<br>//<br>// You are supposed to replace the random8() and random32() function with your own secure code. There is also a possibility to replace the random_buffer()function as it is defined as a weak symbol.</pre><p>Thus, the Trezor library mandates <em>you</em>, the user of the library, to supply your own source of randomness by overwriting the function definition of <strong><em>random32()</em></strong>.</p><p>To this effect, the <a href="https://github.com/trezor/trezor-firmware/blob/master/crypto/rand.c#L44">default implementation of <em>random32()</em></a> in the Trezor firmware repository is not suitable for production use. It produces predictable numbers, yielding the same seed phrase every time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NppWThW7kBeSoROT5W_DIg.png" /><figcaption>The default implementation of random32(), left to the user to change.</figcaption></figure><p>Assuming you replace this function with a cryptographically secure random number generator, we can re-examine the <strong><em>random_buffer() </em></strong>function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ajdloyray8KMNicycoHoyA.png" /><figcaption>random_buffer() function</figcaption></figure><p>The line at the bottom copies the random 32-bit value assigned to r into the <em>buff </em>array one byte at a time.</p><pre>buf[i] = (r &gt;&gt; ((i % 4) * 8)) &amp; 0xFF;</pre><p>Let’s walk through one iteration:</p><p>When i = 0 , r (the random 32-bit value) is <em>right shifted </em>by ((i % 4) * 8) bits, which is((0) * 8) or 0 bits. The result of that is AND&#39;d with 0xFF , which always results in the <em>last byte</em> of whatever you areAND’ing being kept.</p><p>Thus, when i = 0, the <em>last byte</em> of that random 32-bit value is placed in index 0 of the <em>buf </em>array. When i = 1, that 32-bit random value is right shifted by <em>8 bits</em>, then AND’d with 0xFF. This means buff[1] will contain the <em>second-to-last-byte </em>of that random value. This continues until the full 32-bit value is stored in indices 0–3, and a new random 32-bit value is picked when i = 4.</p><p>After <strong><em>random_buffer()</em></strong><em> </em>returns the array of random 32-bit values,<em> </em>we proceed to <strong><em>mnemonic_from_data()</em></strong>, which accepts that array and its length (32).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yS0ZcAsKXGn_5JUFk5V7NA.png" /><figcaption>mnemonic_from_data() function, which takes random bytes and returns the mnemonic phrase.</figcaption></figure><p>This function first creates a byte array called <em>bits</em> of length <em>32 + 1 </em>(33). This array, along with the <em>data </em>array and its length, get passed to the <strong><em>sha256_Raw()</em></strong> function, which generates a SHA256 hash of the random bytes in the <em>data</em> array and places it inside of the newly created <em>bits </em>array<em>.</em></p><p>After that function returns, you see the line:</p><pre>// checksum<br>bits[len] = bits[0]</pre><p>You’ll notice the <em>bits</em> array is of size 32 + 1. That 33rd byte (index 32 in the array) becomes part of the data used to select the 24th word of the mnemonic phrase.</p><p>When generating a 24 word mnemonic seed phrase, the 24th word is not selected like the previous 23. Instead, part of it comes from a <em>checksum</em> of the other 23 words. Specifically, the <em>first byte </em>of the checksum of the 32 random bytes we generated gets appended to the end of that array. To that effect, bits[len] gets assigned the value of bits[0], which is the first byte of the checksum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/0*-g4rhE_pVnNVCRNW.png" /><figcaption>Diagram showing how the checksum is appended, from <a href="https://github.com/ethereumbook/ethereumbook/blob/develop/05wallets.asciidoc">Andreas Antonopolous’s “Mastering Ethereum”</a></figcaption></figure><p>The next line copies the 32 bytes of random data from the <em>data </em>array into the first 32 indices (indices 0 through 31) of the <em>bits </em>array.</p><pre>// data<br>memcopy(bits, data, len)</pre><p>Now, the <em>bits</em> array contains the random 32 bytes we generated earlier in indices 0–31, and the first byte of their checksum in index 32. This is 33 bytes total, which is also 264 bits.</p><p>As I mentioned earlier, we need 11 bits to be able to select any word from a wordlist containing 2048 words. Dividing the 264 bits of data we have from the 11 bits-per-word requirement gets you <strong>24 words</strong> . Thus, we have all the data we need to create our randomly-selected 24 word mnemonic phrase.</p><p>The next section in this function is how the Trezor firmware converts our <em>bits </em>array into indices in the wordlist:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NRb5xbpOCPOoMsPMcSHImQ.png" /></figure><p>The Trezor team named the byte array <em>bits </em>because it is treated as a <em>grouping of 11 bits at a time</em>. Each 11 bits represents one index into the BIP39 wordlist.</p><p>The outer loop goes from 1 to <em>mlen</em>, which was declared earlier as the length of our mnemonic phrase, 24. The inner loop iterates 11 bits at a time, converting them into an integer value by growing the variable idx. That variable is then used to select a word from the wordlist.</p><p>When i = 0 (that is, we’re selecting the first word of our mnemonic), idx is first set to 0. In the inner loop, j = 0, meaning we are evaluating the first bit of the first 11 bits in the <em>bits</em> array.</p><p>The first thing we see is idx &lt;&lt;= 1. This is a left shift assignment operator, which means to left-shift idx by one bit, and then store the result back in idx. A simpler explanation: you are multiplying idx by 2. I’ll explain why this is being done shortly.</p><p>The next line is more involved. Before reading any further, understand that the reason this next line exists is because we are trying to examine an array where each index is only 8 bits long <em>11 bits at a time</em>.</p><p>The <em>bits</em> array might look as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*JesbkbwXDghW1NoZS4jemg.png" /><figcaption>What the <em>bits array might look like.</em></figcaption></figure><p>But, since we want to treat this array as groupings of 11 bit indices, a full index spills across multiple elements in the <em>bits </em>array:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*m_fi4qT6onQ4SDJCJDvcnQ.png" /><figcaption>Considering 11 bits at a time from the byte array called bits</figcaption></figure><p>Keeping that in mind, the line is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4tnZHBSkAQvqS7MUxI4QCg.png" /><figcaption>Checking whether to add 1 to <strong>idx</strong>.</figcaption></figure><p>The first part of this equation is bits[(i * 11 + j) / 8 ]. This returns the <em>byte </em>in the <em>bits[]</em> array that contains the specific bit we are examining. Here’s how that works:</p><p>Since each index is represented by 11 bits, i * 11 + j represents the “absolute index” of the <em>bit</em> being examined. There are 264 total bits in this array. If i = 0 and j = 5, this portion of the equation returns bits[(0 * 11 + 5 / 8)] = bits[5 / 8] = bits[0] , the byte where the 6th bit lives.</p><p>We AND that specific byte with the result of the right side of the &amp; operator, which creates a different byte from scratch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4tnZHBSkAQvqS7MUxI4QCg.png" /><figcaption>The same equation from earlier</figcaption></figure><p>This new byte being created on the right side of the &amp; will be all 0&#39;s <em>except</em> for the specific bit we are examining, denoted by j.</p><p>The <em>right side</em> of the &amp; looks as follows:</p><pre>1 &lt;&lt; 7 - ((i * 11 + j) % 8)</pre><p>This takes the <em>absolute index</em> of the bit in i * 11 + j, finds out <em>how far into a specific byte it would be </em>by doing % 8, then subtracts this value from 7 and right-shifts 1 by that many bits. The intention is to find how many 0 bits need to be added to the right of this 1 bit to create a <strong>new byte</strong> that has that specific 1 bit lining up exactly where the bit we are examining in the byte returned from the left side of &amp;.</p><p>We saw how plugging in i = 0 and j = 5 returns bits[0] on the left side of the &amp;. Let’s assume bits[0] is 0b00101000</p><p>Plugging in those i and j values into the right side of the &amp; gets you:</p><pre>1 &lt;&lt; (7 - ((0 * 11 + 5) % 8) <br>= 1 &lt;&lt; (7 - (5 % 8))<br>= 1 &lt;&lt; 7 - (5) <br>= 1 &lt;&lt; 2<br>= 0b00000100 // A different byte created from scratch</pre><p>We created a new byte from scratch, with a 1 bit in index 5 (the 6th bit in the byte).</p><p>Now, we can finally &amp; the left and right sides:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4tnZHBSkAQvqS7MUxI4QCg.png" /><figcaption>The same equation from earlier</figcaption></figure><p>The left side was 0b00101000. The right side is 0b00000100.</p><pre>0b00100100 // bits[0]<br>AND<br>0b00000100 // The byte created from scratch, with a &quot;1&quot; at bit &quot;j&quot;<br>=<br>0b00000100 </pre><p>If this AND operation produces a byte of all 0s, we know that bit was not set in the <em>bits</em> array (the byte being examined in the left side of the &amp;). If the result is not all 0s, we know that a 1 <em>was</em> present at that location in the <em>bits</em> array.</p><p>In our case, that result was <em>not</em> all 0s, meaning the bit being examined from the <em>bits</em> array <em>was </em>set to 1. The result of this &amp; is a value greater than 0, meaning the final check from the far right of the equation &gt; 0 evaluates to 1 (or true).</p><p>Since the &gt; 0 check evaluated to 1, idx gets incremented by 1. The inner j loop proceeds for each remaining bit in the 11 bits we are considering.</p><p>The line idx &lt;&lt;= 1 from earlier should make more sense now. Every time a bit is present in the <em>bits</em> array, 1 is added to idx. That 1 needs to go into its appropriate location within idx.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*m_fi4qT6onQ4SDJCJDvcnQ.png" /><figcaption>Considering 11 bits at a time from the byte array called bits</figcaption></figure><p>If the 0th bit of the 0th word is set to 1, then that 1 really represents 2¹⁰. If the 3rd bit is set, like in the image above, it really represents 2⁸. This idx &lt;&lt;= 1 converts the binary representation of these 11 bits into an integer by using the inner j loop to multiply idx by 2 as many times as needed.</p><p>After the j loop terminates, the final step is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*ctcvUAH7l7GGY-AiIrFzkA.png" /><figcaption>Extracting the word from the wordlist</figcaption></figure><p>This takes the integer produced from the 11 bits and uses it to index into wordlist. That word gets copied to p, a pointer to the start of the character array declared earlier to store the mnemonic.</p><p>p gets incremented by however long that word was in the line p += strlen(wordlist[idx]). If this was not the 24th word, a space ( &#39; &#39;) is added to p to visually separate this word from the next word in the mnemonic when it gets returned to the user. If it was the 24th word, a 0 is added, denoting the end of the string.</p><p>After i and j build 24 indices by iterating over this array 11 bits at a time, the mnemonic phrase is generated returned to the user.</p><h3>Conclusion</h3><p>The path I outlined in this post works as expected. With that said:</p><ul><li>It is ill-advised to provide a default implementation of a cryptography library that is completely insecure. The <a href="https://github.com/trezor/trezor-crypto/commit/2e528be1e91dd48c0e55061fbdd40ccf8b285559#diff-3cae848a08a60df6ce58009d57ae3172">git history</a> shows that <em>random32()</em> at one time pulled from /dev/urandom, and another time used a predictable timestamp as the seed. Throwing an exception is the <em>only</em> correct option here, regardless of allowing users to “test” the library out of the box.</li><li>The code I showed to generate 11-bit indices is wildly inefficient. It does tens of operations to iterate <em>bit-by-bit</em> what could easily be done <em>word-by-word</em> in memory, masking 11 bits at a time. This is strangely juxtaposed with explicitly using a left-shift assignment operator, when any modern compiler would optimize a more readable multiplication by 2.</li></ul><p>The <a href="https://github.com/trezor/trezor-crypto/commits/master/bip39.c">git history</a> was interesting to look through. I encourage you to read through it yourself.</p><p><em>If you enjoyed this post, you can </em><a href="https://twitter.com/arvanaghi"><em>follow me on Twitter</em></a><em>.</em></p><h3>Brandon Arvanaghi on Twitter</h3><p>BLOG] @Trezor&#39;s firmware is open-source, and its libraries used widely. But I haven&#39;t seen *any* actual analysis of their codebase. I examined how they generate mnemonic seed phrases for Bitcoin and Ethereum. https://t.co/q52Cstus6o</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b03fbaad24d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s inside a Grin Transaction File?]]></title>
            <link>https://medium.com/@brandonarvanaghi/whats-inside-a-grin-transaction-file-f062a0dcbf99?source=rss-771b82fd92bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f062a0dcbf99</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[grin]]></category>
            <category><![CDATA[mimblewimble]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Brandon Arvanaghi]]></dc:creator>
            <pubDate>Wed, 06 Mar 2019 14:16:41 GMT</pubDate>
            <atom:updated>2019-03-25T23:58:36.687Z</atom:updated>
            <content:encoded><![CDATA[<p>Unlike other cryptocurrencies, Grin does not use <em>addresses</em>. To send or receive Grin, the sender and recipient must send information back-and-forth between one-another.</p><p>One way to do this is through a <strong>file</strong>.<strong> </strong>This file can be shared over a period of seconds, days, years, or anything else.</p><p>Let’s examine the contents of this Grin transaction file as it gets passed around.</p><p>Before reading this post, I recommend reading “<strong>Grin Transactions Explained, Step-by-Step</strong>” to understand some of these fields.</p><h3>Brandon Arvanaghi on Twitter</h3><p>BLOG] Everyone is excited about Grin and MimbleWimble. But there&#39;s very little out there explaining how it works! Here&#39;s a post I wrote explaining *exactly* how Grin transactions work, step-by-step. (cc @grinMW) https://t.co/FSGyGIEo0R</p><h3>Exploring Grin Transaction Files</h3><p>Say you want to send 10.25 Grin to Bob, and you two want to exchange the necessary information for this transaction through a file. You run:</p><p>grin wallet send -m file -d my_grin_transaction.tx 10.25</p><p>This generates a file called my_grin_transaction.tx which you need to send to Bob so he can provide you his <em>response</em> file.</p><p>Let’s open this my_grin_transaction.tx file.</p><pre>{<br> &quot;num_participants&quot;: 2,<br> &quot;id&quot;: &quot;56709cfe-8584-4a02-b94e-bb7e79cfae66&quot;,<br> &quot;tx&quot;: {<br>  &quot;offset&quot;: [62, 48, 100, 178, ...],<br>  &quot;body&quot;: {<br>   &quot;inputs&quot;: [{<br>    &quot;features&quot;: &quot;Plain&quot;,<br>    &quot;commit&quot;: [8, 95, 99, 251, ...]<br>   }],<br>   &quot;outputs&quot;: [{<br>    &quot;features&quot;: &quot;Plain&quot;,<br>    &quot;commit&quot;: [8, 216, 52, 10, ...],<br>    &quot;proof&quot;: [13, 107, 82, 188, ...]<br>   }],<br>   &quot;kernels&quot;: [{<br>    &quot;features&quot;: &quot;HeightLocked&quot;,<br>    &quot;fee&quot;: 8000000,<br>    &quot;lock_height&quot;: 22023,<br>    &quot;excess&quot;: [0, 0, 0, 0, ...],<br>    &quot;excess_sig&quot;: [0, 0, 0, 0, ...]<br>   }]<br>  }<br> },<br> &quot;amount&quot;: 10250000000,<br> &quot;fee&quot;: 8000000,<br> &quot;height&quot;: 22023,<br> &quot;lock_height&quot;: 22023,<br> &quot;participant_data&quot;: [{<br>  &quot;id&quot;: 0,<br>  &quot;public_blind_excess&quot;: [2, 66, ...],<br>  &quot;public_nonce&quot;: [2, 102, ...],<br>  &quot;part_sig&quot;: null,<br>  &quot;message&quot;: null,<br>  &quot;message_sig&quot;: null<br> }]<br>}</pre><p>In order, we have:</p><ul><li><strong>num_participants</strong>: The number of people involved in this transaction. Alice to Bob means 2 participants. Alice to Bob and Charlie means 3.</li><li><strong>id</strong>: A unique identifier for this transaction. This allows us to keep track of the transaction when we receive a file back from Bob.</li></ul><p>Next, we have a <strong>tx </strong>object, short for <em>transaction</em>. This consists of:</p><ol><li>A <em>kernel offset</em> (named <strong>offset</strong> here)<em>.</em></li><li>A <em>body </em>object, containing the <strong>inputs</strong> to be spent in this transaction transaction, the <strong>outputs</strong><em> </em>for this transaction (currently, just our change), and the transaction <strong>kernel</strong><em>.</em></li></ol><p>Let’s dive into these.</p><ul><li><strong>offset</strong>: The <a href="https://github.com/mimblewimble/grin/blob/master/doc/intro.md#kernel-offsets">kernel offset</a>. This is a random value we choose to subtract from our <em>blinding factor </em>to make it more difficult for anyone to track this transaction on the blockchain.</li></ul><p>Next in this <em>tx</em> object is the <strong>inputs </strong>object. This object contains information about the <em>output we are spending </em>in this transaction.</p><pre>&quot;inputs&quot;: [{<br>    &quot;features&quot;: &quot;Plain&quot;,<br>    &quot;commit&quot;: [8, 95, 99, 251, ...]<br> }],</pre><ul><li><strong>features</strong>: In this example, the <em>features</em> of the output we are spending (the <em>input </em>to this transaction<em>) </em>is set to “Plain<em>”</em>. This <em>features</em> variable can be either “Plain” or “Coinbase”.</li></ul><p>A <em>Coinbase</em> output was an output generated from a mining reward. A <em>Plain</em> output just means it was not a Coinbase output.</p><ul><li><strong>commit</strong>: The output we are trying to spend. An output in Grin is a <em>Pedersen Commitment</em>. To understand how these work, you can read the <a href="https://github.com/mimblewimble/grin/blob/master/doc/intro.md#transacting-with-mimblewimble">Grin wiki</a>.</li></ul><p>Still in the <em>tx</em> object, we move on to the <strong>outputs </strong>array.</p><pre>&quot;outputs&quot;: [{<br>    &quot;features&quot;: &quot;Plain&quot;,<br>    &quot;commit&quot;: [8, 216, 52, 10, ...],<br>    &quot;proof&quot;: [13, 107, 82, 188, ...]<br> }],</pre><p>You’ll notice this <strong>outputs</strong> array already has an output for our transaction. This is our <em>change output</em>. If we spend 10.25 Grin, and if we are only using one <em>input</em> in this transaction (as is the case here), then that<em> </em>input contains <em>at least </em>10.25 Grin. If this input consists of 20 Grin, for example, then this transaction also<em> </em>requires an output to send 9.75 Grin back to us!</p><p>Grin is unique in that Bob needs to be involved in any output that goes to him, and since we haven’t actually sent this file to Bob yet, we’re not ready to create that part of the transaction. Our change output has nothing to do with Bob, though, which is why we are already able to compute our <em>change output</em>.</p><p>Besides the <strong>features</strong> and <strong>commit</strong>, this output contains a <strong>proof</strong>. This is the <a href="https://eprint.iacr.org/2017/1066.pdf">range proof</a> for the output, and it proves that the amount of Grin in that output is <strong>non-negative</strong>. Range proofs allow us to cryptographically prove the output is non-negative without revealing what that output actually is.</p><p>The next portion of this transaction file is the <strong>kernels </strong>array.</p><pre>&quot;kernels&quot;: [{<br>    &quot;features&quot;: &quot;HeightLocked&quot;,<br>    &quot;fee&quot;: 8000000,<br>    &quot;lock_height&quot;: 22023,<br>    &quot;excess&quot;: [0, 0, 0, 0, ...],<br>    &quot;excess_sig&quot;: [0, 0, 0, 0, ...]<br> }]</pre><p>The <strong>transaction kernel</strong> also starts with the <em>features</em> variable. This part may be a little confusing: the <em>features</em> variable you see for any output is either “Plain” or “Coinbase”, as I explained earlier. But in the transaction kernel, the features variable can either be “Plain”, “Coinbase”, or “HeightLocked”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rPDlcdkfATR8dkS6AFCd_w.png" /><figcaption>The three different kinds of “features” in a transaction kernel: Coinbase, Plain, and HeightLocked</figcaption></figure><p>A “Plain” transaction means a <em>lock_height</em> of 0. In other words, once this transaction is broadcast to the network, it can be mined immediately. As soon as any Grin transaction is mined, its outputs can be spent. A <em>HeightLocked</em> transaction, in contrast, means that the transaction can’t be mined until a certain block number.</p><p>Once mined, the output will have a <em>feature</em> of either “Plain” or “Coinbase”, as we saw above, because the fact that it may have been <em>HeightLocked</em> before it was mined is no longer relevant.</p><pre>&quot;outputs&quot;: [{<br>    &quot;features&quot;: &quot;Plain&quot;,<br>    &quot;commit&quot;: [8, 216, 52, 10, ...],<br>    &quot;proof&quot;: [13, 107, 82, 188, ...]<br> }],</pre><p>Moving on, the transaction kernel also contains the <em>fee</em> and <em>lock_height</em>, the <em>kernel excess</em> (denoted here as <strong>excess</strong>), and the <em>signature</em> of the transaction (denoted here as <strong>excess_sig)</strong><em>.</em></p><p>We can’t yet compute the <em>excess </em>and <em>excess_sig</em> until we receive the response file back from Bob. This is why these arrays are both filled with 0s.</p><p>After the <em>tx </em>object, we have these remaining fields:</p><pre>&quot;amount&quot;: 10250000000,<br>&quot;fee&quot;: 8000000,<br>&quot;height&quot;: 22023,<br>&quot;lock_height&quot;: 22023,<br>&quot;participant_data&quot;: [{<br>  &quot;id&quot;: 0,<br>  &quot;public_blind_excess&quot;: [2, 66, ...],<br>  &quot;public_nonce&quot;: [2, 102, ...],<br>  &quot;part_sig&quot;: null,<br>  &quot;message&quot;: null,<br>  &quot;message_sig&quot;: null<br>}]</pre><ul><li><strong>amount</strong>: The amount of Grin being transferred, as a multiple of the atomic unit <em>1 nanoGrin</em>. A nanoGrin is one billionth of a Grin. Only the sender and recipient will ever see this amount.</li><li><strong>fee</strong>: The mining fee for the transaction, also as a multiple of 1 n<em>anoGrin</em>.</li><li><strong>height:</strong> The block number at which this transaction file was created.</li><li><strong>lock_height: </strong>The block number at which the outputs from this transaction become spendable. You’ll notice in this case, the lock_height is equal to the <em>height</em> variable, meaning this transaction can be mined immediately.</li></ul><p>Next, we have a <strong>participant_data </strong>array.</p><pre>&quot;participant_data&quot;: [{<br>  &quot;id&quot;: 0,<br>  &quot;public_blind_excess&quot;: [2, 66, ...],<br>  &quot;public_nonce&quot;: [2, 102, ...],<br>  &quot;part_sig&quot;: null,<br>  &quot;message&quot;: null,<br>  &quot;message_sig&quot;: null<br>}]</pre><p>This contains the information passed back-and-forth between the participants of the transaction. So far, this contains only <em>our </em>data, since we have not yet shared this file with Bob.</p><ul><li><strong>id: </strong>The participant’s ID in this transaction. An ID of 0 corresponds to the <em>sender</em> of the transaction, which is us.</li><li><strong>public_blind_excess</strong>: The commitment to the <em>sum of our blinding factors</em>. To understand what this is, you can read <a href="https://medium.com/@brandonarvanaghi/grin-transactions-explained-step-by-step-fdceb905a853">Grin Transactions Explained, Step-by-Step</a>.</li><li><strong>public_nonce</strong>: The commitment to our <em>nonce</em>. This is used to build the transaction signature. More information on this can again be found in <a href="https://medium.com/@brandonarvanaghi/grin-transactions-explained-step-by-step-fdceb905a853">Grin Transactions Explained, Step-by-Step</a>.</li><li><strong>part_sig:</strong> Our partial signature is empty, because we’re not able to create it until we receive data back from Bob.</li><li><strong>message: </strong>An extra “message” that <a href="https://github.com/mimblewimble/docs/wiki/Wallet-User-Guide#other-flags">can be added to your transaction</a>. If you create this file with a -g flag and put any arbitrary string afterwards, that message would appear here.</li></ul><p><strong><em>Note:</em></strong><em> when people generally refer to the “message” of a Grin transaction, they typically mean the transaction fee, if any, and the lock_height, if any. This extra “message” field is entirely separate: you can add a string to send to Bob, and vice-versa, that never gets published on-chain.</em></p><ul><li><strong>message_sig: </strong>The extra “message” field I just mentioned is signed by your <em>sum of all blinding factors</em>. That signature is placed here, and Bob can verify that message by using your commitment to your sum of all blinding factors. Bob can add his own extra <em>message</em> and <em>message_sig </em>to the file once he receives this file. We can verify his message the same way.</li></ul><p>We send this file to Bob, and await his <em>response </em>file in return.</p><h3>Bob’s Response File</h3><p>Bob accepts this file in his Grin client with the following command:</p><pre>grin wallet receive -I my_grin_transaction.tx</pre><p>This command generates a <strong>my_grin_transaction.tx.response </strong>file for Bob that he will send back to us.</p><p>Let’s open this file.</p><pre>{<br> &quot;num_participants&quot;: 2,<br> &quot;id&quot;: &quot;56709cfe-8584-4a02-b94e-bb7e79cfae66&quot;,<br> &quot;tx&quot;: {<br>  &quot;offset&quot;: [62, 48, 100, ...],<br>  &quot;body&quot;: {<br>   &quot;inputs&quot;: [{<br>    &quot;features&quot;: &quot;Plain&quot;,<br>    &quot;commit&quot;: [8, 95, 99, ...]<br>   }],<br>   &quot;outputs&quot;: [{<br>    &quot;features&quot;: &quot;Plain&quot;,<br>    &quot;commit&quot;: [8, 206, 65, ...],<br>    &quot;proof&quot;: [36, 101, 181, ...]<br>   }, {<br>    &quot;features&quot;: &quot;Plain&quot;,<br>    &quot;commit&quot;: [8, 216, 52, ...],<br>    &quot;proof&quot;: [13, 107, 82, ...]<br>   }],<br>   &quot;kernels&quot;: [{<br>    &quot;features&quot;: &quot;HeightLocked&quot;,<br>    &quot;fee&quot;: 8000000,<br>    &quot;lock_height&quot;: 22023,<br>    &quot;excess&quot;: [0, 0, 0, ...],<br>    &quot;excess_sig&quot;: [0, 0, 0, ...]<br>   }]<br>  }<br> },<br> &quot;amount&quot;: 10250000000,<br> &quot;fee&quot;: 8000000,<br> &quot;height&quot;: 22023,<br> &quot;lock_height&quot;: 22023,<br> &quot;participant_data&quot;: [{<br>  &quot;id&quot;: 0,<br>  &quot;public_blind_excess&quot;: [2, 66, 3, ...],<br>  &quot;public_nonce&quot;: [2, 102, 201, ...],<br>  &quot;part_sig&quot;: null,<br>  &quot;message&quot;: null,<br>  &quot;message_sig&quot;: null<br> }, {<br>  &quot;id&quot;: 1,<br>  &quot;public_blind_excess&quot;: [3, 99, 72, ...],<br>  &quot;public_nonce&quot;: [3, 246, 48, ...],<br>  &quot;part_sig&quot;: [90, 35, 157, ...],<br>  &quot;message&quot;: null,<br>  &quot;message_sig&quot;: null<br> }]<br>}</pre><p>As we can see, this file is everything we sent to Bob, plus some of his own data he added on top of it.</p><p>In the <strong>participant data </strong>array, we see a new entry for a participant with an <strong>id </strong>of 1 (Bob). Bob adds his commitment to his blinding factor, along with his commitment to his nonce, and finally his partial signature.</p><h3>Finalizing the Transaction</h3><p>When we receive Bob’s response file, we run the following to <em>finalize</em> the transaction:</p><pre>grin wallet finalize -i my_grin_transaction.tx.response</pre><p>We don’t actually see the missing pieces filled in — instead, we see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*odlsW1wsCEiGGcv2-9bZCQ.png" /><figcaption><strong>grin wallet finalize </strong>command run successfully</figcaption></figure><p>We now has all the information we need from Bob to create his output and add it to the <strong>outputs</strong> array. Behind the scenes, our Grin client fills in the missing pieces (like <strong>excess</strong> and <strong>excess_signature</strong>), serializes this data into a byte array, and sends it across the Grin network for validation.</p><p>Soon, this Grin transaction will be mined, Bob will receive his 10.25 Grin, and we will receive our change.</p><p><em>If you enjoyed this post, follow </em><a href="https://twitter.com/arvanaghi"><em>@arvanaghi on Twitter</em></a><em>.</em></p><h3>Brandon Arvanaghi on Twitter</h3><p>BLOG] Everyone is excited about Grin and MimbleWimble. But there&#39;s very little out there explaining how it works! Here&#39;s a post I wrote explaining *exactly* how Grin transactions work, step-by-step. (cc @grinMW) https://t.co/FSGyGIEo0R</p><p><em>Thanks to </em><a href="https://github.com/GrinPlusPlus/GrinPlusPlus"><em>DavidBurkett</em></a><em> for reviewing.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f062a0dcbf99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Grin Transactions Explained, Step-by-Step]]></title>
            <link>https://medium.com/@brandonarvanaghi/grin-transactions-explained-step-by-step-fdceb905a853?source=rss-771b82fd92bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdceb905a853</guid>
            <category><![CDATA[grin]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[mimblewimble]]></category>
            <dc:creator><![CDATA[Brandon Arvanaghi]]></dc:creator>
            <pubDate>Tue, 26 Feb 2019 16:22:11 GMT</pubDate>
            <atom:updated>2019-03-25T23:56:29.578Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://grin-tech.org/">Grin</a> is an exciting new cryptocurrency leveraging the MimbleWimble protocol. But tutorials on Grin are notoriously nondescript.</p><p>This post aims to share <strong>exactly how </strong>Grin transactions work.</p><p>An <strong>output</strong> in Grin is a <strong><em>Pedersen Commitment</em></strong>. Any output will take the following form:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*qHqYcOzxKeA7aQBUGPykvA.png" /><figcaption>A Grin output, which is a Pedersen Commitment.</figcaption></figure><p>A Pedersen Commitment is a clever way to hide information. If this is your first time hearing about commitments, think “shielded value” any time you see that word.</p><p>The following, taken from the <a href="https://github.com/mimblewimble/grin/blob/master/doc/intro.md">Grin wiki</a>, is an excellent primer as to what’s happening here:</p><blockquote>If we pick a very large number <em>k</em> as a private key, k*H is considered the corresponding public key. Even if one knows the value of the public key k*H, deducing <em>k</em> is close to impossible...</blockquote><blockquote><em>• r</em> is a private key used as a blinding factor, <em>G</em> is a fixed point on the elliptic curve and their product r*G is the public key for <em>r</em> on <em>the curve</em>.</blockquote><blockquote><em>• v</em> is the value of an input or output and <em>H</em> is another fixed point on the elliptic curve...</blockquote><blockquote>(k+j)*H = k*H + j*H, with <em>k</em> and <em>j</em> both private keys, demonstrates that a public key obtained from the addition of two private keys ((k+j)*H) is identical to the addition of the public keys for each of those two private keys (k*H + j*H).</blockquote><p>A deeper dive into the cryptography can be found in this <a href="https://andrea.corbellini.name/2015/05/17/elliptic-curve-cryptography-a-gentle-introduction/">ECC primer</a>, but in short, to spend a Grin output you must know both the <strong>blinding factor (r) </strong>and the <strong>amount of Grin</strong> <strong>(v)</strong>. It’s impossible to deconstruct a commitment to deduce these values. You must know them ahead of time.</p><p>The blinding factor exists because whoever paid you this Grin would also know what <strong>v</strong> is (how much Grin they sent you). But only <em>you</em> — not even the sender of the Grin — would know the blinding factor for this output and therefore <em>only you</em> are able to spend this output.</p><p>Let’s say this output uses a blinding factor of 20, and this output consists of 40 Grin. (<strong>Note:</strong> Amounts of Grin are actually sent as multiples of the atomic unit <em>1 NanoGrin</em>. I use whole Grin for simplicity here.):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*jGRqzEHHHlB14D4aHbV6dA.png" /><figcaption>In this output, the blinding factor is 20, and the amount of Grin is 40.</figcaption></figure><p>If we look on a <a href="https://grinexplorer.net/block/00000317907f10bc6dd3101574d2d4412839602381ed4c5365aafe3f2771fd94">Grin blockchain explorer</a>, that output is not broken up neatly like above. Here is what a real Grin output, just like the one we created, looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kqUap2txRfj-ta27wITygg.png" /><figcaption>What a Grin output looks like (under the <em>Commit column).</em></figcaption></figure><p>Again, deducing “20” (the blinding factor) or “40” (the amount of Grin) from this output is impossible.</p><h3>Spending the Output</h3><p>Say the output we showed you belongs to Alice. Now, Alice wants to send 25 of those 40 Grin to Bob. We’ll ignore mining fees for simplicity.</p><p>If you have a 5 dollar bill and purchase something for 3 dollars, you get two dollars in change. Bitcoin transactions work like this, and Grin is no different. If Alice wants to send 25 Grin to Bob from her unspent output of 40 Grin, she will also create an output in this same transaction that goes back to herself for the remaining 15 Grin (her <em>change</em>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dIVmDE4RcDyOA2ZHZmmErA.png" /><figcaption>Alice identifies how much Grin she wants to send to Bob, and also her change.</figcaption></figure><p>This 15 Grin will go back to Alice, which means only she should be able to control it and spend it again. In other words, Bob shouldn’t be able to spend Alice’s change. To that effect, Alice must create a new blinding factor for her change output. Let’s say Alice picks <strong>34</strong>.</p><p>Alice, knowing both the <strong>r </strong>(the blinding factor for her change output) and the <strong>v </strong>(the amount of Grin, which is her change), has everything she needs to create her change output (<strong>co</strong>). This will be recorded on the blockchain as an output, just like the output Alice will soon generate to send 25 Grin to Bob.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nLlF8tpmjoywDYmEGJjt8A.png" /><figcaption>Alice’s change output.</figcaption></figure><p>As I mentioned earlier, to spend any output, you must know the blinding factor used in that output. Alice knows the blinding factor used in the output she wants to spend (20), but she needs a way to prove to the world that she knows it.</p><p>That’s why she needs to create an entirely separate calculation known as the <em>sum of her blinding factors</em>. This involves Alice taking the blinding factor she just created for her change output (34) and subtracting from it the blinding factor from the output she wishes to spend (20).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*MaLQ4m5yG_66RYvlv4Uhtw.png" /><figcaption>Alice’s sum of her blinding factors.</figcaption></figure><p><strong><em>rs </em></strong>(s for <em>sender</em>, who is Alice) is known as Alice’s <em>sum of all blinding factors</em>, and it equals <strong>14 </strong>in this case. (<strong>Note:</strong> I am intentionally leaving out kernel offsets).</p><p>The last thing Alice does is create a random nonce <strong>ks</strong> (<em>s</em>, again, for <em>sender</em>). She will use this random nonce to help build her signature for this transaction, which we will show later. Alice doesn’t send the actual nonce to Bob. Rather, she sends <strong><em>ks • G, </em></strong>which is a <em>commitment</em> to that nonce. As explained earlier, by multiplying the nonce by generator point <strong><em>G</em></strong>, Alice shields the value of the actual nonce.</p><p>Alice sends the following information to Bob. In practice, Grin data are not separated into “Metadata” and “Data” fields, but I do so here for clarity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*wIubZAkZHgPCEFp2_Yiv5w.png" /><figcaption>Everything Alice sends Bob in the first step of this Grin transaction.</figcaption></figure><p>The <strong>Metadata </strong>fields are:</p><ul><li><strong>Amount to send:</strong> The # of Grin Alice wants to send Bob (in this case, 25).</li><li><strong>TX UUID</strong>: A unique identifier Alice and Bob use to identify this transaction as they send data back and forth.</li><li><strong>TX fee: </strong>The transaction fee (which we will not cover in this tutorial).</li><li><strong>lock_height:</strong> The block number at which this transaction becomes valid.</li></ul><p>The <strong>Data </strong>fields are:</p><ul><li><strong>TX Inputs</strong>: The unspent output(s) Alice uses as inputs for her transaction to Bob.</li><li><strong>co</strong>: Alice’s change output.</li><li><strong>ks • G</strong>: Alice’s nonce <strong>ks</strong> becomes a <em>commitment </em>to that nonce when multiplied by generator point <strong><em>G</em></strong>.</li><li><strong>rs • G</strong><em>: </em>The sum of all of Alice’s blinding factors <strong>rs </strong>becomes a <em>commitment</em> to that value when multiplied by generator point <strong><em>G</em></strong><em>.</em></li></ul><p>Alice sends all of this to Bob, who proceeds with the next step.</p><h3>Bob’s Turn</h3><p>Upon receiving this data from Alice, Bob concatenates the <strong>TX fee</strong> and <strong>lock_height</strong> variables to create <strong>M</strong>, referred to as the “Message” of the transaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*g2agNid3qDrVlQH01L1PKw.png" /><figcaption>The “message” of the transaction.</figcaption></figure><p>Bob picks a blinding factor <strong>rr </strong>(r for <em>recipient</em>, in this case Bob) for the 25 Grin he expects to receive from Alice. Let’s say he chooses <strong>11</strong>. He also picks his own random nonce <strong>kr </strong>(r, again, for <em>recipient</em>).</p><p>Just like Alice did, Bob creates a <em>commitment to </em>both of these values by multiplying them each by generator point <strong><em>G</em></strong>. With these values, Bob generates the <strong>Schnorr challenge </strong>for the transaction, denoted by the variable <strong>e:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fhh761YDI3u2vQfza4UyzA.png" /><figcaption>The Schnorr challenge for the transaction.</figcaption></figure><p>In order, the Schnorr challenge consists of the SHA256 hash of:</p><ul><li>The message of the transaction.</li><li>The sum of the commitment to the nonces used by Alice and Bob.</li><li>The sum of the commitment to Bob’s blinding factor (for his output of 25 Grin) and Alice’s sum of all her blinding factors.</li></ul><p>Bob uses <strong>e</strong> to generate his <strong>Schnorr signature </strong>for the transaction, <strong>sr </strong>(<em>r</em> for <em>recipient</em>). Though it is the entirety of Bob’s signature, we call this Bob’s <em>partial </em>signature, because it will eventually be added to Alice’s <em>partial </em>signature to create the <em>signature</em> of the entire transaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*RKFMVC6KUjztDUfKwaarFw.png" /><figcaption>Bob’s partial signature for the transaction.</figcaption></figure><p>When Alice eventually receives <strong>sr</strong>, she will not be able to uncover the values <strong>kr</strong> or <strong>rr</strong> from it.</p><p>Bob sends the following back to Alice:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*Ez6bwxanfmqfD9HyY5KgsA.png" /><figcaption>Bob sends his partial signature, commitment to his nonce, and commitment to his blinding factor for his output back to Alice.</figcaption></figure><p>In order, this consists of:</p><ul><li><strong>sr: </strong>Bob’s partial signature.</li><li><strong>kr • G</strong>: Bob’s commitment to his nonce.</li><li><strong>rr • G: </strong>Bob’s commitment to his blinding factor for the 25 Grin he expects to receive.</li></ul><h3>Last Step: Back to Alice</h3><p>Alice now has everything she needs to also compute <strong>e</strong>, the Schnorr challenge for this transaction, locally. After having computed <strong>e </strong>locally, Alice can then <strong>validate Bob’s partial signature</strong>.</p><p>Bob’s partial signature <strong>sr</strong>, you’ll recall, consisted of the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*RKFMVC6KUjztDUfKwaarFw.png" /><figcaption>Bob’s partial signature for this transaction.</figcaption></figure><p>Based on the properties of elliptic curves we described earlier, Alice can introduce the generator point <strong><em>G</em></strong><em> </em>into both sides of the equation, and the equality will still hold true.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*OnlvcHKk_MAGwbDnst6TqA.png" /><figcaption>Alice multiples each side of the equation by generator point <em>G.</em></figcaption></figure><p>Since Alice received <strong>kr • G</strong> (Bob’s commitment to his nonce) and <strong>rr • G </strong>(Bob’s commitment to the blinding factor he will use for the 25 Grin he expects to receive) from Bob, and since she has already computed <strong>e </strong>locally, Alice can validate Bob’s partial signature <strong>sr</strong> by simply multiplying it by generator <strong><em>G</em></strong><em> </em>and making sure the right side of the equation equals that value.</p><p>In doing so, Alice has proven that:</p><ol><li>Bob knows how much Grin he will receive (25).</li><li>Bob knows his nonce.</li><li>Bob knows his blinding factor for the 25 Grin he expects to receive.</li></ol><p>… without Alice ever having known Bob’s nonce or the blinding factor he chose.</p><p>Alice then generates her own partial signature:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*HTLqp3Oa6f2N5EbI7dpzPw.png" /><figcaption>Alice generates her partial signature for the transaction.</figcaption></figure><p>Alice can now generate the <strong>signature</strong> of the transaction, which consists of both her and Bob’s <em>partial</em> signatures:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*1i9Rgo2Qwvxp0E49sNHuNg.png" /><figcaption>The signature of the transaction, consisting of the sum of Alice and Bob’s partial signatures and the commitment to their nonces.</figcaption></figure><p>In order, the <em>signature </em>includes:</p><ul><li>The sum of Alice and Bob’s partial signatures.</li><li>The sum of Alice and Bob’s commitment to their nonces (neither of them know the other’s true nonce).</li></ul><p>Condensed, this looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*9cQZq336fQNSJgqr82a0sg.png" /><figcaption>The signature for the transaction.</figcaption></figure><p>where s = ss + sr and k = ks + kr.</p><p>Remember this signature — it will make sense shortly.</p><h3>Completing the Transaction</h3><p>Digital money requires a “memory” — that is, when you send money to one person, you can’t send that exact same money to someone else. With Grin, we hide both the amount of Grin being sent and the recipients. So how can we prove no money was double-spent or printed out of thin air?</p><p>In a Grin transaction, when you subtract all the outputs from the inputs, the amount of leftover Grin should equal 0. Going back to our 5 dollar bill analogy, you have:</p><pre>3 dollars to cashier (output) + 2 dollars in change back to me (output) - 5 dollar bill (input) = 0</pre><p>In Grin, this same summation makes the <em>v </em>values sum to zero when a transaction is legitimate. But how can we prove that without revealing what the values are? Let’s look at the inputs and outputs used in our transaction from Alice to Bob:</p><pre>(34•G) + (15•H) + (11•G) + (25•H) - (20•G) - (40•H) = (25•G) + (0•H)</pre><p>The clever property here is that when the Grin amounts cancel out (as they should when no money was created out of thin air), all that remains from subtracting the outputs from the inputs is the commitment to<strong> </strong>“<strong>the excess blinding factor</strong>”, or the “<strong>kernel excess</strong>”. This commitment to the excess blinding factor, in our case <strong><em>25•G</em></strong><em>, </em>serves as a<strong> public key on the curve</strong>.</p><p>If the sum of the outputs of a Grin transaction minus the sum of the inputs produces a valid public key on the curve, you know that the <strong>v</strong> values must have cancelled out. If the right side of the equation is not of the form n•G + 0•H for some known value of <em>n, </em>you know that the transaction is invalid. That would mean either the amount spent was greater than the sum of the inputs (e.g. you provide a five dollar bill, pay the cashier 3 dollars, and get 10 dollars back in change), or the inputs were greater than the outputs (e.g. you provide a 5 dollar bill, pay the cashier 3 dollars, and there is no change).</p><p>Remember the signature from earlier?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/228/1*6ADT5dPa9zzywaeVu08HhQ.png" /><figcaption>The signature from the transaction.</figcaption></figure><p>This signature actually <strong>already signed</strong> the <strong>commitment to the excess blinding factor</strong> I just mentioned. Here’s how.</p><p>If you recall, this is what Bob’s partial signature looks like when you multiply both sides of the equation by generator <em>G.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*-Aa86Dh4S8PWptBK2HR0dg.png" /><figcaption>Bob’s partial signature when you multiply both sides by generator G.</figcaption></figure><p>Similarly, here’s what Alice’s partial signature looks like when you multiply both sides by generator <em>G.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*x6SkY2yOLEWg5bc9GHIjjg.png" /><figcaption>Alice’s partial signature when you multiply both sides by generator G.</figcaption></figure><p>What happens if you add both equations together? You get:</p><pre>sr•G + ss•G = (kr • G) + (ks • G) + (e • (rr•G + rs•G))</pre><p>Remember that <strong>rr </strong>is Bob’s blinding factor and <strong>rs</strong> is Alice’s <em>sum of her blinding factors</em>. Also remember from earlier that rr•G + rs•G is the same thing as (rr + rs)•G .</p><p>Bob’s commitment to his blinding factor was <em>11•G</em>. Alice’s commitment to the sum of her blinding factors was <em>14•G</em>. Add them together and you get <strong><em>25•G</em></strong>, which is the commitment to the excess blinding factor for the transaction. Thus, adding <strong>sr</strong> and <strong>ss, </strong>which are Bob and Alice’s respective partial signatures, <strong>proves the entire transaction’s validity </strong>because they add up to the commitment to the excess blinding factor.</p><p>Further simplifying that equation, we get:</p><pre>sr•G + ss•G = (k•G) + (e • (r•G))</pre><p>Or:</p><pre>sr•G + ss•G = (k•G) + (e • (25•G))</pre><p>All that’s left to check is that the left side equals the right side.</p><p>Remember, everything in this equation (the sum of partial signatures, everything in <em>e, </em>the commitment to the excess blinding factor, the commitment to the sum of nonces) is publicly visible to everyone, so anyone can do this verification. We required neither Alice nor Bob’s blinding factors to validate the transaction. By adding their partial signatures and verifying that they summed to the commitment to the excess blinding factor, we proved:</p><ol><li>No money was created from thin air in spending Alice’s previous input.</li><li>Alice and Bob both knew the blinding factors for their outputs when they created this transaction. This means the new outputs are spendable by them, and not lost to the abyss.</li></ol><p>The information we just used to validate the transaction gets placed in what’s called the <strong>transaction kernel</strong>.</p><h3>The Transaction Kernel</h3><p>Besides the outputs, the <strong>transaction kernel</strong> is the other piece of information spit out from a Grin transaction. Every transaction produces a transaction kernel, but there’s no way of looking at the Grin blockchain and linking an output to a transaction kernel. One exists for every Grin transaction, and it contains the proof that no money was printed out of thin air.</p><p>The following information is stored in the kernel:</p><ul><li>The <strong>signature</strong> of the transaction <em>(s, k • G)</em>.</li><li>The public key associated with the “<strong>excess blinding factor</strong>” (in this case, <strong><em>25•G</em></strong>). As described above, this can be used to validate <strong>s</strong>.</li><li>The <strong>transaction fee </strong>and <strong>lock_height</strong> of the transaction. <strong>(Note:</strong> if this was a Coinbase transaction, neither of these would be present).</li></ul><h3>Summary</h3><p>After all this is said and done, the only things broadcast to the network from the transaction are:</p><ul><li>The inputs used.</li><li>The new outputs.</li><li>The transaction kernel.</li><li>The kernel offset (which I didn’t cover here).</li></ul><p>None of the transaction metadata from earlier are relayed. Even better, some of this information may get discarded, too — but we will save that for another post.</p><p>Hopefully, this post shed some light on how Grin transactions work. I intentionally left out range proofs, kernel offsets, and fees. Look out for more posts on how cut-through works in Grin, what multi-participant transactions look like, and some experimental features.</p><p><em>If you enjoyed this post, </em><a href="https://twitter.com/arvanaghi"><em>follow me on Twitter</em></a><em>.</em></p><p><em>See my other post: “What’s inside a Grin Transaction File?”</em></p><h3>Brandon Arvanaghi on Twitter</h3><p>BLOG] Grin does not use addresses. To send or receive Grin, the sender and recipient must send information back-and-forth between one-another. One way to do this: through a file. What&#39;s inside a Grin Transaction File? https://t.co/s523DyTXz8</p><p><em>Thanks to John Tromp, Jasper van der Maarel, and David Burkett for their thoughtful reviews and explainers. Check out their work!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdceb905a853" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is the U.S. Constitution “Bitcoin in practice”?]]></title>
            <link>https://medium.com/@brandonarvanaghi/is-the-u-s-constitution-bitcoin-in-practice-3fed2d5ab12f?source=rss-771b82fd92bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fed2d5ab12f</guid>
            <category><![CDATA[decentralization]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[government]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Brandon Arvanaghi]]></dc:creator>
            <pubDate>Mon, 12 Nov 2018 19:40:17 GMT</pubDate>
            <atom:updated>2018-11-12T20:01:58.086Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TL;DR:</strong></p><h3>Brandon Arvanaghi on Twitter</h3><p>Now, answer me this: How is it that 7 men in 1789 figured out a decentralized, trustless system of governance that never hard-forked (the United States is still a perfect union!)... While the blockchains we designed ourselves, in 2018, hard-fork on a daily basis? 🤔</p><p>Do you notice anything about these two ideas?</p><ol><li>Creating a government that can never become too powerful.</li><li>Creating a currency that can never be corrupted or seized.</li></ol><p>They’re identical. And the word motivating both?</p><p><strong>Tyranny</strong>.</p><h3>Context</h3><p>The Founding Fathers declared independence against the British because of what they deemed tyranny.</p><p>When they won, they <strong>wrote a Constitution </strong>to create a form of government that could <strong>never be too centrally powerful</strong>.</p><p>The U.S. Government is <strong>Bitcoin is practice. </strong>Let’s look at how.</p><h3>Yes, It’s Trustless</h3><p>Because the U.S. Constitution is not <strong>technically enforced </strong>like Bitcoin, the government “promising” to behave a certain way (like separating powers) is simply not enough. It needs to have some degree of being <em>trustless</em>, like Bitcoin sought to be.</p><p>I’m here to tell you that the U.S. Constitution, despite being a piece of paper, is <strong>more trustless</strong> than most of our cryptocurrencies. Why?</p><p><strong>Completely apolitically</strong>, the answer is the <a href="https://en.wikipedia.org/wiki/Second_Amendment_to_the_United_States_Constitution">2nd Amendment to the Constitution</a> (the right to bear arms, and form a militia). If the <em>protocol </em>of the U.S. government is separation of powers, Federalism (states rights), and a lack of excessive central control, then the <strong><em>technical enforcement of that protocol</em></strong> is the threat of gunfire from the citizens.</p><p>Does that sound far-fetched?</p><p><strong>Still apolitically speaking, </strong>many argue the threat of gunfire has been a <strong>passive deterrent </strong>for any kind of tyrannical action. In other words, you don’t see the government ever <em>try</em> to trample rights or processes because<em> </em>of the 2nd Amendment. <a href="https://en.wikipedia.org/wiki/List_of_rebellions_in_the_United_States">Lists exist</a> of all the times people have <em>actively </em>taken to arms against the government as well (you can judge the motivation or justification yourself.)</p><p>Is the U.S. government decentralized, though?</p><h3>Yes, It’s Decentralized</h3><p>There are two major ways (and a million smaller ways) the U.S. government is decentralized:</p><ol><li><strong>Federalism </strong>(the delegation of powers to states, when not explicitly granted to the central government). This protects states from being overrun by an overly powerful central government.</li><li><strong>Checks and balances</strong> prevent any one branch from growing too powerful. The branch deciding on the constitutionality of laws has no authority to write laws. Congress and the executive branch rely on different electorates, and check one-another.</li></ol><p>We explained earlier why the government can’t <em>ignore </em>or <em>trample </em>these tenets of the Constitution. But what about <em>changing them </em>legally, to allow for more tyrannical policies?</p><h3>Changing the U.S. Protocol is Almost Impossible. Cryptocurrencies? Not So Much.</h3><p>The Founding Fathers intentionally designed Congress to move extremely slowly. To this effect, none of the amendments described above can be changed by a simple majority rule.</p><p>To nullify an Constitutional Amendment, it requires:</p><ol><li>A 2/3rds majority in both the House and Senate (which rely different electorates)</li><li>38 of 50 states ratifying the amendment (which rely on different electorates AND have different incentives)</li></ol><h3>Brandon Arvanaghi on Twitter</h3><p>There have been 11,699 proposed amendments to the Constitution. Of those, only 27 made it in. Of those, only 1 made it in that negated a previous amendment (the prohibition of alcohol). That&#39;s a 0.008% success rate.</p><p>Let’s compare that with Ethereum, who ran on the same tenets of trustless and decentralization upon release:</p><p>• The <a href="https://coincodex.com/article/50/the-dao-hack-what-happened-and-what-followed/">DAO hack</a>, and subsequent vote to undo a valid transaction that allowed an attacker to empty a smart contract due to a logical error, led to a fork of the community between <a href="https://coinmarketcap.com/currencies/ethereum-classic/">Ethereum Classic</a> and <a href="https://coinmarketcap.com/currencies/ethereum/">Ethereum</a>. The former stuck to the tenet of immutability, while the latter (vastly more popular) reverted the funds to the smart contract.</p><p>• <a href="https://cointelegraph.com/news/eip-999-why-a-vote-to-release-parity-locked-funds-evoked-so-much-controversy">EIP-999</a> was a proposal by Parity to “reverse” a transaction that led to their multi-sig wallet losing 500,000 ETH due to their own, coded-in logical error.</p><p>Only 55% of the community voted against it, in what very well could have led to another hard fork.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*_P-Br_vdNi9M_dwnOO_5hQ.png" /><figcaption>Distribution of votes for EIP-999 (credit <a href="https://cointelegraph.com/news/ethereum-proposal-to-resurrect-disabled-360-mln-parity-contract-shut-down">https://cointelegraph.com/news/ethereum-proposal-to-resurrect-disabled-360-mln-parity-contract-shut-down</a>)</figcaption></figure><p>No matter your opinion on which way Ethereum <em>should be voting </em>in these cases, what these votes showed is every core tenet of the cryptocurrency and protocol are open to discussion. Ethereum is not unique here — most cryptocurrencies match that description, and the community is willing to hard fork over those disagreements. This is unequivocally <strong>bad; </strong>it’s a waste of human capital, and slows the adoption of cryptocurrencies due to the uncertainty it creates.</p><p>Meanwhile, revoking an amendment to the Constitution has historically had a <strong>0.008% success rate</strong>. This is attributable to the almost <em>insurmountable </em>incentives that need to be aligned to make this happen legally. And, as shown above, it’s a catastrophic proposition for the government to try and do it illegally.</p><h3>Credit Where It’s Due</h3><p>The blockchains we designed today should be <em>enlightened</em>. We have thousands of years of history to go off.</p><p>I am a <strong>big </strong>proponent of cryptocurrencies, because they allow us to technically enforce tried-and-true trustless models and apply them to our money.</p><p>However, what we’ve been doing instead is <strong>technically enforcing majority rule. </strong>Even in 1789, the Founding Fathers knew this was an unsustainable form of governance!</p><p>To this effect, we hard fork in our cryptocurrencies at the drop of a hat. But the U.S., 240 years later, is still a perfect Union. It has never hard forked (and when it tried to, it was short-lived).</p><p>In many ways, the U.S. Constitution embodies the vision of cryptocurrencies <em>better than our implementation of them</em> more than 240 years later.</p><p><em>I post more often on Twitter, so if you enjoyed this content, you can </em><a href="https://twitter.com/arvanaghi"><em>follow me there</em></a><em>!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fed2d5ab12f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The most lucrative ETH scams, top-to-bottom.]]></title>
            <link>https://medium.com/hellobloom/the-most-lucrative-eth-scams-top-to-bottom-5678bd056fe4?source=rss-771b82fd92bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/5678bd056fe4</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[research]]></category>
            <dc:creator><![CDATA[Brandon Arvanaghi]]></dc:creator>
            <pubDate>Mon, 25 Jun 2018 15:31:01 GMT</pubDate>
            <atom:updated>2018-06-25T15:31:01.657Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Scams in the cryptocurrency world run rampant.</em></strong> <em>Reported scams on tracking site </em><a href="http://etherscamdb.info/"><em>EtherscamDB</em></a><em> total more than 38,179 ETH (~$23 million) which have been taken from users. And this is only what we can trace!</em></p><ul><li>Fake MyEtherWallets/MyCryptos:<strong> $7.57 million</strong></li><li>Fake ICOs: <strong>$4.5 million</strong></li><li>The word “give”:<strong> $1.48 million</strong></li><li>Punycode lookalike domains: <strong>$507,000</strong></li><li>Fake exchanges:<strong> $502,000</strong></li><li>The word “gift”: <strong>$459,000</strong></li><li>Elon Musk scams: <strong>$32,000</strong></li><li><strong>TOTAL: $23 million</strong></li></ul><p><em>This data can be queried on </em><a href="http://dirtyeth.com/"><em>dirtyeth.com</em></a><em>, an engine I made to calculate how much scams have stolen.</em></p><p>Scams today are so effective that even when someone like Vitalik Buterin adds <strong>“Not giving away ETH” </strong>to his display name, scammers <strong>still </strong>copy his profile pic and display name (containing those very words) and claim to be giving away ETH!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kWCb-qdxSs51AW9kGqkkZA.png" /><figcaption>Fake Vitalik Buterin responding to a real tweet by Vitalik Buterin</figcaption></figure><p>Why are these scammers so resilient? Hopefully, this post answers that for you. We’ll explore:</p><ol><li>How much are these scams making?</li><li>What are the most successful themes in scams?</li><li>What trends are we seeing?</li></ol><p><em>Note: methodology for my calculations, as well as caveats (some scams “seed” their scam addresses with phony transactions), are described in full as comments to this post. Jump down there if you’re interested!</em></p><h3>Fake MyEtherWallets/MyCryptos - <strong>$7.57 million</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*WstMk51oKVcsNiJS_PHaEA.png" /></figure><blockquote>“These scams won’t stop until they stop being so effective, and they won’t stop being effective until the cryptocurrency industry collectively learns to not fall for them.” — Jordan Spence, MyCrypto</blockquote><p>The data below reflect all scams listed on <a href="http://etherscamdb.info/">EtherscamDB</a> that posed as a fake MyEtherWallet site with at least one known Ethereum address.</p><p>This has scammed at least: <strong>$7.57 million </strong>(12,630 ETH)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*WAf9Wp58WKLOoUkwfBoy-A.png" /><figcaption>MyEtherWallet scams with known addresses</figcaption></figure><h3>The Word “Give” — <strong>$1.48 million</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*2uQ7pNU67cDB1ojh.gif" /></figure><p>A “giveaway” is enticing, and one of the most common scams in the Ethereum space. The scam prompts the user to send a small amount of ETH to a destination address with the promise of receiving a much larger amount in return.</p><p>As an “Aha!” moment, you’ll notice each <strong>Largest Victim</strong> entry is relatively <em>low </em>compared to that scam’s <strong>Total Scammed</strong> value. Why? Because these phony giveaways explicitly ask<em> for small amounts of ETH </em>in exchange for a larger return. They work on quantity, not quality.</p><p>This has scammed at least:<strong> $1.48 million</strong> (2,482 ETH)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*O1BKSK291k_5YGUVf1wNvg.png" /><figcaption>Truncated output related to scams using the word “give” — the full list is twice as long!</figcaption></figure><h3>The Word “Gift” — <strong>$459,000</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*Z8CxxjxdWLsIshqst66w_A.png" /></figure><p>Give vs. gift — which one is more meaningful?</p><p>It’s hard to say for sure, as our data rely on what users report most often, and what addresses we know about. <em>Give</em> seems to be more common, though, with 103 entries to <em>gift</em>’s 43.</p><p>This has scammed at least:<strong> $459,000 </strong>(765 ETH)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*X1T1KZTcD7DbE6mCCaUQig.png" /><figcaption>Scams using the word “gift”</figcaption></figure><h3>Punycode Domains — <strong>$507,000</strong></h3><blockquote>“When we look at all the collective data that people have reported via EtherScamDB, we can see how nuts it is… The next step is to determine how to stop these scams? What tools can we build that help prevent people from losing funds?” — Taylor Monahan, MyCrypto</blockquote><p>Browsers support displaying character encodings beyond the English alphabet you’re used to seeing. “Punycode” allows attackers to purchase domain names containing these alternate encodings using only ASCII characters. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/1*P-LsTQy2isMK1AyoLmDdEQ.png" /><figcaption>Alternate-encoded domain name</figcaption></figure><p>The subtle discrepancies in the “e”s might go unnoticed, and the TLS “Secure” icon would only serve to further trick a user.</p><p>The ASCII character set does not deal with these symbols, so to represent these alternate encodings in ASCII, you would use an <em>ASCII Compatible Encoding</em> (ACE) prefix of “xn- -”. This tells the computing world to treat the text not as ASCII, but as an alternate encoding to render to the user.</p><p>These are all the Punycode domains reported on <a href="http://etherscamdb.info/">EtherscamDB</a>.</p><p>This has scammed at least: <strong>$507,000 </strong>(845 ETH)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*eA6xN7Vh8k8J7W9RjBqS-A.png" /><figcaption><strong>Punycode</strong> domains scamming 845.61 ETH</figcaption></figure><h3>Exchanges — <strong>$502,000</strong></h3><p>Spoofing cryptocurrency exchanges is a popular way to convince users to send ETH or give up their private keys.</p><p>No exchange is immune, so below is a list of all exchange-related scams listed on <a href="http://etherscamdb.info/">EtherscamDB</a> with at least one known address.</p><p>This has scammed at least:<strong> $502,000 </strong>(838 ETH)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*eXV4tskPbJs4m8BtCSO-xA.png" /><figcaption>Exchange-related scams</figcaption></figure><h3>Fake ICOs — <strong>$4.5 million</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*kP-cHWFsZ9F4VAHN.png" /></figure><p>At the time of this writing, <a href="https://etherscan.io/tokens">Etherscan</a> says there are<strong> 92,945</strong> ERC20 token contracts deployed on mainnet. And that’s only ERC20 — that doesn’t include any of the more recent standards.</p><p>Many of these token contracts had a token sale associated with them. If they gained even a modest amount of traction, scammers certainly tried to spoof them.</p><p>This has scammed at least: <strong>$4.5 million</strong> (7,513 ETH)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*qkGKHvIOx01YHx-2AR-0cw.png" /><figcaption>Truncated output of top token sale scams on <a href="http://etherscamdb.info/">EtherscamDB</a></figcaption></figure><p>We can break down the data into specific token sales, too. One example (not pictured in the truncated output above) is Telegram.</p><h4><strong>Telegram — $75,600</strong></h4><p>Telegram had an <a href="https://techcrunch.com/2018/05/03/telegrams-billion-dollar-ico-has-become-a-mess/">ICO planned</a> which created plenty of excitement in the crypto space. Naturally, scammers took notice.</p><p>This has scammed at least:<strong> $75,600 (</strong>126 ETH)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*8Pob09PO-uxSMMwOhMZqXg.png" /><figcaption>Fake Telegram ICOs</figcaption></figure><h3><strong>Celebrities</strong></h3><p>Besides institutions, scammers impersonate high-profile individuals.</p><h4><strong>Elon Musk</strong></h4><p>For whatever reason, Elon Musk has become a popular target to impersonate for Ethereum scammers.</p><p>This has scammed at least:<strong> $32,000 </strong>(54 ETH)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*OIwLlsfvQBLz2RSUFNGgIA.png" /><figcaption>Elon Musk related scams</figcaption></figure><h3>Total — <strong>$23 million</strong></h3><p>Take all the scams reported on <a href="http://etherscamdb.info/">EtherscamDB</a> with confirmed addresses associated with them, de-dupe any aliased scams, and sum all incoming transaction history to their addresses. That’s a total of about <strong>$23 million</strong> (38,179 ETH)<em> </em>going to these scams.</p><p>And these are just the scams <strong>we can trace!</strong> <em>Thousands </em>exist on EtherscamDB without any confirmed addresses tied to them. <em>Thousands more</em> exist that have never been reported!</p><p><a href="http://dirtyeth.com/"><em>dirtyeth.com</em></a><em> will remain up so you can track these scams yourself, and find your own patterns.</em></p><p>If you enjoyed this post, follow my <a href="http://twitter.com/arvanaghi">Twitter</a>. I post content like this there.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5678bd056fe4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hellobloom/the-most-lucrative-eth-scams-top-to-bottom-5678bd056fe4">The most lucrative ETH scams, top-to-bottom.</a> was originally published in <a href="https://medium.com/hellobloom">Bloom</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>