<?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 Peter R. Rizun on Medium]]></title>
        <description><![CDATA[Stories by Peter R. Rizun on Medium]]></description>
        <link>https://medium.com/@peter_r?source=rss-7762a3e12bc6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*M9g9b9VE_PkLNmkQY9Izaw.png</url>
            <title>Stories by Peter R. Rizun on Medium</title>
            <link>https://medium.com/@peter_r?source=rss-7762a3e12bc6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 20:20:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@peter_r/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[Visualizing HTLCs and the Lightning Network’s Dirty Little Secret]]></title>
            <link>https://medium.com/@peter_r/visualizing-htlcs-and-the-lightning-networks-dirty-little-secret-cb9b5773a0?source=rss-7762a3e12bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb9b5773a0</guid>
            <category><![CDATA[lightning-network]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Peter R. Rizun]]></dc:creator>
            <pubDate>Thu, 28 Mar 2019 15:59:07 GMT</pubDate>
            <atom:updated>2019-03-28T21:54:30.692Z</atom:updated>
            <content:encoded><![CDATA[<p>A Lightning channel can be thought of as a string of beads stretched between two people. Referring to Fig. 1, Alice can pay Bob by pushing one of her beads to his side. If Bob also has a Lightning channel with Carol, Alice can pay Carol <em>through</em> Bob: she pushes a bead over to Bob, who then pushes a bead over to Carol. The fundamental rule — and the reason behind the Lightning Network’s liquidity problems — is that the beads can move from side to side but cannot leave the string they’re on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h3R-vZLFYugnghEF405QOg.gif" /><figcaption>Fig. 1. Alice can send a payment to Carol by routing it through Bob. Because beads cannot leave the string they are on, Bob ends up with one more bead on his string with Alice, and one fewer bead on his string with Carol.</figcaption></figure><p>That’s all you need to know to understand the way money can flow in the Lightning Network. But this model doesn’t tell us anything about why Lightning payments are secure. For example, what is stopping Bob from simply keeping the bead Alice pushed towards him and never sending one on to Carol? The purpose of this article is to answer the question “what makes Lightning payments ‘trustless’?”</p><p>At the end of the article, we’ll reveal the Lightning Network’s dirty little secret: that <em>small</em> payments aren’t actually “trustless” at all— routing nodes can lose customer funds.</p><h3>Hash- &amp; Time-Lock Contracts (HTLCs)</h3><p>To explain what prevents Bob from keeping the bead from Alice without sending one on to Carol, we need to introduce “locks” to our physical analogy for Lightning channels. Locks can be placed on the strings to constrain the movement of the beads, and only opened if specific conditions are met. The hash- and time-lock contracts (HTLCs) used in Lightning payments involve two types of locks (cf. Fig. 2): the first is a lock that opens if presented with the correct password (we’ll call this a “hash-lock”), and the second is a lock that opens automatically after a time delay (we’ll call this a “time-lock”).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*nmdqtwAe8DMwygYPR5K6hg.gif" /><figcaption>Fig. 2. The hash-lock opens when a password is entered that hashes to the specified value (45f8 in this case). The time-lock opens after the specified time has elapsed (48 hours in this case).</figcaption></figure><p>Let’s now return to the payment of one bead from Alice to Carol through Bob. To make the payment “trustless,” Alice, Bob, and Carol need to be online at the same time and participate in an elaborate ritual.</p><p>First, Alice asks Carol to think up a secret password and tell her the password’s hash. Let’s pretend the password Carol thought up was “boondoggle” and its hash was “45f8.” Next, Alice places a hash-lock between her and Bob, set to open when presented with a password that hashes to “45f8.” At this point in time, neither Alice nor Bob can open the lock because neither know the password. Alice then pushes a bead against the hash-lock. Lastly, she places a time-lock on the left side of the bead, set to automatically open after 48 hours (Fig. 3).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mqu4EYobB1h78C2aYtIQ2A.gif" /><figcaption>Fig. 3. With knowledge of the hash of Carol’s secret password, Alice can set a hash-lock to protect the coin she shifts to Bob (to then route to Carol). She locks the coin in with a time lock so that she can get it back should Bob fail to complete the payment within 48 hours.</figcaption></figure><p>Bob sees that the bead is his if he can figure out the password before 48 hours is up. He also knows (because Alice told him) that Carol will reveal the password in exchange for one of <em>his</em> beads. To entice Carol into action, Bob places the same hash-lock between himself and Carol, pushes over one of his beads, and then locks it in with another time-lock (Fig. 4). He knows that in order for Carol to open the hash-lock and take the bead, she’ll need to enter the password — in plain sight — which is the same password Bob needs to open the hash-lock with Alice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZmUSWJjc42KKwoWE8lfdZg.gif" /><figcaption>Fig. 4. Bob sees that the coin from Alice is his if Carol will reveal her password before 48 hours is up. He sets the same hash-lock, pushes a coin towards Carol, and locks it in with a time-lock. The only way Carol can take the coin from Bob is to reveal the password that Bob needs to claim the coin from Alice.</figcaption></figure><p>Carol, upon seeing that the bead is hers for the taking, enters “boondoggle” into the lock (in Bob’s plain sight remember). The lock’s CPU confirms that `hash(“boondoggle”) = 45f8`, and then opens. Carol moves the bead to her side of the string (Fig. 5).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SQ5dmkIw-B29UF8qZ3Dn9g.gif" /><figcaption>Fig. 5. Carol reveals her password to open the lock and take the coin.</figcaption></figure><p>With knowledge of Carol’s password, Bob unlocks his bead from Alice in the same way (Fig. 6). The payment is complete.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pyTprS3-XCCL_Refa2pYxA.gif" /><figcaption>Fig. 6. With knowledge of Carol’s secret password, Bob can now take the coin from Alice, thereby completing the payment.</figcaption></figure><p>You might wonder <em>why</em> Bob would bother to participate in this ritual in the first place. Had Carol not been cooperative, his bead may have been frozen until the time-lock expired. In practice, Alice would send Bob a little more than what she asks Bob to send to Carol, as a fee to compensate for this risk and for Bob’s effort. When the payment is complete, Bob would have a bit more than he started with, thereby motivating him to complete the payment.</p><p>You might also wonder what purpose the time-locks serve. The time-locks allow the participants to recover their funds if the payment fails. For example, imagine that Bob becomes uncooperative after Alice shifts her bead over and adds the two locks. The time-lock is what allows Alice to get her funds back. She just needs to wait for the time-lock to expire. There’s no way for Bob to steal the bead in the meantime, because he needs the password from Carol, which he can’t get without giving Carol one of his beads and thus completing the payment.</p><p>Interested readers can explore what happens if one party becomes uncooperative at different steps in the Lightning payment process to convince themselves that neither Alice, Bob, nor Carol are at risk of losing money due to the action of their counter-parties.</p><h3>The Lightning Network’s Dirty Little Secret</h3><p>The Lightning Network has a dirty little secret few people know. To understand what the secret is — and its ramifications for Lightning payments — we need to dig a bit deeper.</p><p>Recall that when Alice sent the payment to Carol through Bob, the intermediate state shown in Fig. 7 existed. When expressed as a bitcoin transaction, the channel state contains three outputs: Alice’s coins, Bob’s coins, and the coin “in flight.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3M5D_pYiIU-RvifzhYqCPw.gif" /><figcaption>Fig. 7. The Lightning channel state transaction at this point in time contains three outputs: Alice’s coins, Bob’s coins, and the coins in-flight.</figcaption></figure><p>Here’s the problem: if the value-in-flight is below the BTC dust threshold, then it cannot be represented as a third output in the channel-state transaction! It is thus not possible to use hash- and time-locks to protect the payment if the payment is too small.</p><p>To explain how the LN deals with this problem, I must first make a confession. It is not exactly true that the number of beads on a string is constant. There is actually a bucket beside each string labelled “Miner’s Fee” that contains small fractions of beads. The value in this bucket gets claimed by the miner who confirms the channel-state transaction, should the channel state be pushed to the blockchain. Fractions of beads can move from the string to the bucket, or from the bucket back to the string, but only if the persons on <em>both</em> sides of the channel agree.</p><p>Rather than locking the value in-flight with hash- and time-locks, for small payments Alice and Bob just move the value-in-flight into the fee bucket (Fig. 8). Bob trusts that Alice will cooperate with him to take the value-in-flight out of the fee bucket when he reveals Carol’s secret password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_nmXoQmlh20lDoeqsbbW9Q.gif" /><figcaption>Fig. 8. If the coins in-flight are below the dust threshold, the HTLC mechanism cannot be used because the channel-state transaction would not get mined if broadcast. Instead of using the HTLC mechanism, the coins-in-flight are dumped into the “Miner’s Fee” bucket.</figcaption></figure><p>Bob then dumps the value-in-flight into a second fee bucket he shares with Carol, promising to give it to her if she tells Bob the secret password. Carol tells Bob the secret, and Bob and Carol together move the payment from the fee bucket to Carol’s side. Bob then goes back to Alice, tells her Carol’s secret, and, if all goes well, Alice cooperates with him to take the value-in-flight out of the fee bucket and place it on Bob’s side of the string.</p><p>Unlike the HTLC scheme described earlier, this scheme relies on trust. For example, Carol could reveal the password to Bob, who could then leave the payment in the fee bucket yet still go to Alice and deliver the password in exchange for his payment.</p><p>Carol’s recourse in this scenario is limited: she either does nothing and accepts the loss, or she closes her channel with Bob. But closing her channel with Bob doesn’t make her whole, because the value she should have received gets sent to a miner instead!</p><p>Despite how broken the above scheme sounds, it actually works reasonably well in practice. Bob has no real incentive not to give the money to Carol. If he doesn’t give it back, he’ll be no better off (the miner will keep the extra funds, not him) and probably worse off (Carol will likely close the channel since Bob has proven himself untrustworthy). The damage Bob can do appears limited to the value of the payment plus the cost of establishing a new lightning channel.</p><h3>Why this is significant</h3><p>Lightning’s dirty little secret is significant because it reveals how friction from Layer 1 (L1) leaks into L2, forcing complex and poorly-understood¹ work-arounds to the L2 protocol. The work-around in this case changed the “trustless” nature of Lightning payments: for payments <em>above </em>the dust threshold, neither Alice, Bob nor Carol can lose money due to the actions of their counter parties. <strong>For payments <em>below</em> the dust threshold, Alice, Bob and Carol can lose money through no fault of their own</strong>. It is a fundamentally different security model from what people understood.</p><p>One might argue, “we’re just talking about tiny payments so who cares.” I don’t buy this argument for two reasons:</p><ul><li>Core’s scaling plan of using the blockchain as a high-fee settlement layer will increase the threshold for what constitutes “dust.” Dust are outputs that cannot be economically spent because the on-chain fee to spend them is greater than their value. With $100 fees, most of the world’s entire monthly wage is “dust.”</li><li>Losing several tiny payments in quick succession (e.g., due to a LN routing attack) could result in a significant loss.</li></ul><p>Imagine a future where the majority of payments take place on the Lightning Network, and transaction fees on L1 are consistently over $100. Dust outputs below $100 on the main chain have no value because it costs more to spend them than they’re worth.</p><p>Now the Lightning Network has the problem where even $50 payments are not “trustless.” In the case where $50 is below the dust threshold (which would be reasonable policy considering that $50 would be economically unspendable on L1), then HTLCs cannot be used to protect the $50 payment. Customers can lose $50 payments through no fault of their own.</p><p>In the case where developers try to get around some legal “loop hole” by setting the dust limit to $1 so that HTLCs can still be used, the effect is still a $50 loss to the customer because the output will not be economically spendable! Customers can <em>still</em> lose $50 payments through no fault of their own.</p><p>One might argue “well OK routing nodes can lose customer funds and those funds might be significant in a high-fee future, but routing nodes are peers not businesses.” I don’t buy this either because the entire purpose of routing Lightning payments is to earn money in transaction fees in exchange for lending liquidity. Already today, the Lightning developers have abandoned the idea that all users would route payments; now it is encouraged that normal users use non-advertised channels and never route.</p><p>In a high-fee future a hub has effectively custodial control over its users’ money. A user cannot settle on the blockchain to recoup funds for payments not protected by HTLCs . Further, if the user’s balance is on the same order of magnitude as the on-chain fees, the user is also trapped by the hub. It is simply not worth escaping from a “bad” channel because doing so would cost the user their entire balance. Hubs can thus also lock customer funds indefinitely by refusing to route payments unless certain conditions are met (e.g., unwrapping the onion-routing information for AML/KYC purposes). The user’s only choice is to settle on the blockchain and lose all their money — which isn’t a <em>real</em> choice at all! Hubs can also steal from their users in the form of exorbitant fees. Again, the user is trapped and has no choice but to pay if they want access to their money.</p><p>Well-connected Lightning hubs in a future with high on-chain fees should be regulated as they have effectively custodial control of their customers’ funds.</p><p>I’d like to hypothesize that the following law exists:</p><blockquote>Payments on Layer 2 for amounts below what is economically feasible to carry-out on Layer 1 cannot be made “trustless.”</blockquote><p>Lightning will only work as people expect if the underlying blockchain is unconstrained.</p><h3>More</h3><p>This is just one of many reasons why a future where most transactions take place on the Lightning Network and the blockchain has high fees will be very different than people expect. Other reasons include:</p><ul><li>Lightning scales transactions, not users. The cost to run a full validating node will still be high.</li><li>Friction on L1 affects fungibility on L2; coins have position-dependent value.</li><li>Liquidity: most “wealth states” are not reachable via Lightning transactions. Payment failures are unavoidable.</li><li>Routing is hard if the network graph is large: Lightning hubs will centralize to reduce routing and liquidity problems.</li><li>The typical user-experience of running a non-custodial wallet will always suck: users need to be online to receive money, hire watchtowers to monitor for channel fraud, subscribe to source-routing services to send payments, and dynamically back up their channel states against data corruption.</li><li>Systemic risk: a very large amount of coins need to be locked in Lightning channels (hot wallets) to provide the needed liquidity.</li><li>Aggregate miner fees on L1 will not be sufficient to secure the blockchain when the block reward runs out.</li></ul><h4>Footnotes</h4><p>¹ For example, I have been called a liar and received harsh feedback on Twitter and Reddit (even by people working on LN) for pointing out that LN is not “trustless” for small payments and that customer funds could be re-routed to the miners through no fault of the customer. The widely-held-but-false belief within the BTC community was the all Lightning payments were “trustless” <em>by design</em>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb9b5773a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why you should resign from Bitcoin Unlimited]]></title>
            <link>https://medium.com/@peter_r/why-you-should-resign-from-bitcoin-unlimited-a5df1f7fe6b9?source=rss-7762a3e12bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5df1f7fe6b9</guid>
            <category><![CDATA[bch]]></category>
            <category><![CDATA[bitcoin-governance]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Peter R. Rizun]]></dc:creator>
            <pubDate>Wed, 27 Mar 2019 12:51:19 GMT</pubDate>
            <atom:updated>2019-03-27T14:14:21.318Z</atom:updated>
            <content:encoded><![CDATA[<p>You should resign from Bitcoin Unlimited if any of the following resonate with you:</p><ul><li>You don’t want bitcoin to be a peer-to-peer electronic cash system with instant transactions and low fees,</li><li>You believe the quantity of block space actually produced should be managed by a group of experts rather than the free market,*</li><li>You want protocol development based around one github repo and led by one dev team rather than multiple competing implementations,</li><li>You do not value feedback from non-technical bitcoin users, or</li><li>You are impressed by technobabble, a wheelbarrow full of degrees, and lawsuits against open-source bitcoin developers.</li></ul><p>To understand Bitcoin Unlimited (BU) one must understand its history. BU is a grass-roots effort by bitcoiners who came together on social media in 2015. The reason we came together was to raise the block size limit, so that bitcoin could continue to grow the way Satoshi had intended — with more transactions per second and bigger and bigger blocks.</p><p>To avoid what we saw as “developer capture” with Core, BU would be governed by a democratic process that both technical and non-technical members could participate in. We recognized that developers could lose sight of the bigger picture, and forget why it is that we’re here in the first place. Non-technical people would provide balance. They’d remind us to keep our eye on the ball. That we’re here to fix money.</p><p>I am proud of what we’ve accomplished with Bitcoin Unlimited. What started as a grass roots movement online, achieved <a href="https://en.wikipedia.org/wiki/Bitcoin_Unlimited#Notable_History">50% miner</a> support in 2017, and shortly after played a central role in the creation of BCH. From the development of <a href="https://medium.com/@peter_r/towards-massive-on-chain-scaling-presenting-our-block-propagation-results-with-xthin-da54e55dc0e4">Xthin</a> (reducing the amount of data required to propagate a block by a factor of 30x), to our recent roll-out of <a href="https://news.bitcoin.com/bitcoin-unlimited-merges-graphene-block-propagation-technology/">Graphene</a>, BU has proven itself a leader in efficient block propagation. We built the <a href="https://www.youtube.com/watch?v=5SJm2ep3X_M">Gigablock testnet</a>, where we mined and propagated the first <a href="https://news.bitcoin.com/gigablock-testnet-researchers-mine-the-worlds-first-1gb-block/">gigabyte blocks</a> across the world, and where we identified the next two <a href="https://twitter.com/lopp/status/926916969068052480">scaling bottlenecks</a> in the Satoshi code base. BU has organized conferences in <a href="https://medium.com/@peter_r/satoshis-vision-bitcoin-development-scaling-conference-dfb56e17c2d9">San Francisco</a>, <a href="https://www.satoshisvisionconference.com/previous/tokyo2018/">Tokyo</a> and <a href="https://www.satoshisvisionconference.com/">Lake Garda</a>, while sponsoring the <a href="https://www.thefutureofbitcoin.com/">Arnhem</a> event where Bitcoin Cash was first announced. We’ve sponsored several research, development and outreach projects, and in my opinion BU has been a positive force in the battle to bring peer-to-peer electronic cash to the world.</p><p>I want changes to the bitcoin protocol to be <em>slow</em>. I see that as a positive thing, not a negative thing. Many people agree with me. We don’t really <em>need</em> Lightning, CTOR or the acronym of the month <em>next</em> month. The only<em> change</em> Bitcoin ever <em>really</em> needed to succeed was the removal of the single line of code that limited the block size. BU achieved that and so much more. Now we just have to convince the world that BCH is the real bitcoin!</p><p>While writing this article I re-read Bitcoin Unlimited’s <a href="https://www.bitcoinunlimited.info/about/organization">mandates</a> from 2016:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1r0MtbodiQPTXFD2XpT5NQ.png" /></figure><p>Three years later, Bitcoin Unlimited stands for the same things. If these mandates resonate with you, please consider <a href="https://www.bitcoinunlimited.info/donate">donating</a> or becoming a <a href="https://www.bitcoinunlimited.info/about/join">member</a>.</p><h4>Footnotes</h4><p>*I believe the limit — if one exists — should be maintained above the free-market equilibrium block size whenever feasible so as not to distort the free-market dynamics.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5df1f7fe6b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the cost of trapped liquidity in the Lightning Network, Part 1]]></title>
            <link>https://medium.com/@peter_r/understanding-the-cost-of-trapped-liquidity-in-the-lightning-network-part-1-7179a24d5791?source=rss-7762a3e12bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7179a24d5791</guid>
            <category><![CDATA[lightning-network]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Peter R. Rizun]]></dc:creator>
            <pubDate>Thu, 21 Mar 2019 19:00:52 GMT</pubDate>
            <atom:updated>2019-03-21T19:01:35.753Z</atom:updated>
            <content:encoded><![CDATA[<p>Yesterday, I posted a quiz on Twitter to explore the cost of liquidity trapped in a channel on the Lightning Network. In this article, we work out the answers to the quiz questions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lPLXWLFzBWDUdTzyk1iGkw.png" /></figure><h4><em>A) What initial channel balance minimizes Company A’s cost per payment?</em></h4><p>To answer this question, we need to find an equation for the cost per Lightning payment as a function of the initial channel balance, <em>Bi</em>, and then solve for the value of <em>Bi</em> that minimizes that cost.</p><p>To begin, note that the expected lifetime of the channel in days (<em>tf</em>) and number of payments (<em>n</em>) (because Company A pays once per day) is</p><p><em>Channel lifetime</em>: <em>tf</em> =<em>n</em>= <em>Bi</em>/100</p><p>It is easy to see that the cost per LN payment <em>due to on-chain fees</em> is just the channel setup costs ($50) divided by the number of payments over the lifetime of the channel:</p><p><em>Cost per LN payment due to on-chain fees</em>: <em>C1</em> = 50 / <em>n</em>= 50 / (<em>Bi</em> /100)</p><p>But there is another cost too: the interest that Company A forgoes by having its capital locked in the channel. Calculating this is a bit tricky, because Company A is not foregoing interest on the entire channel balance <em>Bi</em>, just the portion that still belongs to Company A. Over the lifetime of the channel, Company A holds an average balance of <em>Bi</em>/2 in the channel. The interest Company A then forgoes per transaction is</p><p><em>Cost per LN payment due to forgone interest</em>: <em>C2</em> =(Bi/2)(0.05/365)<em>tf/n = (Bi/2)(0.05/365)</em></p><p>The total cost per payment is the sum of both terms (<em>C1+C2</em>):</p><p><em>Total cost per LN payment</em>: <em>C</em> =50/(<em>Bi</em>/100) + (<em>Bi</em>/2)(0.05/365)</p><p>To find the value of <em>Bi</em> that minimizes that cost, we take the derivative with respect to <em>Bi</em>, set it to zero, and solve for <em>Bi</em>.</p><p><em>dC</em>/<em>dBi</em> = -5000/<em>Bi</em>² + (0.05/365)/2 = 0</p><p>Solving for <em>Bi</em> yields</p><p><em>Bi </em>= Sqrt[5000 / ((0.05/365)/2)] = $8544</p><p>The answer to Part (A) is:</p><blockquote>The initial channel balance that minimizes Company A’s cost is $8544.</blockquote><h4><em>B) How many days until the channel balance has been transferred to Company B?</em></h4><p>This question is trivial now that we’ve solved Part (A). We just divide the initial channel balance by the dollars spent per day:</p><p><em>tf </em>= <em>Bi</em>/100 = 8544/100 = 85.44 days</p><blockquote>The channel lasts 85.44 days before its entire balance has been transferred to Company B.</blockquote><h4><em>C) Company B is currently paying interest on a line-of-credit at 10%. What discount could Company B give to Company A if Company A settled each day using BCH instead? Assume BCH fees are small enough to be negligible.</em></h4><p>To solve this question, note that the average balance held in the channel by Company B is also <em>Bi</em>/2. The total amount of interest that Company B could have saved on its line-of-credit if the payments from Company A weren’t locked in the channel is:</p><p><em>Total interest lost by Company B:</em> (8544/2)(0.10/365)(85.44) = $100</p><blockquote>Company B could discount each payment by $100 / 85.44 = $1.17 if Company A paid in BCH instead.</blockquote><h3>Why this matters</h3><p>Capital trapped in a LN channel adds a real cost for both payer and payee. Both payer and payee could improve the profitability of their businesses if they used a low-friction digital cash such as Bitcoin BCH instead.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7179a24d5791" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The answer to yesterday’s Lightning Network Quiz was “(A) 1 coin”]]></title>
            <link>https://medium.com/@peter_r/the-answer-to-yesterdays-lightning-network-quiz-was-a-1-coin-d8125c056758?source=rss-7762a3e12bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8125c056758</guid>
            <category><![CDATA[lightning-network]]></category>
            <category><![CDATA[liquidity]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Peter R. Rizun]]></dc:creator>
            <pubDate>Sat, 16 Mar 2019 20:12:49 GMT</pubDate>
            <atom:updated>2019-03-16T20:12:49.838Z</atom:updated>
            <content:encoded><![CDATA[<p>Yesterday I posted a quiz on Twitter about routing payments across the Lightning Network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MlsyXi9xMvaF8hnsZnkc8Q.png" /></figure><p>The correct answer was “(A) 1 coin.” Below is an animation that shows the flow of money for one of the possible routing paths.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*5BIo9X2RTDxKtETw7y11Lw.gif" /><figcaption>Alice can route one coin to Frank through Carol and Ella.</figcaption></figure><p>46% of the 700 poll respondents chose the correct answer.</p><p>To understand why “(A) 1 coin” is indeed the correct answer, let’s first go through the wrong answers.</p><h4>Why the answer is not “4”</h4><p>If I didn’t know a lot about the Lightning Network, I would have thought the answer was “(D) 4 coins.” Alice has 4 coins on her side of her richest channel, and I would imagine that she could send to Bob, who could forward them to David, who could deliver them to Frank.</p><p>But Lightning channels do not work that way. What is critical to understand is that the beads cannot leave their string. The total number of beads on any string must remain constant through the routing process. Beads can shift from side to side, but they cannot “hop” from one string to another.</p><p>13% of respondents chose this answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*UmyECNDtUgXTsVM1taeuwg.gif" /><figcaption>Although Alice can push her 4 coins to Bob, Bob cannot move them onto his string with David. Five coins must remain on the string between Alice and Bob.</figcaption></figure><h4>Why the answer is not “3”</h4><p>“Incoming liquidity” is a known problem in the Lightning Network that limits how much money a LN user can receive. A recent <a href="https://www.coindesk.com/its-getting-harder-to-send-bitcoins-lightning-torch-heres-why">Coindesk article</a> highlighted how this problem made it difficult for users to receive the Lightning Torch.</p><p>Note that Frank’s channel with David has a total of 6 coins, of which 3 are on David’s side. This means Frank’s incoming capacity from David is 3 coins (David could send at most 3 coins to Frank before his side is depleted).</p><p>However, “3 coins” is not the correct answer because it is not only Frank’s incoming capacity from David that matters, David’s incoming capacity from his channel partners matters too! As one respondent on Twitter observed, it appears that it might be possible for Alice to send three coins to Frank via Carol and David. He annotated the diagram to illustrate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MW4bTY7-cbczPNtySpCwMw.png" /><figcaption>It initially appears that Frank may be able to receive 3 coins from Alice through Carol and David</figcaption></figure><p>However, this doesn’t work because the 3 coins in the channel between Carol and David are already on David’s side. In other words, David doesn’t have sufficient incoming capacity from Carol to route the three coins.</p><p>Another respondent on Twitter edited the figure to highlight the bottleneck:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TMeGZZ7iMWJq93-9wPcW4g.png" /><figcaption>Upon closer inspection, we see that this route fails as David’s 3-coin channel capacity with Carol is in the wrong direction. David does not have enough incoming capacity to accept the payment from Carol.</figcaption></figure><p>32% of respondents chose this answer.</p><h4>Why the answer is not “2”</h4><p>“(B) 2 coins” was the best “wrong” answer. It is theoretically possible for Alice to transmit 2 coins to Bob in a single payment, without violating the “beads cannot hop from string to string” rule. Alice could send a payment of 2 coins to Frank simultaneously over two parallel paths: 1 coin routed through Carol and Ella (see animation at the top of this post) and a second coin routed through Bob and David.</p><p>The reason this answer is not correct is because the Lightning V1.0 protocol (the one currently in use) does not support such “multipath” payments. Lightning V1.0 only supports routing along a single path.</p><p>There is a proposal to implement what has become known as <a href="https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-February/000993.html">Atomic Multipath Payments (AMP)</a> in a future version of LN (V1.1). If AMP were supported, the correct answer would be “2 coins” rather than only 1.</p><p>9% of respondents chose this answer.</p><h4>The answer is “1”</h4><p>I hope it is now obvious to the reader why the answer is 1. The key to solving these problems is to remember that beads cannot hop from string to string.</p><h4>Extra credit</h4><p>Reddit user cryptocached posted an interesting <a href="https://old.reddit.com/r/btc/comments/b1ilwp/lightning_network_quiz_time/eim5suf/">follow-up question</a>:</p><blockquote>How can Carol manipulate the channel state so any payment sent to Alice must pass through her?</blockquote><p>The answer is that Carol would route a payment of 1 coin back to herself through Bob and Alice. This will leave Alice with no incoming capacity from Bob. And thus all payments from Bob, David, Ella and Frank must pass through Carol. Because LN payments use onion routing, neither Bob nor Alice will know what Carol is up to.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8125c056758" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitcoin Unlimited is hiring a web developer]]></title>
            <link>https://medium.com/@peter_r/bitcoin-unlimited-is-hiring-a-web-developer-4b772e6968b5?source=rss-7762a3e12bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b772e6968b5</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[job-opportunities]]></category>
            <dc:creator><![CDATA[Peter R. Rizun]]></dc:creator>
            <pubDate>Sun, 21 Jan 2018 21:15:10 GMT</pubDate>
            <atom:updated>2018-01-21T21:15:10.009Z</atom:updated>
            <content:encoded><![CDATA[<p>Bitcoin Unlimited (BU) is hiring a full-time web developer. His or her duties will include maintaining and adding new functionality to the <a href="https://www.bitcoinunlimited.info/">Bitcoin Unlimited website</a>. The developer’s immediate tasks will be to:</p><ul><li>Add a “blog section” to the Bitcoin Unlimited website so that BU members can post updates and articles without going through the “GitHub pull-request” process. (As <a href="https://github.com/BitcoinUnlimited/BitcoinUnlimitedWeb">BU’s site uses nodeJS,</a> candidates should have experience working with this platform.)</li><li>Build a site dedicated to the <a href="https://bitco.in/forum/threads/buip065-gigablock-testnet-initiative.2610/">Gigablock Testnet Initiative</a>. In addition to providing background information on the initiative, the site will host a “Gigablock Testnet” block explorer, and provide real-time data from the testnet such as the current transaction throughput rate (transactions per second) and statistics on block propagation across the global network of nodes.</li></ul><p>This is a “telecommute position”; we accept applications from anywhere in the world. Salary is negotiable based on experience and will be competitive with industry norms in Vancouver, Canada. Salary will be paid in BCH or BTC.</p><h4>How to apply</h4><p>Apply by email before February 12 to <a href="/service/mailto:peter.rizun@gmail.com">Peter Rizun</a>. The body of the email should be structured as a cover letter no longer than 250 words, and should provide evidence that you would be a good fit for the position. Also indicate your salary expectations. Be sure to include links to relevant projects as well as a current resume and/or portfolio.</p><h4>About Bitcoin Unlimited</h4><p>The Bitcoin Unlimited organization maintains the <a href="https://github.com/BitcoinUnlimited/BitcoinUnlimited">open-source Bitcoin client</a> by the same name. The organization’s mandates are:</p><ul><li>To foster competing implementations of the Bitcoin protocol in order to provide more choice to node operators and to add robustness to the network.</li><li>To support the continued growth and adoption of Bitcoin as a peer-to-peer electronic cash system as described in <a href="https://bitcoin.com/bitcoin.pdf">Satoshi Nakamoto’s white paper [PDF]</a>.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b772e6968b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[POSTPONED] Bitcoin network upgrade at block 494,784]]></title>
            <link>https://medium.com/@peter_r/bitcoin-network-upgrade-at-block-494-784-f5ca19829529?source=rss-7762a3e12bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5ca19829529</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain-development]]></category>
            <category><![CDATA[bitcoin-mining]]></category>
            <dc:creator><![CDATA[Peter R. Rizun]]></dc:creator>
            <pubDate>Thu, 26 Oct 2017 19:29:23 GMT</pubDate>
            <atom:updated>2017-11-09T08:20:26.202Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<p>In order to reduce transaction fees, improve confirmation reliability, and provide additional capacity for the growing number of bitcoin users, the bitcoin network is being upgraded, <a href="http://www.cryptobabel.com/b2xcd/">mid-November</a>, at block 494,784.</p><p>For the majority of <a href="https://www.bitcoinunlimited.info/solutions/users">bitcoin users</a>, the upgrade will be seamless — no action is required on their part.</p><h4>Technical details, simplified</h4><p>Every ten minutes, on average, a miner finds a solution to the “bitcoin mining puzzle,” which allows her to issue herself 12.5 new bitcoins. It is through this process that new bitcoins enter circulation (Fig. 1).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XVHr2naURVRiQiC_miC9bA.gif" /><figcaption>Fig. 1. The bitcoin mining puzzle solutions form a chain known as the chain of block headers. 12.5 BTC are created each time a puzzle is solved.</figcaption></figure><p>Miners can also include a digital fingerprint (root hash) of recent transactions when mining, as shown in Fig. 2. When the next puzzle is solved, we say that those transactions become “confirmed,” because their fingerprint is now embedded within the puzzle’s solution. We refer to this solution along with the confirmed transactions as a “block,” and the chain of these blocks as the blockchain — the record of all confirmed bitcoin transactions to date. Miners have an incentive to confirm transactions in new blocks because they get to claim the fees offered by those transactions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mfqDhxwZhPJ53pylLiOU2w.gif" /><figcaption>Fig. 2. Miners are incentivized to include transactions when solving the puzzles in order to claim fees. The number of bytes of transaction data that can be included in a given block is limited due to the 1 MB block size limit currently enforced by most miners. At block 494,784 this limit is increased to 2 MB.</figcaption></figure><p>Currently, the majority of miners enforce a rule that affects the number of transactions that can be confirmed per block. Specifically, the rule states that the number of bytes in a block of standard bitcoin transactions must be no greater than 1 MB. This works out to approximately 2,000 transactions every 10 minutes, or roughly 3 transactions per second.</p><p>Starting at block 494,784, this rule will be loosened to 2 MB, effectively doubling the maximum capacity of the bitcoin network to approximately 6 transactions per second.</p><p>The upgrade has been carefully planned and follows the <a href="http://satoshi.nakamotoinstitute.org/posts/bitcointalk/485/">path set out by Satoshi Nakamoto</a> in 2010. The loosening of the block size limit is encoded in bitcoin mining nodes as follows:</p><blockquote><em>if (block_height ≥ 494,784) max_block_size = 2 MB</em></blockquote><p>In addition to this, there is a second requirement that the block mined at height 494,784 have a size <em>greater than</em> 1 MB. For further technical details, refer to <a href="https://bitco.in/forum/threads/buip055-passed-increase-the-block-size-limit-at-a-fixed-block-height.2103/">BUIP055</a>.</p><h4>What this means for SPV wallets</h4><p>Because a SPV wallet downloads only the solutions to the mining puzzles (known as the block headers), along with any transactions relevant to the wallet’s owner, a SPV wallet is blind to the number of bytes in a given block. For this reason, the Bitcoin network upgrade will be seamless and invisible to SPV wallets.</p><p>No action is required from SPV wallet users.</p><h4>What this means for Bitcoin Unlimited <a href="https://www.bitcoinunlimited.info/solutions/nodes">node operators</a></h4><p>The Bitcoin Unlimited <a href="https://www.bitcoinunlimited.info/download">software</a> is configured by default to accept blocks up to 16 MB in size. Because 16 MB is greater than the new maximum size of blocks that miners will produce (2 MB), the network upgrade will be seamless and invisible to BU nodes.</p><p>No action is required from Bitcoin Unlimited node operators.</p><h4>What this means for Bitcoin Unlimited <a href="https://www.bitcoinunlimited.info/solutions/miners">miners</a></h4><p>The network upgrade will <em>not</em> be invisible to bitcoin miners. Miners must ensure that their nodes are configured to accept up to 2 MB blocks effective from block 494,784 onward. In addition to this requirement, the size of block 494,784 must be greater than 1,000,000 bytes.</p><p>Miners can choose to meet these requirements manually through the BU client interface; however, we recommend that miners run the <a href="https://github.com/btc1/bitcoin/tree/segwit2x">BTC1 client</a> through the upgrade period. The BTC1 client was designed to implement the upgrade requirements automatically.</p><h4>Summary</h4><p>The November upgrade is the first in a series of upgrades that will take place over the coming years to scale up the bitcoin network to a global payment system usable by all of our world’s 8 billion inhabitants.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5ca19829529" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Short Note on the Silbert Accord]]></title>
            <link>https://medium.com/@peter_r/a-short-note-on-the-silbert-accord-e3ce1697e8bb?source=rss-7762a3e12bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3ce1697e8bb</guid>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Peter R. Rizun]]></dc:creator>
            <pubDate>Thu, 25 May 2017 14:39:07 GMT</pubDate>
            <atom:updated>2017-05-25T19:50:14.311Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<p>The best part of the Silbert Accord is that it was negotiated between the relevant parties: the producers of block space (miners) and the consumers of block space (Bitcoin businesses on behalf of their users). Bitcoin has a tendency of annihilating gate keepers and this meeting was a step towards the disintermediation of another group holding bitcoin back: the developers themselves.</p><p>The notion that developers represent a group of “wizards” that know better than the businesses and miners who work each day growing the Bitcoin economy is absurd. Would you want a Bitcoin developer running your mining farm, deciding how to build your blocks? Would you want a Bitcoin developer dictating your corporate strategy or answering your customers’ support calls?</p><p>The idea that the Bitcoin developers know better than the wisdom of the market regarding the “correct price” for block space is no more true than the notion that a group of experts at the Fed can set the “correct price” for money. In fact, it’s strictly less true: at least the members of the FOMC were trained in economics!</p><p>The future of Bitcoin is one of multiple implementations and multiple development teams. These development teams will work to give their customers — the miners, businesses and users who make up the Bitcoin economy — what they want, rather than dictating what it is that they <em>should </em>want. If one implementation fails to deliver, then they will lose customers to the implementations that do. A market is the collective result of a bunch of people interacting freely with each other. Markets need choice to function efficiently and multiple implementations provide this.</p><p>This Silbert Accord proves that Bitcoin businesses and miners recognize that a block-size limit increase is a simple and effective way to continue growing Bitcoin in the same manner that it has successfully grown for the past 8 years: with more on-chain transactions. Although I still fail to understand the urgent need for segwit (segwit is the most significant change to the Bitcoin protocol<em> ever</em> with many potential ramifications that we do not yet understand), at the end of the day, Bitcoin is a creature of the market. If the businesses and users want segwit, and if the miners agree to enforce it, Bitcoin Unlimited nodes will follow along.</p><p>What is important is that the planned block-size limit increase, once active, will reduce fees and make confirmation times reliable once again. This is urgently needed today and cannot happen soon enough. With respect to what is needed tomorrow, the first increase in the block size limit will put to rest the fears of “hard forks” (that nearly all major alt-coins have successfully done by the way), and set the precedent that the block size limit should be kept above demand, thereby serving its original intent as a simple mechanism to prevent a malicious miner from producing huge spam blocks. The block size limit was never intended to interfere with the economics of the block space market.</p><p><em>Note: Current Bitcoin Unlimited nodes will follow the most-work chain without requiring an upgrade.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3ce1697e8bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[On the emerging consensus regarding Bitcoin’s block size limit: insights from my visit with…]]></title>
            <link>https://medium.com/@peter_r/on-the-emerging-consensus-regarding-bitcoins-block-size-limit-insights-from-my-visit-with-2348878a16d8?source=rss-7762a3e12bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/2348878a16d8</guid>
            <category><![CDATA[transaction-fees]]></category>
            <category><![CDATA[block-size-limit]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Peter R. Rizun]]></dc:creator>
            <pubDate>Thu, 23 Mar 2017 21:22:04 GMT</pubDate>
            <atom:updated>2017-03-24T05:07:55.871Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<h3>On the emerging consensus regarding Bitcoin’s block size limit: insights from my visit with Coinbase and Bitpay</h3><blockquote>“The upgrade to larger blocks must be decisive and absolute.”</blockquote><p>After visiting with Coinbase on 16 March 2017 and with Bitpay on 20 March 2017, this is the message that resonates inside me: “the upgrade to larger blocks must be decisive and absolute.” The community does not want the blockchain to split. A split would threaten Bitcoin’s network effect, cause confusion in the media, and create unnecessary work for many Bitcoin businesses. This article presents my perspective on what is happening in Bitcoin and how I suspect the upgrade to larger blocks will unfold (hint: it will be anticlimactic). It is adapted from the <a href="https://www.youtube.com/watch?v=pWnFDocAmfg">presentations I gave at Coinbase</a> and Bitpay (in both cases, I presented to the entire company, with people from remote offices watching online), and augmented with the information I’ve learned since then. The images are screenshots of my slides.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DCY6n3hGKo8AbyefQm3lhQ.png" /></figure><h4>Part 1: Where we are now</h4><p><strong>Growth has hit a wall </strong>— The chart above illustrates how the size of blocks have grown since the genesis block was mined on 3 January 2009. Each block is represented by a tiny dot and the coordinates of that dot indicate the time the block was mined and the block’s size. Bright regions indicate that a lot of blocks of a particular size were mined at that particular time while dark regions indicate that very few blocks of a particular size were mined at that particular time.</p><p>We see that Bitcoin went through a dormant period for the first year, before exploding exponentially. Two important observations to make are:</p><ol><li>At nearly all points in Bitcoin’s history, there was a broad distribution of block sizes. The explanation is that sometimes a block is found within a few seconds of the previous block and so very few transactions are waiting to be cleared, while other times the next block may not be found for over an hour and so many transactions are waiting to be cleared. The distribution of block sizes is a result of miners dynamically adjusting the amount of block space they produce to meet the real-time demand from Bitcoin users.</li><li>There are several bright white horizontal lines on the chart that correspond to historical (soft) limits imposed on the size of blocks by miners. In every case, once demand rose sufficiently, the line gave way to a new line at a larger block size. The Bitcoin network began to hit the uppermost line in 2015 and — as can be seen by dimming the exposure in the image above—no line has become this bright before breaking. <em>This is the invisible wall at 1 MB.</em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Q4yzO8BGWLqMP3kJuaN3Q.png" /></figure><p><strong>The invisible wall at 1 MB has changed the behavior of Bitcoin</strong> — Because miners can no longer dynamically adjust the size of the blocks they produce to meet the real-time demand for block space (e.g., nearly all blocks are now 1 MB in size), transactions cannot be cleared in a timely manner. For example, one year ago the average confirmation time was 18 minutes; now it is 1 hour and 46 minutes. Fees have increased too, jumping from $0.09 one year ago to $0.83 today (28-day trailing averages).</p><p>As a result of these changes, Bitcoin has become less usable and thus (all else held constant) will be used less, giving opportunities to similar systems (alt-coins) without these internally-imposed constraints to out-compete Bitcoin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6_Ov10p9UiK1-iMJP2BhXA.png" /></figure><p><strong>The wall is internal, not external</strong> — Normally when a complex system in nature stops growing, it is the result of something in the external environment: less available energy or a physical blockage, for example. In the case of the Bitcoin network, the wall is internal. Inspecting the “genetic code” of a typical network node reveals a gene instructing the node to reject blocks that are over 1,000,000 bytes in size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e4HKvqqU8GdL1E9oFZhu-w.png" /></figure><p><strong>Node operators are modifying their nodes to accept larger blocks</strong> — Remember that there are human operators behind the nodes that make up the Bitcoin network, and these human operators want Bitcoin to thrive. Nodes operators are modifying their nodes to accept larger blocks today and signalling this fact to the network. Last year, 1.2% of visible nodes expressed a new “permissive gene,” by November 6.7% did, and today 12% do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PgthCpeQX08sTwVDVDdmYw.png" /></figure><p><strong>Miners are modifying their nodes to begin producing larger blocks </strong>— Like node operators, miners are also expressing their preference for larger blocks. Miners do this by leaving a signal in the blocks they mine. Last year, 0.5% of the network hash power produced this signal, by November 12% did, and today approximately 40% of the network hash power is signalling that they wish to begin producing larger blocks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vh0nzpD7x3wTAqlzVUkkHQ.png" /></figure><h4>Part 2: How I suspect the upgrade to larger blocks will unfold</h4><p>In point form:</p><ol><li>The number of node operators and miners signalling for larger blocks will continue to increase.</li><li>Once a certain hash power threshold is met (perhaps 2/3rds or 3/4ths), miners will begin orphaning blocks from non-upgraded miners (e.g., refer to <a href="https://medium.com/@ViaBTC/miner-guide-how-to-safely-hard-fork-to-bitcoin-unlimited-8ac1570dc1a8#.jk1yje7cp">this piece</a> from ViaBTC). This will serve as an expensive-to-ignore reminder to non-compliant miners to get ready for the upgrade.</li><li>Miners will agree on a new block size limit that is equal to or less than what they believe the majority of the network is willing to accept (which appears to suggest a new block size limit less than or equal to 16 MB [some suggestions are 2 MB and 8 MB]).</li><li>Several weeks of notice will be given before miners will begin to accept larger blocks, to allow node operators running non-upgraded software sufficient time to upgrade.</li><li>Several weeks later, miners will begin producing larger blocks.</li><li>The client implementation known as Bitcoin Core will split internally, as one faction modifies the software it maintains in order to permit its users to track the emerging consensus.</li><li>The future will look similar to the past. Looking back, the bright line at 1 MB will not look that much different than the bright lines that came before it nor the bright lines that will come after it.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cCb0YmeYSxJCOOHygJqWEw.png" /></figure><h4>Part 3: Minimizing the risk of a blockchain split</h4><p>The following section is descriptive rather than normative. I describe the mechanism that exists and that I believe <em>will</em> be used to deter a split (rather than the mechanism I believe <em>ought to</em> be used), taking into account our discussions at BU with miners, businesses, and the incentive structures underlying bitcoin.</p><p><strong>[Level 1] Anti-split protection </strong>— The first level of anti-split protection comes from the power of Bitcoin’s network effect. If we imagine a blockchain split where 20% of the hash power splits off to maintain a “small-block” branch, then blocks on that branch will initially be found 4x as slowly as blocks on the “large block” branch. If we further imagine that the large-block branch permits (for example) up to 8 MB blocks, then the capacity of the small-block branch (ignoring Level 3 protection described below) would be only 1/32nd that of the large-block branch. On the large-block branch transactions would confirm quickly and fees would be small, whereas on the small block branch, wait times and fees would explode beyond the already-high levels we experience today.</p><p>Initially it would cost miners the same amount to mine a block on either the small-block or large-block chain. For example, if the cost to mine a block prior to a blockchain split was $10,000 USD, then the cost to mine a block immediately after the split would also be $10,000 USD regardless of which branch the miner chooses to mine on. What makes things interesting, is that a miner would not be able to sell his coins until 100 new blocks are built on top of the block he mined, and so his decision for which chain to mine must reflect the probability that the branch he selects would survive long enough for these mined coins to be sold.</p><p>Which chain is more likely to exist 100 blocks in the future? The secure chain with 80% of the hash power and 32X the capacity, or the insecure chain with only 20% of the hash power, high fees and long wait time? As more miners defect from the small block chain, the probability of that chain making it to 100 blocks is further reduced, encouraging <em>even more </em>miners to defect. Eventually the prospects for the minority chain become so poor that it is completely abandoned. No small-block miner would receive <em>any</em> revenue from the blocks he mined.</p><p>Of course, since miners know this ahead of time, it is unlikely that any will bother to mine on the minority chain in the first place (and thus no split would occur).</p><p><strong>[Level 2] Anti-split protection</strong> — Miners will orphan the blocks of non-compliant miners prior to the first larger block to serve as a reminder to upgrade. Simply due to the possibility of having blocks orphaned, all miners would be motivated to begin signalling for larger blocks once support definitively passes 51%. If some miners hold out (e.g., they may not be paying attention regarding the upgrade), then they will begin to pay attention after losing approximately $15,000 of revenue due to an orphaned block.</p><p><strong>[Level 3] Anti-split protection</strong> — In the scenario where Levels 1 and 2 protection fails to entice all non-compliant miners to upgrade, a small-block minority chain may emerge. To address the risk of coins being spent on this chain (replay risk), majority miners will deploy hash power as needed to ensure the minority chain includes only empty blocks after the forking point. This can easily be accomplished if the majority miners maintain a secret chain of empty blocks — built off their last empty block — publishing only as much of this chain as necessary to orphan any non-empty blocks produced on the minority chain.</p><p><strong>Risks</strong> — In order to be certain that the blockchain does not split, miners need to be confident that a sufficient fraction of the network hash power has upgraded, so that Level 3 anti-split protection will be effective if necessary. The biggest risk associated with the coming upgrade is that miners attempt to upgrade too early and without sufficient support. Exchanges, wallets, and other similar businesses have a fiduciary duty to preserve their customers’ assets and so all will honor bitcoins on the majority chain.</p><h4><strong>Part 4: What you can do</strong></h4><p>In my meetings with BitPay and Coinbase, the second-most common theme (second to the theme that there should be no split) is that we need more <em>genetic diversity</em> in nodes that are ready and willing to accept larger blocks. Presently, most of the upgraded nodes run Bitcoin Unlimited. To reduce the chances that a bug takes out several nodes of “one species,” we want to see more nodes running alternative implementations such as:</p><ol><li>Bitcoin Classic (or XT if upgraded to accept larger blocks)</li><li>Btcd (upgraded to accept larger blocks)</li><li>Bcoin (upgraded to accept larger blocks)</li><li>Bitcoin Core 0.14 (upgraded to accept larger blocks)</li></ol><p>Anyone can help by running such a node, either at home or in the cloud. The members of Bitcoin Unlimited are happy to provide assistance to qualified developers who wish to upgrade and maintain alternative implementations to prepare for larger blocks. Feel free to contact Bitcoin Unlimited at <a href="/service/mailto:info@bitcoinunlimited.info">info@bitcoinunlimited.info</a>.</p><h4>Acknowledgment</h4><p>The author acknowledges Andrew Clifford, John Swingle, Zanglebert Bingledack, Jerry Chan and Norway for their comments and suggestions. Special thanks to Jake Smith for presenting with me at Coinbase and BitPay.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2348878a16d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What we’re doing with Bitcoin Unlimited, simply]]></title>
            <link>https://medium.com/@peter_r/what-were-doing-with-bitcoin-unlimited-simply-6f71072f9b94?source=rss-7762a3e12bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f71072f9b94</guid>
            <category><![CDATA[bitcoin-unlimited]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[block-size-limit]]></category>
            <dc:creator><![CDATA[Peter R. Rizun]]></dc:creator>
            <pubDate>Mon, 13 Feb 2017 16:27:58 GMT</pubDate>
            <atom:updated>2017-02-13T20:57:31.796Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<p>Bitcoin has no center. It has no Board of Directors. It has no CEO, no President, no Chieftain, Sheik or Shah. Bitcoin is a decentralized network made up of voluntary participants — only loosely connected — who come together for their mutual benefit. There are users who transact in bitcoin to take advantage of its privacy and convenience, and investors who hold bitcoin hoping to profit from its price appreciation. There are node operators whose computers validate and relay the transactions made by Bitcoin users, and there are miners — a special type of node operator — whose mining farms append blocks of new transactions to the permanent blockchain ledger, rewarding themselves for this service with 12.5 newly-minted bitcoins.</p><p>The fact that Bitcoin has no center— that Bitcoin is decentralized — is the very essence of its nature. It is this lack of a center that helps to ensure the integrity of Bitcoin as<em> money.</em> If Bitcoin had a center, users would have to trust it not to reverse or censor payments for political reasons, or reward itself unfairly with newly-created bitcoins. If Bitcoin had a center, it would be much less useful as <em>peer-to-peer electronic cash</em>.</p><p>And there is no doubt: Bitcoin <em>is</em> useful as electronic cash. One measure of its usefulness is the <a href="https://blockchain.info/charts/market-price?scale=1&amp;timespan=all">price of a bitcoin</a>, which has increased from $1.08 six years ago, to $993 today.</p><p>A second measure of Bitcoin’s usefulness is how often it is used. The total <a href="https://blockchain.info/charts/n-transactions?scale=1&amp;timespan=all&amp;daysAverageString=7">volume of transactions</a> processed by the Bitcoin network has likewise climbed from 1 transaction <em>per minute</em> six years ago to an average just shy of 3 transactions <em>per second </em>today.</p><p>A third measure of Bitcoin’s usefulness is the number of people using it. Due to Bitcoin’s pseudonymous nature, user-base estimates are often disputed, today ranging anywhere from hundreds of thousands to tens of millions. But one thing that is not disputed is that the growth of Bitcoin’s user base was a primary driver increasing both the total volume of transactions and the price of a bitcoin.</p><p>Bitcoin’s lack of a center comes with a cost too: there is no conductor waving his baton, coordinating the network participants while they play from a curated score. Even changes that are widely perceived as positive are difficult to roll out, as doing so involves communication and cooperation between the loosely-connected participants who make up the Bitcoin network.</p><p>The most pertinent example of a need for change is the “1 MB block size limit.” In 2010, Satoshi Nakamoto <a href="https://github.com/bitcoin/bitcoin/commit/8c9479c">added a protocol rule</a> that limited the volume of transactions committed to the blockchain to roughly 3 per second (3 transactions per second typically fills blocks up to the 1 MB limit). When the limit was added, it was 800 times greater than the natural transaction volume, and so the limit did not constrain the natural growth of the system (it served only as an anti-spam measure). But today, the network is “maxed out,” regularly hitting this limit, and no longer free to grow how it did during the first 7 years of its history.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*22ix0l4oBDJ3agoLzVtUgQ.gif" /><figcaption>Fig. 1. Transaction volume on the Bitcoin network is now constrained by the 1 MB block size limit enforced by approximately 90% of network nodes. If the block size limit were raised, the transaction volume wouldn’t immediately fill it, but would rather continue to grow similar to how it grew before hitting the limit.</figcaption></figure><p>How might we increase this limit, if Bitcoin has no center that can do it for us? To answer this question, we must first understand <em>who</em> it is that is enforcing the block size limit.</p><p>So who is it? Why can’t Bitcoin users make <em>more </em>than the 3 transactions per second on average today? The reason is related to the fact that when a payment is sent between two users, it doesn’t actually go directly from User A to User B; instead it is relayed to, and approved by, every node on the network. There are approximately <a href="https://bitnodes.21.co/">6000 accessible nodes,</a> or assuming bitcoin has 5 million users, about 1 node for every 800 users.</p><p>When a miner finds a new block of transactions to add to the blockchain, each node checks the size of that block. If the block is larger than 1 MB (i.e., if it contains more than approximately 3 transactions per second worth of data), 9 out of 10 nodes today would reject that block as being invalid. No miner would risk intentionally producing a block larger than 1 MB because he knows that the network as a whole would reject it and his 12.5 BTC reward would be lost. And so even though miners may want to process more transactions per second, they don’t because effectively they can’t — the other nodes won’t let them.</p><p>We see then that to increase the limit — to allow miners to process more than 3 transactions per second —it is the <em>people operating these nodes </em>who must take action. Node operators must convincingly communicate to the miners that they are ready and willing to accept larger blocks. This is especially true for economically-significant nodes such as those running Bitcoin exchanges, payment processors, and web wallets. What Bitcoin Unlimited is doing, is giving node operators a flexible set of tools to allow them to do this.</p><p>Very simply:</p><ol><li>Bitcoin Unlimited allows a node operator to quickly and easily change his node’s block size limit.</li><li>Bitcoin Unlimited allows a miner to quickly and easily change the maximum size of blocks his node will produce.</li><li>Bitcoin Unlimited helps node operators and miners signal their block size preferences to the rest of the network.</li></ol><p>Today, approximately <a href="http://nodecounter.com/#nodes_pie_graph">1 in every 10 network nodes is running Bitcoin Unlimited</a>, with a median block size limit of 16 MB. As more and more node operators take similar initiatives and raise their node’s block size limits, miners become more and more tempted to produce larger blocks that contain more transactions. At some point — when miners are comfortable that a sizeable majority of the network is ready and willing to accept larger blocks — a miner will produce one, it will be accepted into the permanent blockchain ledger, and Bitcoin will be free to continue growing.</p><p>What we’re doing with <a href="https://www.bitcoinunlimited.info/">Bitcoin Unlimited</a> is that simple.</p><h4>Acknowledgement</h4><p>The author thanks Andrea Suisani, Peter Tschipper, Jerry Chan, and his mom for their reviews.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f71072f9b94" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Excessive-Block Gate: How a Bitcoin Unlimited Node Deals With “Large” Blocks]]></title>
            <link>https://medium.com/@peter_r/the-excessive-block-gate-how-a-bitcoin-unlimited-node-deals-with-large-blocks-22a4a5c322d4?source=rss-7762a3e12bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/22a4a5c322d4</guid>
            <category><![CDATA[bitcoin-unlimited]]></category>
            <category><![CDATA[on-chain-scaling]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Peter R. Rizun]]></dc:creator>
            <pubDate>Tue, 22 Nov 2016 16:19:49 GMT</pubDate>
            <atom:updated>2017-02-09T19:52:29.443Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<h4><em>Bitcoin Unlimited’s consensus layer is concerned with preserving the money property of Bitcoin. Blocks that are potentially problematic to accept for technical reasons are dealt with in a different layer where network consensus is not critical. This article describes how Bitcoin Unlimited’s excessive-block logic works from the perspective of a single node. A follow-up article will describe how this “node-scale” behavior facilitates the emergence of a fluid and organic block size limit at the network scale.</em></h4><p>Bitcoin is money. If you agree with that, then you probably also agree that Alice shouldn’t be able to create bitcoins out of thin air, that Bob shouldn’t be able to spend the same bitcoin twice, and that Carol shouldn’t be able to freely spend bitcoins that belong to Alice or Bob.</p><p>These properties — that we all intuitively recognize good money must have — are enforced by each node on the Bitcoin network. As described by Satoshi Nakamoto:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sHt7lxKrP5gtOsr8izc5cA.png" /><figcaption>Fig. 1. Excerpt from the Satoshi White Paper. A block is accepted if it preserves Bitcoin’s money property.</figcaption></figure><p>The enforcement of these rules takes place in each node’s <em>consensus layer</em>. We call it the consensus layer in part because there is widespread <em>human consensus</em> about what these rules are: they are simply the rules needed to make bitcoin function as <em>money</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/1*F01PwawjWHlzQY0kG-reKQ.gif" /><figcaption>Fig. 2. According to the Satoshi white paper, a node accepts a block if all transactions in it are valid and not already spent — that is, if the block preserves Bitcoin’s money property.</figcaption></figure><p>Fig. 2 visualizes the process of a node scanning every transaction in a new block. If all of the transactions are valid and not already spent, then the money property is preserved. This most recent block becomes the new “chain tip,” representing the most up-to-date version of the Bitcoin ledger. Mining nodes begin looking for a new block that builds upon this new chain tip. When a miner finds one, the same process repeats, and Bitcoin’s blockchain is extended once more.</p><p>So far so good. Everyone agrees and understands what the rules are.</p><p>But what if there is a <em>technical</em> reason that it <em>might</em> be a bad idea to accept a particular block (even though the block would still preserve Bitcoin’s money property)? Remember, the Bitcoin network is made up of computer hardware connected over physical communication channels and subject to physical limitations. A block could contain so many transactions that a miner might be worried that it would never reach miners on the other side of the Great Firewall of China, or a node operator might be worried that it would take up too much of his hard-drive’s space to store or too much of his node’s processor time to validate.</p><p>Bitcoin Core gives a black-and-white answer to the <em>fuzzy</em> question of what kind of blocks <em>might</em> be a bad idea to accept. Bitcoin Core says that if the block is larger than 1 MB then it <em>must</em> be rejected (no differently than how the block would be rejected if it contained a double-spend). This rule thus exists in Core’s <em>consensus layer</em>. It works fine if all the other nodes give the same black-and-white answer to this fuzzy question (Fig. 3a), but if a sufficient fraction of the network disagree (e.g., because blocks are full) and think that it’s also a good idea to accept 1.5 MB blocks (remember 1 MB was just a ball-park guess made 6 years ago anyways), then Core nodes will be “forked off the network” (Fig. 3b). Core users will no longer see their transactions confirmed (or confirmed only very slowly) and miners using Core will waste their hash power trying to extend the wrong block. This is a negative outcome that can be avoided.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mnu-4GCFQaUyLEYmJL2vtQ.gif" /><figcaption>Fig. 3. Because the block size limit is part of a Core node’s consensus layer, Core nodes will be forked from the Bitcoin network if the network begins to permit blocks greater than 1 MB.</figcaption></figure><p>Before we describe the way a Bitcoin Unlimited node deals with the same problem, notice that Core’s block size rule is not like the other two rules we considered (i.e., those requiring that all transactions in a block must be valid and not already spent). Instead of enforcing Bitcoin’s money property, this additional rule is a hack that addresses a <em>temporary</em> technological limitation of the physical Bitcoin network. Indeed, a technical constraint related to transporting blocks around the network has crept into Core’s consensus layer.</p><p>In Bitcoin Unlimited, the consensus layer is only concerned with preserving the money property of Bitcoin. An Unlimited node deals with the <em>fuzzy</em> question of which blocks <em>might </em>be difficult to accept for technical reasons outside the consensus layer and in a <em>fuzzy</em> way: it makes a guess and then changes its mind if it guessed wrong!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gl4071aAjjR7Tp91sujteg.gif" /><figcaption>Fig. 4. Diagram of a Bitcoin Unlimited node’s excessive-block gate. The width of the opening represents the node’s block size limit. Blocks smaller than this limit immediately pass through the gate to the consensus layer. Blocks larger than this are stopped by the gate. The gate only opens if a sufficient number of additional blocks are mined on top of the excessive block. How many additional blocks are required to open the gate is known as the node’s <em>acceptance depth</em>.</figcaption></figure><p>The node does this by using what might be called an <em>excessive-block gate</em>. The excessive-block gate first checks the size of each new block (and other properties that might make the block difficult to accept for technical reasons such as the number of sigops and the size of any large transactions [see notes below]). If the block is not excessive, it passes directly through the gate to the node’s consensus layer. However, if the block is excessive, the gate holds the block back, preventing it from becoming the new chain tip. The gate only opens if a sufficient number of additional blocks are stacked above the excessive block. What constitutes an excessive block is set by the user (see notes below).</p><p>If the majority of the network agrees that the block in question was excessive, then eventually a new block will come to orphan the excessive block (i.e., because most miners will still be mining on the prior block), as animated in Fig. 5.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*D7okCc2v_pFqALBMU5tJQA.gif" /><figcaption>Fig. 5. A Bitcoin Unlimited node’s excessive-block gate catches the excessive block. Because no blocks are built on top of the red block, the gate never opens and the block is orphaned.</figcaption></figure><p>However, if the network disagrees, then new blocks will be built upon the block the node thought was excessive (i.e., because most miners would have moved on to this “excessive” block). Once the stack of blocks reaches a certain height defined by the node’s<em> acceptance depth</em>, the gate opens, allowing the blocks to pass through to the consensus layer and extend the chain. (The node’s acceptance depth is user configurable.) Unlike a Core node, an Unlimited node will not be forked off the network in the event that the network as a whole begins to accept larger blocks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*GNUCCPnHCEo3S_f3HKPOlA.gif" /><figcaption>Fig. 6. A Bitcoin Unlimited node’s excessive-block gate catches the excessive block. After a sufficient number of blocks are built on top of it, the gate opens and the block is accepted. This animation corresponds to an acceptance depth of 2. Note that the animation is slightly misleading: as presently programmed, the gate would remain open until the node sees 144 non-excessive blocks in a row.</figcaption></figure><p>Of course, it is also possible that both chains are built upon— sort of a mixture of Fig. 5 and Fig. 6. Still, the excessive-block gate works unchanged. As soon as a red block has enough blocks built above it, the gate opens, presenting the red block and the blocks above it as <em>one possible</em> chain tip. If it is longer than the current chain tip, the current chain tip will be replaced. If it is not longer, the current chain tip will be retained.</p><p>Because the excessive-block logic exists outside the consensus layer, it is <em>not</em> critical that nodes deal with excessive blocks in the same way. Each node operator is free to express his opinion about what makes a block “excessive” by configuring his node’s excessive-block gate appropriately. Through the cumulative effect of thousands of node operators and miners expressing their preferences like this, an “effective block size limit” naturally emerges. This will be the subject of our next article.</p><h4>Acknowledgement</h4><p>The author kindly thanks Roger Murdock, Andrea Suisani (<em>sickpig</em>), Andrew Stone (<em>thezerg</em>), HostFat, and Andrew Clifford (<em>solex</em>) for their feedback on earlier drafts of this article.</p><h4>Copyright</h4><p>This document and its images are placed in the public domain.</p><h3>Notes</h3><h4>What makes a block excessive?</h4><p>A block is considered excessive unless it contains no more than <em>Q</em>max megabytes and no more than 20,000*ceiling(<em>Q</em>max) sigops. <em>Q</em>max is configurable in Bitcoin Unlimited. For compatibility with today’s blockchain, any transaction size is allowed in block ≤ 1MB. In blocks whose size is &gt; 1MB, a block is excessive if it contains a transaction with a size ≥ <em>q</em>max (which is 1 MB by default). This limitation on the size of a transaction solves the quadratic hashing problem without adding a new rule to the consensus layer.<em> </em>These rules are identical to Core’s for <em>Q</em>max=1.</p><h4><strong>How long does the gate stay open?</strong></h4><p>By default, once opened, the excessive-block gate doesn’t reset to the closed position until the node sees 144 non-excessive blocks in a row. Without this feature, a node would constantly trail the blockchain tip if a series of excessive blocks is produced.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22a4a5c322d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>