<?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 Igor Korsakov on Medium]]></title>
        <description><![CDATA[Stories by Igor Korsakov on Medium]]></description>
        <link>https://medium.com/@overtorment?source=rss-4c10f682a52e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*NeqAGkfF31rtTDfH.</url>
            <title>Stories by Igor Korsakov on Medium</title>
            <link>https://medium.com/@overtorment?source=rss-4c10f682a52e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 13:29:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@overtorment/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[Preparing for war — how was 2019 and a glimpse of the future]]></title>
            <link>https://medium.com/bluewallet/preparing-for-war-how-was-2019-and-a-glimpse-of-the-future-72637ffe58eb?source=rss-4c10f682a52e------2</link>
            <guid isPermaLink="false">https://medium.com/p/72637ffe58eb</guid>
            <category><![CDATA[bluewallet]]></category>
            <category><![CDATA[bitcoin-wallet]]></category>
            <category><![CDATA[lightning-network]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Igor Korsakov]]></dc:creator>
            <pubDate>Wed, 25 Dec 2019 22:52:34 GMT</pubDate>
            <atom:updated>2019-12-26T17:06:41.998Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Preparing for war — how was 2019 and a glimpse of the future</strong></p><p>2019 was a great year for BlueWallet. Although it is a new wallet and still in its infancy, we did get some some <a href="https://www.coindesk.com/bitcoins-lightning-comes-to-apple-smartwatches-with-new-app">media coverage</a>, we did get some <a href="https://docs.google.com/spreadsheets/d/1aZ1zbaUEzCo9NCctN8-eL2VLIiSdY009tTJvRXDUWEw/edit#gid=0">recognition from industry experts</a> and we did get <a href="https://t.me/bluewallet">some users</a> to remind us how much we suck and how much better it can still be. All that, working on the project on our free time in a pure open source fashion.</p><p>This year blew away our wildest expectations on what we thought we could achieve. To give you a bit of perspective, at this time last year we were releasing the android version of the app and our Lightning wallets feature right before Christmas. And probably, at that time, most of you hadn’t really heard about Blue.</p><p>Talking about Lightning. While the Lightning Network slowly matures, and after doing our part to put it on the spotlight and bringing the attention it actually deserved. We decided to take a step back and work on the layer that really matters. The base layer.</p><p>In the core, BlueWallet is (and always was) a non-custodial on-chain <a href="https://bluewallet.io/">bitcoin wallet</a>, born out of the frustration and ashes of the 2017 Bull market. When fees were high and the majority of wallets still had not implemented segwit and flexible fees. Paying $20 in fees for a transaction because your wallet’s fee estimation was broken? That was a real deal back then.</p><p>The very first release of BlueWallet fixed exactly that: segwit, flexible fees (starting from 1 sat/byte), and RBF (replace-by-fee).</p><p>During the next cycle of adoption (this is how I like to call the bull-run) I expect to see exactly the same thing we saw in 2017: with that many people discovering the advantages of Bitcoin and making their first happy transactions. The block space will again be an extremely scarce commodity.</p><p>After another block reward halving, a more mature fee market will develop, and we will witness a natural competition for block space. This is why I think it is important to prepare for that in advance: your bitcoin wallet app (as a customer-facing software) should be the one to act in your best interests, trying to save as much pennies on transactions as possible and, at the same time, give you the full control you need and should have.</p><p>In preparation for that, at BlueWallet we implemented:</p><ul><li><strong>CPFP — Bump transaction</strong> (child-pays-for-parent) — a technique that allows you to spend incoming transaction that is unconfirmed by sending it to your another address, but with the total fees higher than the original transaction. This helps if it takes forever for your incoming transaction to confirm on the blockchain.</li><li><strong>RBF — Bump transaction</strong> (replace-by-fee) — if you sent a transaction and it’s still unconfirmed you can replace it with the one with higher fees, making it more attractive for miners to mine, thus, speeding up the confirmation.</li><li><strong>RBF — Cancel transaction</strong> — a technique similar to regular RBF, but where the replacement transaction’s output is the address you control, thus, paying yourself, effectively cancelling the transaction.</li><li><strong>Batch send</strong> — when creating a transaction add as many payees as you want. This helps to save on fees when having to pay multiple destinations. Making a nice UI/UX on this one was a challenge.</li><li><strong>Flexible fees</strong> (starting from 1 sat per byte) and fee recommendations fetched from a real up-to-date bitcoin node.</li><li>Finally, <a href="https://twitter.com/bluewalletio/status/1207311114209497089">from now on, we are <strong>promoting BIP84 Native SegWit wallets as the default wallet</strong></a> when users create a new wallet. We were warned and actually advised against that, as that triggers a stream of complaints from users who can’t withdraw coins from exchanges because exchanges still don’t recognize ‘bc1……’ addresses. But it’s time. Really. Users should take their complaints to obsolete exchanges. Native segwit will allow saving on fees even more.</li></ul><p>I like to repeat that <strong>BlueWallet is preparing for war</strong>, and this war will be for block space. Once another billion of Earth inhabitants realize the benefits of hard, censorship-resistant and non-confiscatable money.</p><p>If this is the kind of fight you want to be part of, protecting the Bitcoin user interests over miners and corporate players, <a href="https://github.com/BlueWallet/BlueWallet"><strong>you know where to go</strong></a>. And you are much welcomed!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wzOrnxP3ajASE1jK" /><figcaption>Bluewallet vs Blockchain wallet</figcaption></figure><p>That was not the only features we were busy with. Among many, some <strong>new and also remarkable features</strong>:</p><ul><li>Connect to your own Bitcoin Node through Electrum server for maximum self-sovereignty, no SPVs, full node fashion.</li><li>Watch-only ZPUB wallets. Just scan the QR code with a ZPUB or input a ZPUB into the text field directly. XPUB and YPUB are supported as well.</li><li>With recent transition to PSBT under the hood, we added a workflow to have your transaction signed on your hardware wallet in a pure air-gapped fashion. Just mark your watch-only ZPUB wallet as working with an external HW wallet, then create a transaction and feed the QR code with the unsigned PSBT to your hardware wallet. Sign it on hardware wallet, scan it back to BlueWallet and broadcast it to the network. You have just conveniently made a transaction on your mobile device, while keeping your private keys on a secure hardware wallet, truly air-gapped! This is still in beta and only the<a href="https://twitter.com/StepanSnigirev/status/1209426608949465088"> CryptoAdvance device is 100% supported</a>, but we will work on testing and polishing the integration with other hardware wallets.</li></ul><p>We still have a lot of work to do:</p><ul><li>Ongoing integration with HodlHodl. Non-custodial fiat-to-btc trading is an important bitcoin infrastructure project. It’s a hedge against all regulated exchanges going bad with AML/KYC.</li><li>When LND will be stable enough we will include it as part of the wallet, allowing users to switch their lightning wallets into non-custodial mode, and gradually make it the default mode. But custodial lightning brought some unexpected benefits, such as practically unlimited incoming capacity, instant on, zero onchain footprint. It makes sense to maintain both and explore possible synergies here.</li><li>Multisig wallets are hard to tackle, mostly UI/UX wise. A proper joining ceremony is a hard task to design. The ceremony of creating a transaction and inviting all participants to sign it, can also be a challenge.</li><li>To reach maximum security, it makes sense to use only multisig wallets with all keys residing on your own devices, preferably hardware wallets from different manufacturers. Designing, implementing and testing this flow is not easy.</li><li>Sign message with your wallet/verify. I strongly feel that your private keys should help you with authentication on 3rd-party services, but what’s the proper way to do that we do not know, yet.</li><li>Provide-UTXO — when creating a transaction, supply UTXO to use in form of JSON document. This allows using the wallet on a completely offline/air-gapped device, provided you carry with you your up-to-date UTXO set. Then you sign it, broadcast via SMS/pigeons/whatever and congrats! You can transact even from a desert island.</li><li>Choose UTXO / UTXO spend strategies — when creating a transaction, choose which UTXO (or UTXO strategy) you want to use. For example, you could strive for the smallest fees (use higher-value outputs first), optimize for amounts used (sum of input amounts are close to total output amounts — might produce dust output), or you could consolidate (use all available inputs — yes this completely destroys privacy but helps to prepare for a period of high fees) etc.</li><li>Coinjoin — a proper coins mix service with other peers is tricky, but we might attempt it.</li><li>RBF-Service. A trustless server that broadcasts your replacement transactions with higher fees if previous transaction wasn’t confirmed in a timeframe you specified. You can start with 1 sat/byte transaction and gradually increase fee until it’s confirmed in a reasonable time (with the smallest fee possible). Automatically. This is only an idea at the moment.</li><li>NFC. Users will be able to ‘tap-to-share’ their receive address to other users, and other NFC-capable devices. This will eliminate the requirement for users to have to fiddle with their device’s display brightness, and having to move around their camera view in order to scan a QR Code. This feature will also be useful for our upcoming BTCPayServer integration.</li><li>Push notifications have been set aside for too long, but they will be eventually done.</li></ul><p>And some <a href="https://medium.com/bluewallet/work-in-progress-building-a-bitcoin-wallet-e81ca6db82d7">other more experimental consumer ideas</a> that we are already sharing with the community and putting it out there. The list doesn’t end there, but one needs to keep some secrets as well :) Feel free to bring your ideas on!</p><p>Just some statistics of the year:</p><ul><li><strong>32 production releases</strong></li><li><strong>738 commits</strong></li><li><strong>27 contributors</strong></li></ul><p>A special thanks to all the contributors, you guys rock! 🤘</p><p>To summarize, we are preparing for war! It will be a war about block space, it will be a war about providing the users with the right tools to fight against corporate interests trying to take advantage of Bitcoin. Join us, we promise it won’t be a boring one!</p><p><a href="https://github.com/blueWallet/blueWallet">https://github.com/bluewallet/bluewallet</a></p><p>Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72637ffe58eb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bluewallet/preparing-for-war-how-was-2019-and-a-glimpse-of-the-future-72637ffe58eb">Preparing for war — how was 2019 and a glimpse of the future</a> was originally published in <a href="https://medium.com/bluewallet">bluewallet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BlueWallet introduces Lapp Browser and Lapp Marketplace]]></title>
            <link>https://medium.com/bluewallet/bluewallet-introduces-lapp-browser-and-lapp-marketplace-eed36721d853?source=rss-4c10f682a52e------2</link>
            <guid isPermaLink="false">https://medium.com/p/eed36721d853</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[lightning]]></category>
            <dc:creator><![CDATA[Igor Korsakov]]></dc:creator>
            <pubDate>Mon, 21 Jan 2019 10:31:12 GMT</pubDate>
            <atom:updated>2019-01-21T10:50:03.793Z</atom:updated>
            <content:encoded><![CDATA[<h4>In the latest release of BlueWallet (v3.6.0) for Android &amp; iOS we added a Lapp Browser. Similar to Dapp Browser, Lapp Browser allows you to interact with Lightning-powered apps with less friction.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8aBrXNxm5J8qGqxNe3leSQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*8ocpMPrkE-pasqTKq8NeGQ.gif" /><figcaption>Example of using Yalls.org in Lapp Browser</figcaption></figure><p>What is Lightning-powered App (Lapp)? In general, this is any application which works with Lightning network. In our case, this is any web-page that can receive payments or pay you back (not only that but more on that later).</p><p>Since BlueWallet added Lightning integration, our users made thousands of payments, and we have some stats and insights to share (which we will in further blog posts), but for now, we want to bring closer users and real business. We want to make it easier for regular people to discover great goods and services, allow them to interact with Lapps, pay and get paid easily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*I9tmpGCk61N84-PCZ1TBFw.gif" /><figcaption>Example paying for SMS with Lightning. You can also pay for a virtual number with Lightning (anonymity 146%)</figcaption></figure><p><em>Its been one year since Lightning network mainnet launch, and it’s time to take it seriously.</em></p><p>Thus, the very first thing to meet &amp; greet users on the Lapp Browser will be a Lapp Marketplace — a simple collection of Lapps worth of your attention.</p><h3>How does it work?</h3><p>In the essence, Lapp Browser is a webview that navigates to Lightning-enabled webpages. The webview has javascript code injected, which bridges user’s Lightning wallet with the Lapp, allowing a more smooth interaction. The interaction part itself can evolve a lot in the future to be and feel more native, more integrated, etc.</p><p>BlueWallet partially conforms to <a href="https://github.com/wbobeirne/webln">webln</a> specification (which is still in early alpha), so any Lapp that implements that spec will integrate with the wallet more naturally. Ideally, paying and getting paid in Lapp will be within one button tap (not a hustle of switching between apps and copypasting <em>bolt11</em> strings).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*QZlxfhsTQob4xJAaedg6DA.gif" /><figcaption><em>Our initial implementation allows frictionless send and receive (for the Lapps that implement webln spec)</em></figcaption></figure><h3>Why are we doing this?</h3><p>There’s no way to know what the future of wallets will be.</p><p>Imagine a world where you have full control of your money. Bitcoin is the main currency online and offline. You open your wallet app where you are able to easily pay your bills, send money to your family, buy stuff online, topup your phone, etc.</p><p>This is the world we want to live in. And this experiment is a first step to start learning how can we build this on top of the Lightning Network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*3UuRMNuJputXC04a9kMJgA.gif" /><figcaption>Using ZigZag inside Lapp Browser to exchange cryptocurrency</figcaption></figure><h3>Whats next</h3><p>Lots of work to be done. At the moment very few Lapps implement webln spec. Although this spec is still in alpha stage, it feels like a way to go. For example, every Dapp supports web3 specs, so developers might want to build their next Lapp considering webln compatibility. Except for frictionless send and receive, this spec also drafts providing identity to Lapp (so Lapp can seamlessly create an account and authorize you; no personal information leaked though, only anonymous public key is shared), and also mechanisms to sign messages with your identity, and verify other people signatures. Please, give <a href="https://github.com/wbobeirne/webln">this spec</a> some love.</p><h3>Disclaimer</h3><p>BlueWallet’s Lightning integration is custodial by default, but you can easily connect it with your own LND instance for the same experience (everything we do is opensource).</p><p>Be warned, there might be bugs (please report them). Actually, with this release we’ve hit a sort of “beta” jackpot: Lapp browser is in beta, Lightning integration is in beta, and BlueWallet itself is still in beta. Don’t use it for large amounts! Be reckless, but not too reckless.</p><h3>Handy links</h3><ul><li><a href="https://bluewallet.io/">https://bluewallet.io</a></li><li><a href="https://medium.com/bluewallet/bluewallet-brings-zero-configuration-lightning-payments-to-ios-and-android-30137a69f071">Our Lightning integration announcement</a></li><li><a href="https://medium.com/bluewallet/a-glimpse-on-the-future-of-bitcoin-ux-4129cca9ece6">A glimpse on the future</a></li><li><a href="https://github.com/BlueWallet/Website/tree/master/marketplace">Marketplace sources</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eed36721d853" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bluewallet/bluewallet-introduces-lapp-browser-and-lapp-marketplace-eed36721d853">BlueWallet introduces Lapp Browser and Lapp Marketplace</a> was originally published in <a href="https://medium.com/bluewallet">bluewallet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BlueWallet brings zero-configuration Lightning payments to iOS and Android]]></title>
            <link>https://medium.com/bluewallet/bluewallet-brings-zero-configuration-lightning-payments-to-ios-and-android-30137a69f071?source=rss-4c10f682a52e------2</link>
            <guid isPermaLink="false">https://medium.com/p/30137a69f071</guid>
            <category><![CDATA[lightning-network]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[bluewallet]]></category>
            <dc:creator><![CDATA[Igor Korsakov]]></dc:creator>
            <pubDate>Wed, 19 Dec 2018 23:50:26 GMT</pubDate>
            <atom:updated>2018-12-21T22:10:28.048Z</atom:updated>
            <content:encoded><![CDATA[<h4>With the release of LndHub, completely open source pluggable backend for mobile wallets.</h4><p>BlueWallet has just released support for the Lightning Network. Being a 2nd layer scaling solution, Lightning promises low-fees and instant payments. But as a drawback brings a lot of complexities and unfamiliarities to unsuspecting users.</p><p>Completely aligned with Bitcoin’s “be your own bank” for sovereign individuals, Lightning requires users to run their own Lightning nodes (besides their own Bitcoin node), open and manage state channels with other nodes (this is what makes a network), maintain liquidity (both incoming and outgoing) in channels, and basically, do a hard ‘node operator’ work. This is the cost of independence from financial institutions.</p><p>Our approach to Lightning is different.</p><p>We decided to hide the complexity of running a node under the hood and take over the work of hub operator.</p><p>This makes the user experience smooth, bringing Lightning payments to anyone who is at least remotely acquainted with cryptocurrencies and mobile wallets.</p><p>We called it LndHub, an opensource wrapper around LND. This is “3rd layer solution” (as we jokingly call it; of course this is not real 3rd layer).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vqmo5jBOWO1VeKG25UHvXQ.png" /></figure><p><strong>This is how it works</strong>: the user sends his bitcoins to a dedicated top-up address, and this balance is added to his account on LndHub. Then, the user can use this balance to pay Lightning invoices. But under the hood, it’s actually LndHub who pays the invoice, deducting the user’s account balance. It works the same way when the user wants to receive a Lightning payment — it’s LndHub who creates Lightning invoice and actually receives coins on one of its channels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y4mllrICanzylWy4rrkdyg.png" /><figcaption>1) create wallet 2) empty wallet instantly created 3) manage funds 4) send BTC to top-up address 5) after 3 confirmations lightning balance is ready to be spent 6) start paying lightning invoices!</figcaption></figure><p>This has its drawbacks. Basically, user transfers his funds in custody to a 3rd party (and we all know that trusted 3rd parties are security holes, thanks to Nick Szabo). But how much of a problem is that? Let’s think a bit about it. Trust is minimized to an absolute minimum required to carry its duties. On the other hand, Lightning is expected for day-to-day use, and how much the average user usually has in his pocket for daily expenses? Probably, $50 for groceries and coffee? A fair tradeoff risking those for an exchange of usability.</p><p>Of course, on-chain Bitcoins private keys should be in full user’s control. Not your keys — not your coins, as they say. We are thinking of it as “savings” account (as opposed to Lightning — “current” account).</p><p>Other drawbacks include centralisation of the network. Given lots of users start using LndHub, amount of funds and liquidity it holds will also grow, turning LndHub into a major Hub on the network. This was anticipated in the dawn of Lightning development, and we don’t see a problem with that. Network still remains open, and is free to morph and mutate as per current economic reality.</p><p>Luckily, <strong>LndHub is completely opensource, </strong>which means any tech-savvy user can deploy his own instance of LndHub and use it with his wallet. This instance can even be shared with the party, such as friends and family: each member will have his own independent balance and transaction history. Should be pretty convenient for someone to onboard more people to the Lightning party. Just install lnd, bitcoind, lndhub and in your wallet settings put a link to your hub. Share the link with your friends and help them config their wallets. Done!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*Q12kpMPZ726TWRJGl_iT-w.png" /><figcaption>open Settings and hook BlueWallet with your own lnd/lndhub</figcaption></figure><p>This also mitigates effects of hub centralization, letting the user maintain control over his on-chain and off-chain funds.</p><p>To sum this up, here’s a quick pros and cons list:</p><p><strong>Pros</strong>:</p><ul><li>Improves user experience, allowing to onboard more users</li><li>Completely removes technicalities, like opening and maintaining channels and liquidity (both incoming and outgoing)t</li><li>Improves chances of successful payment routing</li><li>Receiving payments is a breeze (lndhub and lnd are 100% online, no need for Watchtowers)</li><li>Single LndHub (if self-hosted) can help share lightning experience with many users (think friends and family)</li></ul><p><strong>Cons</strong>:</p><ul><li>Funds are held by a 3rd party (but only small amounts for everyday use). Mitigated by opensourcing LndHub.</li><li>Minor network centralization</li><li>Less private. Hub operator knows who paid whom. Luckily, trust is minimized as Hub doesn’t know who is on sending and who is on receiving end, and what is being paid for. And again, LndHub is opensource for people needing extra privacy.</li></ul><h4>What next?</h4><p>You can give it a try with <a href="https://bluewallet.io/">BlueWallet mobile app (iOS and Android)</a>, check out code for <a href="https://github.com/BlueWallet/LndHub">LndHub</a> or <a href="https://github.com/bluewallet/bluewallet">BlueWallet</a> (both are opensource and MIT licensed), and let us know what you think! Of course, there might be bugs, so be careful and please report them. LndHub API spec is also open, so you can build your own product on top of it.</p><p>For bonus cypherpunk points you can build wallet binaries yourself and plugnplay your own bitcoind/lnd/lndhub!</p><h4>Handy links</h4><ul><li><a href="http://lndhub.io/">http://lndhub.io</a></li><li><a href="http://lndhub.io/about">http://lndhub.io/about</a></li><li><a href="https://bluewallet.io/">https://bluewallet.io</a></li><li><a href="https://itunes.apple.com/us/app/bluewallet-bitcoin-wallet/id1376878040?l=ru&amp;ls=1&amp;mt=8">https://itunes.apple.com/us/app/bluewallet-bitcoin-wallet/id1376878040</a></li><li><a href="https://play.google.com/store/apps/details?id=io.bluewallet.bluewallet">https://play.google.com/store/apps/details?id=io.bluewallet.bluewallet</a></li><li><a href="https://github.com/BlueWallet/lndhub">https://github.com/BlueWallet/lndhub</a></li><li><a href="https://github.com/BlueWallet/Bluewallet">https://github.com/BlueWallet/Bluewallet</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30137a69f071" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bluewallet/bluewallet-brings-zero-configuration-lightning-payments-to-ios-and-android-30137a69f071">BlueWallet brings zero-configuration Lightning payments to iOS and Android</a> was originally published in <a href="https://medium.com/bluewallet">bluewallet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitcoin Replace-By-Fee guide]]></title>
            <link>https://medium.com/@overtorment/bitcoin-replace-by-fee-guide-e10032f9a93f?source=rss-4c10f682a52e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e10032f9a93f</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[rbf]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[double-spend]]></category>
            <dc:creator><![CDATA[Igor Korsakov]]></dc:creator>
            <pubDate>Wed, 25 Oct 2017 15:04:41 GMT</pubDate>
            <atom:updated>2017-10-25T15:04:41.672Z</atom:updated>
            <content:encoded><![CDATA[<h3>Bitcoin Replace-By-Fee guide: fix stuck transactions, do doublespends</h3><p>In this article we will study what is Replace-By-Fee transactions and how to use them. Surprise, with RBF you can try to do doublespends!</p><p>Imagine situation when Alice sends coins to Bob. She creates and signs the transaction, and broadcasts it to the network for confirmation. Unfortunately, the transaction hangs unconfirmed for a long time, as it has low fee (or an ok fee under other circumstances, but at this point of time unconfirmed transactions queue is too big and miners prefer transactions with higher fees). What can Alice do? Her options: <strong>a)</strong> wait for a confirmation (might take a while) <strong>b)</strong> wait till transaction gets cancelled (most miners will exclude it from mempool) and freed coins would be spendable again (i.e. create transactions using those coins and most pools won’t reject it as doublespend, as old transaction got cleared from mempool) <strong>c)</strong> replace transaction, increasing the fee (RBF).</p><p>Thus, <strong>RBF — replace of existing transaction with a new one, increasing the fee. </strong>“Replace” means that new transaction will use same inputs (i.e. coins) as old one, and this would not be considered as doublespend (i.e. cheating). As result, only one transaction will be confirmed, mined and added to blockchain (most probably the one with higher fee).</p><p>RBF was introduced in <a href="https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki">BIP-0125</a></p><p>But kind of transaction is <strong>potentially replaceable</strong>? Good question. Transaction replacement was introduced by the Bitcoin designer himself Satoshi Nakamoto, but disabled at some point. It was then improved/upgraded to <strong>RBF</strong> and shipped in <strong>Bitcoin Core 0.12+</strong>. For replaceability, there’s a designated <em>int</em> field called <em>nSequence</em>, which signals which transaction is an older version and which one is younger. So, for the transaction to be replaceable <em>nSequence</em> should be lower than <em>MAX</em> (0xffffffff — 1). By default, most wallets set <em>nSequence </em>to maximum and you have to manually enable transactions replacement ability in settings. Here’s how it looks in Electrum:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/0*vTdHldiBeavNmY3U.png" /><figcaption>Enable RBF in Electrum wallet</figcaption></figure><p>An example of decoded transaction:</p><pre>... <br>&quot;inputs&quot;: [ <br>    { <br>       &quot;addresses&quot;: [ &quot;....&quot; ], <br>       &quot;output_index&quot;: 0, <br>       &quot;output_value&quot;: 1010000, <br>       &quot;prev_hash&quot;: &quot;...&quot;, <br>       &quot;script&quot;: &quot;...&quot;, <br>       &quot;script_type&quot;: <br>       &quot;pay-to-pubkey-hash&quot;, <br>       &quot;sequence&quot;: 0 <br>    }, <br>...</pre><p><em>Sequence</em> is indicated for each transaction input.</p><p>In Electrum after you enable RBF you’ll be able to increase transaction fee right in GUI. Right click the transaction and you’ll see it. But now we are going to manually create RBF transaction. Why? First of all, to better understand what’s going on. Second, for more versatility. In case of <strong>manual RBF</strong> we can <strong>specify totally different destination addresses</strong>, which can be considered a <strong>doublespend</strong>.</p><p><strong>This is how it works</strong>. Alice wants to pay Bob for goods. Alice creates, signs and broadcasts transaction (which transfers coins to Bob), but intentionally sets low (or zero) fee. If Bob is not cautious enough he accepts unconfirmed transaction as payment and sends goods to Alice. After that Alice replaces the transaction with output addresses which Alice controls. Basically, Alice returns her funds. Bob got scammed. How can Bob avoid that? First, if Bob wants to accept unconfirmed transactions (for speed), don’t accept <em>replaceable</em> transactions (where <em>nSequence</em> is lower than <em>MAX</em>). Of course, ideal case when Bob waits for enough confirmations.</p><h3>Now let’s try to do an RBF with doublespend.</h3><p>This is a real live example that can be verified on blockchain.</p><p>We shall use neat opensource tool <a href="https://github.com/OutCast3k/coinbin/">github.com/OutCast3k/coinbin</a> which can create transactions with arbitrary inputs and outputs. It works almost completely inside browser tab without server interaction. Live version is available on <a href="https://coinb.in/">coinb.in</a> but you are encouraged to download it and run from localhost.</p><p>Let’s create <em>New → Transaction</em>. Get a private key in WIF format and load unspent outs for that key. In <em>Outputs </em>tab set destination address, set amount. In <em>Advanced Options</em> dont forget to tick <em>“Make this a RBF transaction”</em> — in that case, <em>nSequence </em>won’t be set to <em>MAX</em>. Click <em>Submit</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*T2KUg-arH5AyjUh-.png" /><figcaption>Construct transaction</figcaption></figure><p>Transaction is created. Note the <em>Transaction Fee</em> — it’s the difference between sum of available coins (inputs) and sum of all sent coins (outputs). This difference is a miner fee, and it’s set to zero in this example. Click <em>Sign</em>, copypaste the transaction hex, same private key and finally sign the transaction:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RN3a_9aGkvwxfFi1.png" /><figcaption>Sign transaction</figcaption></figure><p>Broadcast the transaction (you can use any endpoint):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xj_U8JCIvEdGqLn-.png" /><figcaption>Broadcast transaction</figcaption></figure><p>This is how the transaction looks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PKiUj-Bmuqve7jau.png" /><figcaption>Unconfirmed transaction!</figcaption></figure><p>Now, let’s use RBF. Create new transaction, and take outs from the same WIF. Let’s specify totally different destination address! One of the destinations we are going to set to <em>1CWHWkTWaq1K5hevimJia3cyinQsrgXUvg</em> — this is donate address of coinb.in creator. Set the Amount so the fee is significant for miner for a quick confirmation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z4NwaQD-OaiXMPbS.png" /><figcaption>Constructing RBF transaction</figcaption></figure><p>Note the <em>Inputs </em>tab — if the source wallet was used multiple times and has lots of transactions, we would have to manually specify only inputs we used in transaction we are going to replace (basically remove all other inputs and leave only the ones we need).If we have hundreds of inputs that might be quite a tedious work.</p><p>Sign it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2lrGSZGY-fUbCqcm.png" /><figcaption>Sign transaction</figcaption></figure><p>Broadcast:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ioWAhxCIxGqu8Lz9.png" /><figcaption>Broadcast transaction</figcaption></figure><p>This is how it looks now on blockchain.info. New transaction has all chances to be included in block before the ancestor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZpI0uoq_WolLJDrx.png" /><figcaption>Unconfirmed transactions! Smells like doublespend</figcaption></figure><p>Wait. Got a confirmation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MaCG-qJS9u3Qf-iO.png" /><figcaption>Confirmed RBF transaction</figcaption></figure><p>We have just replaced transaction using RBF, notoriously, we sent the coins to a different from original destination address.</p><h3>A few words about security and doublespends</h3><p>Not always <em>nSequence</em>=<em>MAX</em> guarantees that transaction is final and can’t be replaced. You could try NOT ticking <strong>“Make this a RBF transaction”</strong>, but:</p><ul><li>Not all nodes will agree to relay the new tx version, referring to <em>mempool-conflict</em></li><li>Some nodes <em>will</em> accept this transaction</li><li>Websites like <em>blockchain.info </em>will basically scream that this is a <em>DOUBLE SPEND</em></li><li>Not all pools will mine this new transaction, as it is a doublespend. Some pools <em>will</em> mine it, but it might take more time (comparing to when <em>all </em>pools mine your transaction)</li><li>If new transaction is finally included in block — this is absolutely legit and does not contradict to consensus rules. If someone got scammed this way — there’s no place he can complain about it.</li></ul><p>Thus, we come to a conclusion that <em>any</em> transaction without at least two confirmations is unreliable. Why two, not one? Short answer: orphaned blocks.</p><h4><strong>References:</strong></h4><ul><li><a href="https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki">github.com/bitcoin/bips/blob/master/bip-0125.mediawiki</a> — BIP-0125</li><li><a href="https://github.com/OutCast3k/coinbin/">github.com/OutCast3k/coinbin</a> — Sources <a href="https://coinb.in/">coinb.in</a></li><li><a href="https://en.bitcoin.it/wiki/Transaction_broadcasting">en.bitcoin.it/wiki/Transaction_broadcasting</a> — list of endpoints, some <em>might</em> accept doublespend transactions.</li></ul><h3>Bonus!</h3><p><strong>Real life story</strong>. Once upon a time a website using our bitcoin payment gateway got hacked, and hacker requested a 2 BTC payout from gateway. Gateway at that time had hardcoded low fee (0.0001), so hacker’s transaction got stuck unconfirmed. It gave us enough time to study the situation, and replace the transaction with different (our’s) destination address. We increased the fee to 0.1 to speed up. Hacker got nothing. <strong>Lesson — use RBF to do good!</strong></p><p><strong>Real life story 2. </strong>I was refilling <a href="https://bitmedia.io/">bitmedia.io</a> acount with bitcoin. Account refill there works with depositing to same deposit address, and total amount of user’s balance gets summed up of all incoming to that address transactions. Only 6 confirmation transactions are counted. I wanted to top up faster, so I used RBF several times. When the transaction got finally confirmed, the final credited balance was multiplied by the times I used RBF! I instantly submitted a support ticket, and as a bug bounty I got to keep extra 0.3 BTC. <strong>Lesson — check how your systems behave with RBF!</strong> <em>I wonder how many systems in the wild are vulnerable to this…</em></p><p><em>Originally published at </em><a href="https://habrahabr.ru/post/327218/"><em>habrahabr.ru</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e10032f9a93f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>