<?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 Luke Dashjr on Medium]]></title>
        <description><![CDATA[Stories by Luke Dashjr on Medium]]></description>
        <link>https://medium.com/@lukedashjr?source=rss-b30f61693938------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_BvgnaAjptM6nOVIe-c9hQ.jpeg</url>
            <title>Stories by Luke Dashjr on Medium</title>
            <link>https://medium.com/@lukedashjr?source=rss-b30f61693938------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 17 May 2026 01:01:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lukedashjr/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[How to securely install Bitcoin]]></title>
            <link>https://medium.com/@lukedashjr/how-to-securely-install-bitcoin-9bfeca7d3b2a?source=rss-b30f61693938------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bfeca7d3b2a</guid>
            <category><![CDATA[gnupg]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[gpg]]></category>
            <category><![CDATA[pgp]]></category>
            <dc:creator><![CDATA[Luke Dashjr]]></dc:creator>
            <pubDate>Sat, 07 Mar 2020 17:15:41 GMT</pubDate>
            <atom:updated>2025-09-02T06:05:17.997Z</atom:updated>
            <content:encoded><![CDATA[<h3>NOTE: This guide is not up-to-date, and the example key for Luke Dashjr has since been compromised. An updated version is planned, but not yet written.</h3><h3>Expectations</h3><p>These instructions require that you understand how files are stored in your computer (abstractly; if you know what a directory/folder is, you’re probably okay) and how to use the command line to run programs and access files. If you don’t understand these concepts, first start with a guide explaining them to you.</p><p>Be mindful that the instructions here can only help you install Bitcoin securely. It does not attempt to help you secure your hardware, your operating system, or avoid malware introduced by other applications you install. Generally, if anything else in your computer is compromised, your node will also be at risk, no matter how secure you verify its own install.</p><p>If you want an absolutely secure node, in addition to the instructions herein, you will need to (at least) avoid backdoored hardware (including Raspberry Pi, and anything produced by Intel or AMD), run a trustworthy Linux-based operating system, <em>only</em> install or use software either provided by your OS vendor, or otherwise verified using GnuPG (such as described in this article), and ensure it’s kept up to date with the latest vulnerability patches.</p><p>Even if you can’t get maximum security by addressing these other concerns, that doesn’t mean you should give up, however: it is still a good idea to verify your Bitcoin node software anyway.</p><h3>Overview</h3><p>There are three important steps to ensuring your install of Bitcoin is secure and free of malware:</p><ul><li>Verifying the OpenPGP key(s)</li><li>Verifying the signature(s)</li><li>Verifying the file itself</li></ul><p>Each step depends on the previous steps being successful, and while it is possible to skip a step, it is important to understand that your install is not verified unless <em>all</em> the steps are successful.</p><p>Note that for examples, I will be verifying my own signature on Bitcoin Knots v0.19.0.1.knots20200104 for ppc64le Linux. To verify someone else’s signature and/or another file, you will need to change the command line to use that fingerprint and/or filename.</p><h3>Step 0: Installing GNU Privacy Guard (GPG)</h3><p>Before you can begin, you will need to ensure you have the GNU Privacy Guard (GPG) tools installed. This is what does all the cryptographic verification needed to ensure your files are safe.</p><p>If you run a Linux-based system, you can usually install it from your OS vendor. These days, it’s usually already installed “out of the box” — you can check by running gpg --version. If not, try installing it with one of these commands (if they fail, move on to the next):</p><pre>apt-get install gnupg<br>dnf install gnupg2<br>yum install gnupg2<br>emerge app-crypt/gnupg<br>pacman -S gnupg <br>apk add gnupg</pre><p>If you have the misfortune of using Windows or macOS, you can <a href="https://gnupg.org/download/#binary">download GnuPG from their website</a>, but I’m not aware of any secure way to verify that download. They do, of course, provide signatures, but you have a chicken-and-egg problem: until you install a good copy, you have no way to verify those signatures!</p><h3>Step 1: Verifying the OpenPGP key(s)</h3><p>This is arguably the most difficult step of the process: you need to confirm that the key(s) you are using actually are the correct keys used by the people you trust to produce malware-free software. If you’re not careful, you could end up with a fake key for “Luke Dashjr” — which would result in checking that the fake person signed the program, not the real one!</p><p>Each OpenPGP key has a “fingerprint”, which is 40 hexadecimal characters (numbers 0–9 and A-F), sometimes shown with spaces to make them easier to read. If you ensure the fingerprint of the key you are using matches the fingerprint of the trusted signer, you know you have the right key.</p><h4>Obtaining keys and/or fingerprints</h4><p>The most secure way to verify the keys, is to meet us in person and confirm the key “fingerprint”. Almost nobody memorises their key fingerprint, so it’s normal that we might have to look it up on our own laptop or phone.</p><p>Once in a while — usually at conferences or meetups — there may be “key signing parties” where a group of people meets to confirm the fingerprints of everyone else, by each participant either reading their own fingerprint aloud in person, or otherwise manually confirming that what everyone sees/hears is correct. If you get the opportunity to go to one, this is a good way to verify many keys at once.</p><p>If you’re not interested in or don’t have the chance to meet up in person, you should ideally verify a key from multiple sources.</p><p>Sometimes, conferences post video of presentations, where a key fingerprint might be shown in a slide. While “deep fake” technology is fairly new, do note that slides in video are much easier to manipulate.</p><p>Developers will usually post their keys or fingerprints on their website, and perhaps a few others (mine is on <a href="http://luke.dashjr.org/myself/luke-jr.asc">my personal website</a>, <a href="http://bitcoinknots.org/luke-jr.asc">bitcoinknots.org</a>, <a href="https://bitcoin.org/luke-jr.asc">bitcoin.org</a>, and <a href="https://github.com/bitcoin/bitcoin/blob/master/contrib/gitian-keys/keys.txt">GitHub</a>).</p><p>If you already have an installed copy of the software you trust, sometimes it will include the keys needed to verify updates (Bitcoin Core only includes it with source code at this time).</p><h4>Checking the fingerprint of a key file</h4><p>To look at the fingerprint of a key file, you can use this command:</p><pre>gpg --import-options show-only --import --with-fingerprint luke-jr.asc</pre><p>This will print a lot of information about the key file, but the relevant information is at the very top:</p><pre>pub   rsa8192 2012-03-23 [SC] [expires: 2020-06-09] <br>      E463 A93F 5F31 17EE DE6C  7316 BD02 9424 21F4 889F</pre><p>In this case, E463 A93F 5F31 17EE DE6C 7316 BD02 9424 21F4 889F is the fingerprint for my key.</p><p>NOTE: If GPG says the key is expired, that is probably okay! In Step 2, you will update it to the newest version of the same key, which usually extends the expiration date.</p><h4>Importing the verified key</h4><p>Regardless of how you verify the key, you should make sure to remember which key you used, so you can verify the same key is used when you update in the future. Even if you skip verifying the key (<em>not</em> safe), at least this will ensure your updates are signed by the same person as the version you are installing today.</p><p>When you’re comfortable that the key you have is correct, import it like this (replace luke-jr.asc with the filename holding the key you want):</p><pre>gpg --import &lt; luke-jr.asc</pre><p>Or if you only have the fingerprint, like this (put the key fingerprint you want to use!):</p><pre>gpg --keyserver hkp://keyserver.ubuntu.com --recv-key E463A93F5F3117EEDE6C7316BD02942421F4889F</pre><h3>Step 2: Verifying the signature(s)</h3><p>Now that you know what key you wish to verify with, the next step is to check the signature is valid.</p><p>Before you can proceed with this step, you must be sure your copy of the signer’s key is up to date. If you fail to do so, you may get a message about the key being expired. Run (again, use the actual fingerprint you want):</p><pre>gpg --keyserver hkp://keyserver.ubuntu.com --refresh-key E463A93F5F3117EEDE6C7316BD02942421F4889F</pre><p>Next, you will need two files (in addition to the program file you’re checking): the “.assert” file which contains a list of file fingerprints, and the “.assert.sig” file which contains the signature for that list. This is because instead of signing the program file itself, what we do is fingerprint all the files, and then sign that list. You will need <em>both</em> files.</p><ul><li>Bitcoin Core’s “assert” file pairs are published here: <a href="https://github.com/bitcoin-core/gitian.sigs/find/master">https://github.com/bitcoin-core/gitian.sigs/find/master</a></li><li>Bitcoin Knots’s “assert” file pairs are published here: <a href="https://github.com/bitcoinknots/gitian.sigs/find/knots">https://github.com/bitcoinknots/gitian.sigs/find/knots</a></li></ul><p>Note that there is a separate file pair for each signer. If you are verifying that multiple people have signed your file (which you should), you will need to check each file pair. Also be sure you are getting the files for the version you intend to verify!</p><p>When you find the files you want on the list, open it in your browser by clicking the link, then right-click on the “Raw” or “Download” button and select “Save Link As”.</p><p>Once you have both “assert” files, you can then check the signature by running (adjust the file name to your specific .assert.sig):</p><pre>gpg --verify bitcoin-core-linux-0.19-build.assert.sig</pre><p>If this is successful, it will tell you:</p><pre>gpg: Signature made Sun 19 Jan 2020 03:47:15 AM UTC <br>gpg: using RSA key <strong>E463A93F5F3117EEDE6C7316BD02942421F4889F</strong> <br>gpg: Good signature from “Luke Dashjr &lt;luke@dashjr.org&gt;” [ultimate] </pre><p>Notice the key fingerprint in bold. That <em>must</em> match the key you verified in step 1, or it may have been signed by someone else! The part about “Good signature” is also important, but the name and email address are not — if the fingerprint is wrong, those can both be faked.</p><p>Assuming all went well, you now know the “.assert” file is vouched for by the person who controls the key in question, and can proceed to verify that your actual program file is the one listed in that “.assert” file…</p><h3>Step 3: Verifying the file itself</h3><p>To verify your program file, you must first take a cryptographic hash of it (essentially taking its fingerprints). This is done with a simple command (substitute the actual filename you’re verifying!):</p><pre><strong>Linux:</strong> sha256sum bitcoin-0.19.0.1.knots20200104-powerpc64le-linux-gnu.tar.gz</pre><pre><strong>Windows:</strong> certUtil -hashfile bitcoin-0.19.0.1.knots20200104-win64.zip SHA256</pre><pre><strong>macOS:</strong> shasum -a 256 bitcoin-0.19.0.1.knots20200104-osx-unsigned.dmg</pre><p>This will print something like:</p><pre>d370692590c4546ac0de250da91c6c288d9ee5252f1a4b857a5b80c4e3d81149  bitcoin-0.19.0.1.knots20200104-powerpc64le-linux-gnu.tar.gz</pre><p>This is the fingerprint of the file content, followed by the filename you specified.</p><p>Now open the “.assert” file in any plain text editor/viewer, and look for that fingerprint. It should be in the “out_manifest” section at the top— if you get as far as “in_manifest” or “base_manifests”, you’ve gone too far.</p><p>If you find it in the “.assert” file, then you’ve verified the file you have, is the same one the signer vouches for (you’ll see their filename in the “.assert” file to the right of the fingerprint — it will likely be the same as your filename).</p><p>If it’s missing in the “.assert” file, that can mean either you are using the wrong “.assert” file, or your file does <em>not</em> match (in which case, you will see a different fingerprint next to the expected filename). If the file is listed, but has a different fingerprint, please <em>do not open your file</em>, but instead save it (we may ask you for a copy later) and contact the security team of the affected project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bfeca7d3b2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Malware on x9.dnsseed.bitcoin.dashjr.org? YES — but it’s not a problem.]]></title>
            <link>https://medium.com/@lukedashjr/malware-on-bitcoin-dns-seeds-not-a-problem-6f8dc3c0368b?source=rss-b30f61693938------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f8dc3c0368b</guid>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[malware]]></category>
            <dc:creator><![CDATA[Luke Dashjr]]></dc:creator>
            <pubDate>Thu, 20 Feb 2020 17:39:19 GMT</pubDate>
            <atom:updated>2020-02-20T17:39:19.259Z</atom:updated>
            <content:encoded><![CDATA[<h3>Malware on x9.dnsseed.bitcoin.dashjr.org? YES — but it’s not a problem.</h3><p>Lately some users have reported their antivirus software telling them that my personal domain and other domains* hosting the Bitcoin DNS seeds “contain malware”, are “suspected of a trojan”, and such.</p><p><strong>This is <em>probably true</em>.</strong> These domains are specially designed so that they resolve not to a website, but to a random list of real peers on the Bitcoin P2P network. So it’s entirely possible — indeed, even probable — that some of these peers are running webservers hosting malware.</p><p>But your Bitcoin node should never access them as a website, only as an <em>untrusted</em> peer. And you shouldn’t be typing these domains into your web browser either — they’re not intended for that usage. Whatever you do, <strong>don’t download anything from them!</strong></p><p>If your malware software is blocking your node from accessing them, <strong>should you whitelist/allow it? Nah</strong>, probably not. Your node should only even attempt to resolve these domains if it fails to find any other peers. If it’s working, you don’t need to use the DNS seeds, and might as well let your system block it. (On the other hand, <strong>if you’re having trouble with your node not getting online, feel free to allow access to the DNS seeds.</strong> Its usage is safe.)</p><p>* Affected domains include not only x9.dnsseed.bitcoin.dashjr.org, but also x9.seed.bitcoin.sipa.be, x9.dnsseed.bluematt.me, x9.seed.bitcoinstats.com, x9.seed.bitcoin.jonasschnelli.ch, x9.seed.btc.petertodd.org, x9.seed.bitcoin.sprovoost.nl, x9.dnsseed.emzy.de, and possibly others.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f8dc3c0368b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CVE-2018–20586 disclosure]]></title>
            <link>https://medium.com/@lukedashjr/cve-2018-20586-disclosure-ff3e1ab9a21f?source=rss-b30f61693938------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff3e1ab9a21f</guid>
            <dc:creator><![CDATA[Luke Dashjr]]></dc:creator>
            <pubDate>Fri, 22 Nov 2019 17:13:45 GMT</pubDate>
            <atom:updated>2019-11-22T17:58:51.892Z</atom:updated>
            <content:encoded><![CDATA[<p>CVE-2018–20586 is a log injection vulnerability which allows any software with access to the RPC port to create fake or confusing entries in the debug log. Valid authentication (username/password/cookie) for the RPC service is NOT required to exploit this vulnerability, only the ability to connect to the RPC port (which is by default only exposed to the local machine).</p><p>The vulnerability was introduced in <a href="https://github.com/bitcoin/bitcoin/commit/40b556d3742a1f65d67e2d4c760d0b13fe8be5b7">40b556d3742a1f65d67e2d4c760d0b13fe8be5b7 (“libevent-based http server”)</a> and first released in Bitcoin Core v0.12.0rc1 in 2016 Jan 13. A fix was hidden in <a href="https://github.com/bitcoin/bitcoin/commit/79358817e53ac0a7afa64c747115d492a74e3155">79358817e53ac0a7afa64c747115d492a74e3155 (“rpc: Make HTTP RPC debug logging more informative”)</a> released in v0.17.1, 2018 Dec 22.</p><p>Note that as of today, this fix has NOT been backported to older versions. When/if v0.16.4 is released, it may also include a fix, but due to the minor severity of this vulnerability, it does not merit a dedicated release on its own. (The 0.16 git branch is also NOT fixed at this time.)</p><p>To be vulnerable, the malicious software must either be running on the same machine as the node, have the ability to proxy connections to the node via the local machine, or the node must be configured to accept RPC connections from a network via which the attacker can connect. Additionally, a human user must read the debug log and act on or otherwise believe the injected data, in a way that is somehow harmful.</p><p>Because the node would log the arbitrary POST request from any connection, an attacker can add nearly any content to the request to inject it into the log. To ensure their entire request is injected, standard spaces would need to be replaced with alternative whitespace characters, and newlines would need to become other control characters (such as “\r\v”). Because the injected data must use such non-standard characters, it is most likely to not fool other software parsing the debug log, and only a human visually reading it.</p><p>To fix this vulnerability, POST requests are now sanitised before being logged, removing all characters that shouldn’t be in an ordinary POST request.</p><p>Credit goes to <a href="https://twitter.com/practicalswift">practicalswift (https://twitter.com/practicalswift)</a> for discovering and fixing the vulnerability.</p><p>Timeline:<br>- 2015–01–18: Vulnerability introduced in <a href="https://github.com/bitcoin/bitcoin/pull/5677">PR #5677</a>.<br>- 2015–09–04: Vulnerability merged to master git repository.<br>- 2016–01–13: Vulnerability published in v0.12.0rc1.<br>- 2016–02–18: Vulnerability released in v0.12.0.<br>…<br>- 2018–10–25: practicalswift discloses vulnerability to security team.<br>- 2018–10–31: practicalswift opens <a href="https://github.com/bitcoin/bitcoin/pull/14618">PR #14618</a> to quietly fix vulnerability.<br>- 2018–11–05: Fix merged to master git repository.<br>- 2018–11–30: Fix merged to 0.17 git repository.<br>- 2018–12–07: Fix published in v0.17.1rc1.<br>- 2018–12–22: Fix released in v0.17.1.<br>…<br>- 2019–06–22: Vulnerability existence disclosed to bitcoin-dev ML.<br>- 2019–11–22: Vulnerability details disclosure to bitcoin-dev ML.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff3e1ab9a21f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CVE-2017–18350 disclosure]]></title>
            <link>https://medium.com/@lukedashjr/cve-2017-18350-disclosure-fe6d695f45d5?source=rss-b30f61693938------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe6d695f45d5</guid>
            <dc:creator><![CDATA[Luke Dashjr]]></dc:creator>
            <pubDate>Fri, 08 Nov 2019 15:27:52 GMT</pubDate>
            <atom:updated>2019-11-08T15:27:52.662Z</atom:updated>
            <content:encoded><![CDATA[<p>CVE-2017–18350 is a buffer overflow vulnerability which allows a malicious SOCKS proxy server to overwrite the program stack on systems with a signed `char` type (including common 32-bit and 64-bit x86 PCs).</p><p>The vulnerability was introduced in <a href="https://github.com/bitcoin/bitcoin/commit/60a87bce873ce1f76a80b7b8546e83a0cd4e07a5">60a87bce873ce1f76a80b7b8546e83a0cd4e07a5 (SOCKS5 support)</a> and first released in Bitcoin Core v0.7.0rc1 in 2012 Aug 27. A fix was hidden in <a href="https://github.com/bitcoin/bitcoin/commit/d90a00eabed0f3f1acea4834ad489484d0012372">d90a00eabed0f3f1acea4834ad489484d0012372 (“Improve and document SOCKS code”)</a> released in v0.15.1, 2017 Nov 6.</p><p>To be vulnerable, the node must be configured to use such a malicious proxy in the first place. Note that using <em>any</em> proxy over an insecure network (such as the Internet) is potentially a vulnerability since the connection could be intercepted for such a purpose.</p><p>Upon a connection request from the node, the malicious proxy would respond with an acknowledgement of a different target domain name than the one requested. Normally this acknowledgement is entirely ignored, but if the length uses the high bit (ie, a length 128–255 inclusive), it will be interpreted by vulnerable versions as a negative number instead. When the negative number is passed to the recv() system call to read the domain name, it is converted back to an unsigned/positive number, but at a much wider size (typically 32-bit), resulting in an effectively infinite read into and beyond the 256-byte dummy stack buffer.</p><p>To fix this vulnerability, the dummy buffer was changed to an explicitly unsigned data type, avoiding the conversion to/from a negative number.</p><p>Credit goes to <a href="https://twitter.com/practicalswift">practicalswift (https://twitter.com/practicalswift)</a> for discovering and providing the initial fix for the vulnerability, and Wladimir J. van der Laan for a disguised version of the fix as well as general cleanup to the at-risk code.</p><h4>Timeline</h4><p>- 2012–04–01: Vulnerability introduced in <a href="https://github.com/bitcoin/bitcoin/pull/1141">PR #1141</a>.<br>- 2012–05–08: Vulnerability merged to master git repository.<br>- 2012–08–27: Vulnerability published in v0.7.0rc1.<br>- 2012–09–17: Vulnerability released in v0.7.0.<br>…<br>- 2017–09–21: practicalswift discloses vulnerability to security team.<br>- 2017–09–23: Wladimir opens <a href="https://github.com/bitcoin/bitcoin/pull/11397">PR #11397</a> to quietly fix vulnerability.<br>- 2017–09–27: Fix merged to master git repository.<br>- 2017–10–18: Fix merged to 0.15 git repository.<br>- 2017–11–04: Fix published in v0.15.1rc1.<br>- 2017–11–09: Fix released in v0.15.1.<br>…<br>- 2019–06–22: Vulnerability existence disclosed to bitcoin-dev ML.<br>- 2019–11–08: Vulnerability details disclosure to bitcoin-dev ML.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe6d695f45d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CVE-2018–20587 Advisory and Full Disclosure (Bitcoin Core & Knots, on multiuser systems)]]></title>
            <link>https://medium.com/@lukedashjr/cve-2018-20587-advisory-and-full-disclosure-a3105551e78b?source=rss-b30f61693938------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3105551e78b</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[bitcoin-core]]></category>
            <dc:creator><![CDATA[Luke Dashjr]]></dc:creator>
            <pubDate>Fri, 08 Feb 2019 12:41:17 GMT</pubDate>
            <atom:updated>2019-02-08T12:41:17.022Z</atom:updated>
            <content:encoded><![CDATA[<p>CVE-2018–20587 is an <em>Incorrect Access Control</em> vulnerability that affects all currently released versions of Bitcoin Core, including the latest 0.17.1 (and probably future releases too), as well as Bitcoin Knots prior to 0.17.1.knots20181229.</p><p>You may be affected by this issue if you have the RPC service enabled (default, with the headless bitcoind), and other users have access to run their own services on the same computer (either local or remote access). <strong>If you are the only user of the computer running your node, you are not affected.</strong> If you use the GUI but have not enabled the RPC service, you are not affected.</p><p>Generally, it is not recommended to trust a computer that other users have access to, so this vulnerability is considered low risk, and may not be fixed in Bitcoin Core at all.</p><p><strong>Note that in all cases with multiple users, attempting to use the RPC service while your node is not running may create a security risk.</strong> While your node is not running, it can do nothing to prevent this. Always ensure your node is running before you attempt to access the RPC service! Note that making another RPC call is not sufficient to safely check that it is running. (This risk is not covered by the CVE, and indeed affects all software with RPC services, not just Bitcoin nodes.)</p><p>(Also, as a reminder, please note that the RPC service should never be exposed to any untrusted network or host. Do not set “rpcbind” or “rpcallowip” to anything other than “127.0.0.1” unless you are familiar with network security and aware of the potential consequences.)</p><h3>Workarounds</h3><p>There are multiple ways to eliminate the risk:</p><ul><li>Forbid usage of your computer by other people. This includes remote access. Securing access to login to the computer is outside the scope of this advisory.</li><li>Forbid other users of your computer from binding to the RPC port on any network interface. (How to do this is non-trivial and outside the scope of this document.)</li><li>Turn off the RPC service, and never attempt to use it. To do this, ensure that your bitcoin.conf file includes the line “server=0”. You can confirm it has been disabled, if the bitcoin-cli program fails to execute any command, saying “Could not connect to the server”.</li><li>Before accessing the RPC service, check that your node’s debug.log does not contain any “Binding RPC on address … failed” lines.</li><li>Configure your node to only bind a single RPC port. To do this, make sure your bitcoin.conf contains exactly one line beginning with “rpcbind=” and at least one line beginning with “rpcallowip=”. Generally, you want to ensure these are “rpcbind=127.0.0.1” and “rpcallowip=127.0.0.1” (any other values may fail to eliminate the danger). With this configuration, the software will refuse to start unless it successfully binds the appropriate port.</li></ul><p>You can also upgrade to <a href="http://bitcoinknots.org/?CVE-2018-20587">Bitcoin Knots 0.17.1.knots20181229 or newer</a>, which has an experimental fix for this issue (but only while it is running, obviously). Since this fix has not been extensively tested, you should still mitigate the vulnerability with one of the above methods, or attempt to compromise your own node as described below (if you do test the exploit, please report whether Knots’ fix does or does not work on your system to <a href="mailto:luke_bcknots_securitybreach@dashjr.org">luke_bcknots_cve2018_20587@dashjr.org</a>).</p><h3>Technical Details</h3><p>By default, the RPC service attempts to bind and listen for connections on both IPv4 localhost and IPv6 localhost. So long as either of these succeeds, startup is considered successful, even if the other fails.</p><p>However, this means it is possible for another user on the system to quietly bind the IPv4 localhost port, and forward requests to the IPv6 localhost port, intercepting the request, response, and authentication credentials (including both the RPC server authentication, as well as any wallet password(s) if such wallets are unlocked in this way).</p><p>The other user can then use the credentials to make his own requests, including RPC calls that may compromise consensus, send the wallet’s bitcoins elsewhere, and so on.</p><h3>Timeline</h3><ul><li><em>2018–12–10</em> Bui Thanh, on behalf of a team of security researchers from Aalto University and University of Helsinki, reports the issue to a number of Bitcoin Core developers.</li><li><em>2018–12–13</em> Upon further inquiry from Bui Thanh, Matt Corallo confirms receipt of original report, and reaffirms that users have always been advised not to expose the RPC service to untrusted networks/hosts.</li><li><em>2018–12–14</em> Bui Thanh recommends that Bitcoin Core should not silently ignore failures to bind RPC listening ports.</li><li><em>2018–12–15</em> Wladimir J. van der Laan submits <a href="https://github.com/bitcoin/bitcoin/pull/14968">pull request #14968</a> to fix the issue.</li><li><em>2018–12–28</em> Due to the fix proposed in #14968 breaking the RPC service working on IPv4-only systems, and no straightforward way to resolve both issues, the fix is deferred.</li><li><em>2018–12–30</em> A complex and experimental solution to fix both issues is released in Bitcoin Knots 0.17.1.knots20181229.</li><li><em>2018–12–30</em> The vulnerability is officially assigned CVE-2018–20587.</li><li><em>2019–01–15</em> Proposal to disclose vulnerability and mitigations shared with other involved parties.</li><li><em>2019–01–21</em> David Harding submits <a href="https://github.com/bitcoin/bitcoin/pull/15223">pull request #15223</a> to document the issue, along with other RPC service risks in general.</li><li><em>2019–01–21</em> PR #15223 documenting the issue is merged into Bitcoin Core.</li><li><em>2019–02–07</em> At the weekly Bitcoin Core meeting, <a href="http://www.erisian.com.au/meetbot/bitcoin-core-dev/2019/bitcoin-core-dev.2019-02-07-19.01.log.html#l-52">the issue is discussed</a> and ultimately it is decided that a dedicated advisory will not be published to bitcoincore.org.</li><li><em>2019–02–08</em> Advisory and full disclosure is posted to Luke Dashjr’s personal blog.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3105551e78b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why nothing will happen [with Bitcoin] on August 1st]]></title>
            <link>https://medium.com/@lukedashjr/why-nothing-will-happen-with-bitcoin-on-august-1st-93f49a1a930d?source=rss-b30f61693938------2</link>
            <guid isPermaLink="false">https://medium.com/p/93f49a1a930d</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[segwit]]></category>
            <category><![CDATA[uasf]]></category>
            <dc:creator><![CDATA[Luke Dashjr]]></dc:creator>
            <pubDate>Thu, 27 Jul 2017 07:19:34 GMT</pubDate>
            <atom:updated>2017-07-27T07:37:44.874Z</atom:updated>
            <content:encoded><![CDATA[<h3>What was going to happen (BIP148)</h3><p>A number of months ago, the community decided to coordinate the activation of Segwit on August 1st, rather than continue delegation of this coordination to the miners, who had collectively been stalling the upgrade. This proposal was numbered BIP148, and widely supported by Bitcoin users. There was fear that 51% of miners might retaliate by splitting the blockchain, using invalid blocks light clients could not detect in order to solidify the split in perpetuity.</p><h3>Why BIP148 is no longer relevant</h3><p>Last week, miners finally decided to stop stalling Segwit, and have begun the activation process on their own, prior to BIP148’s August 1st flag day, and in a manner that is essentially embracing BIP148 themselves using a miner-activated method early. Therefore, BIP148’s new rule is redundant, since miners are already enforcing it as of Sunday. Users should still run BIP148 code to ensure they retain full node security, but the probability miners will attempt to split the chain in retaliation at this point is pretty much zero. <strong>Basically, BIP148 was an early success.</strong></p><h3>New altcoin launching August 1st, “Bitcoin Cash”</h3><p>In the meantime, a new altcoin calling itself “Bitcoin Cash” has been formed, aiming to take advantage of the previous talk of an August 1st fork, to try to hijack Bitcoin users for their altcoin. By using the name “Bitcoin”, they may fraudulently fool people into switching to their new altcoin.</p><p><strong>But at the end of the day, “Bitcoin Cash” (or, perhaps </strong><a href="https://blog.bitmain.com/en/uahf-contingency-plan-uasf-bip148/"><strong>more accurately</strong></a><strong> called, “Bitmain-coin”) is just yet another altcoin. It has no effect on the real Bitcoin network, and users who stick to Bitcoin Core and compatible full node software will be entirely unaffected.</strong></p><p>Note also that this isn’t a particularly unique or even first-of-kind altcoin: “Bitcoin Dark” and “Bitcoin Plus” have tried to hijack the “Bitcoin” name previously. Bitmain-coin also gives a premine to all Bitcoin holders as of their launch date, but this too has been done before, by an altcoin called CLAMs and <a href="https://bitcointalk.org/index.php?topic=1883902.0">another more recent altcoin calling itself “Bitcore”</a>.</p><p>However, <strong>there <em>is</em> a “gotcha”</strong>: At least the current Bitmain-coin code will use the original Bitcoin directories by default. This means if you wish to install or use Bitmain-coin yourself, it will mess up your Bitcoin installation! Using both together is outside the scope of this blog post, however, and I personally will only be supporting real Bitcoin.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93f49a1a930d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How you can help ensure BIP148 is a success]]></title>
            <link>https://medium.com/@lukedashjr/how-you-can-help-ensure-bip148-is-a-success-2fb63bf5114f?source=rss-b30f61693938------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fb63bf5114f</guid>
            <category><![CDATA[bip-148]]></category>
            <category><![CDATA[segwit]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Luke Dashjr]]></dc:creator>
            <pubDate>Tue, 04 Jul 2017 19:04:11 GMT</pubDate>
            <atom:updated>2017-07-04T19:04:32.519Z</atom:updated>
            <content:encoded><![CDATA[<p>Over the last several weeks, I’ve seen a lot of people promoting BIP148/UASF on social media. Just the other day, someone announced they’d purchased numerous Raspberry Pis to run BIP148 full nodes. However, do these things really help BIP148? Not really.</p><p>At this point, probably almost everyone reading r/Bitcoin or using Twitter regularly knows about BIP148. Most of them have probably upgraded or even started their first node to support it. But what about people who <em>don’t</em> use these social media? Many people work hard all day at Bitcoin-unrelated jobs, and don’t want to spend the rest of their days thinking about their bitcoins. So the number one first thing everyone can do to help BIP148 is to <strong>talk to bitcoiners you know in the real world, and make sure they’re aware of and prepared for BIP148</strong>. Also consider spreading BIP148 awareness on any less popular social media you might use, such as Facebook or online poker sites.</p><p>Many people are already running a BIP148 node. But does this help? Not simply by running a node! A common misconception is that nodes are voting for BIP148, but this is not correct. Anyone can run any number of nodes, so this wouldn’t even be a good idea if it were possible. Rather, what matters is not that you’re running a node, but that you’re <strong><em>using</em> it to receive transactions</strong>. This is what it means when people talk about <em>economic</em> nodes: nodes that people use for economic activity. So, if you use the wallet built-in to your Bitcoin Core+BIP148 node to receive your bitcoins, you’re doing your part to enforce BIP148. But <strong>if you use another wallet, you need to make sure you’ve configured it to actually use your own node.</strong> (How? It varies from wallet to wallet; if you can’t find instructions online, contact your wallet’s development team and ask!) If you use a wallet that can’t be configured to use your own node (including webwallets), be sure they’re either publicly committed to support BIP148, or withdraw your bitcoins before August.</p><p>This also means if you run more than one node, the others are not doing anything particularly useful. If you actually bought a bunch of Raspberry Pis to run nodes, not all is lost, however. You can sell or donate these to other bitcoiners who don’t have nodes yet, and help them setup and use their own BIP148 node. Even if you don’t have hardware to get rid of, you can still offer to <strong>help others who don’t have a node set one up!</strong></p><p>Also of important note: make sure you’re actually running BIP148 for real. Early BIP148 proponents recommended simply setting a “uacomment” in your bitcoin.conf configuration file. This is <em>not</em> sufficient to support BIP148, and in fact leaves you just as vulnerable to attack as any other non-BIP148 node! <strong>To actually support BIP148 with your node, you must upgrade to a BIP148 build of Bitcoin Core.</strong> The best website to download this from is <a href="https://bitcoinuasf.org/">https://bitcoinuasf.org/</a> and you can install it just like any other update to Bitcoin Core (it will use your existing blockchain and wallet). You can verify your upgrade was successful by opening the “Help” menu, selecting “Debug window”, and checking that the “User Agent” line says <em>exactly</em> “/Satoshi:0.14.2/<strong>UASF-Segwit:0.3</strong>(BIP148)/”. If you use Bitcoin Knots rather than Core, it should say instead <em>exactly</em> “/Satoshi:0.14.2(<strong>+</strong>BIP148)/Knots:20170618/” (make sure it’s “<strong>+</strong>BIP148” and not “<strong>!</strong>BIP148” which means the opposite).</p><p>A lot of economic activity happens using exchanges. A good part of Bitcoin’s economy is offering services or goods for bitcoins, but at least as much of it is also buying and selling bitcoins for other currencies. Chances are, you’ve bought or sold bitcoins too. <strong>Contact your exchange(s) and ask them to upgrade to BIP148.</strong> If you want to strengthen your request, you can inform them that you will take your business elsewhere if they don’t. Keep asking them until they make a public statement of support. And most importantly, plan to switch to an exchange that supports BIP148 to buy any bitcoins after July — and be sure you don’t leave bitcoins on exchanges that might fail to upgrade in time.</p><p>The same also goes for merchants that accept bitcoins as payment. Make sure the people you do business with know about BIP148, and ideally publicly support it. <strong>You can also offer to patronise merchants [more] if they support BIP148.</strong> Keep in mind that many businesses don’t really accept bitcoins directly, but rather simply get fiat currency using a payment processor that accepts bitcoins. In those cases, <strong>you may need to focus on the payment processor rather than the business directly.</strong></p><p>A final note: if we get to August and many miners are violating the new rule, there will likely be a campaign to try to get people to give up on BIP148 and downgrade to a miner-controlled network. <strong>Don’t give up.</strong> Even if there aren’t <em>any</em> miners, we can still move forward safely, but it may require upgrading nodes again (possibly with a change to the proof-of-work algorithm if necessary — don’t believe the FUD making this sound worse than it really is). As usual, be sure to check that trustworthy developers and/or community members have signed off on the update first. I will make a point to post on this Medium blog with advice in such circumstances. You can also follow me on Twitter <a href="https://twitter.com/LukeDashjr">https://twitter.com/LukeDashjr</a> for updates more often (although I post about other things on Twitter too). <strong>Be sure anyone you’ve informed/helped with BIP148 is aware of this too!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fb63bf5114f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Segwit”2x” beta, review and thoughts]]></title>
            <link>https://medium.com/@lukedashjr/the-segwit-2x-beta-review-and-thoughts-ca480694a8c7?source=rss-b30f61693938------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca480694a8c7</guid>
            <category><![CDATA[segwit2x]]></category>
            <category><![CDATA[segwit]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Luke Dashjr]]></dc:creator>
            <pubDate>Sat, 01 Jul 2017 01:33:41 GMT</pubDate>
            <atom:updated>2017-07-01T04:51:08.332Z</atom:updated>
            <content:encoded><![CDATA[<p>The changes in Segwit2x’s beta can be divided into 5 categories.</p><p>I’ll start with the simplest part: <strong>branding</strong>. “Bitcoin Core 0.14.1” has become “btc1 Core 1.14.3”. Not much to say about this (although it’s interesting to note it’s based on the old 0.14.1 rather than 0.14.2 — which fixed a number of bugs including a miniupnpc vulnerability).</p><p>Next up is “<strong>testnet5</strong>&quot;. It’s a new testnet, for reasons never made clear to me. It would seem if you wanted to test a change to Bitcoin, you’d test it as a change to testnet rather than make a new one. It’s not clear to me why a new testnet was created instead.</p><p>There are a few <strong>policy changes that take effect immediately</strong> upon switching to btc1, even before any softfork or hardfork activates. Most notably, transactions are now allowed to use up to 32k sigops, rather than the 16k limit in Core.</p><p>Additionally, pools/miners connected to a btc1 node that claim to support Segwit2x will be told the size limit is 8 MB, and the sigop limit 160k. This last part is probably a bug (it should wait for the hardfork to activate), but in practice, it doesn’t matter since the actual block template given won’t overflow the limit, and I’m not aware of any miner that will actually add transactions up to the limit.</p><p>btc1 includes the now-well-known <strong>BIP91</strong>, which reduces the Segwit activation threshold to simply 80% for a few days on bit 4. It’s essentially the same as BIP148, but allows miners with 20% hashrate (ie, Bitmain) a veto.</p><p>Finally, we get to the actual <strong>hardfork</strong>. It does not actually use bit 4 at all, but activates 12960 blocks (90 days) after Segwit activates, no matter how Segwit is activated; this means that even if Bitmain blocks Segwit2x, btc1 nodes will <em>still</em> hardfork 90 days after BIP148 activates Segwit. (Clarification: A hardfork wouldn’t happen if Segwit never activated at all, but BIP148 <em>is</em> happening, so Segwit <em>will</em> definitely activate.)</p><p>As for the hardfork itself, it includes an 8 MB max block size limit (with the code obfuscated to make it look like 2 MB), a 160k max block sigop limit (obfuscated to look like 20k), and an 8M max block weight limit (ie, typical block size around 4 MB). To address the sighash scaling issue, a new 1 MB limit is imposed on each transaction’s non-witness data. To avoid being at risk of the original Bitcoin overwriting its chain in a reorganisation, the first block under the hardfork rules is required to have more than 1 MB of non-witness data (a better way to do this would have been to use the hardfork bit, which would prevent reorgs from affecting “SPV” light clients also).</p><p>Now for <strong>my thoughts</strong>: 4–8 MB block sizes are not sane. Even 1 MB blocks are already clearly dangerous to Bitcoin. I cannot foresee myself consenting to the hardfork proposal under almost any circumstances, except perhaps with a softfork to limit the size to something reasonable. Even then, I would still not <em>positively support</em> this proposal: if we are going to hardfork, we should actually make some <em>useful</em> changes in it (for example, native merge-mining, as Satoshi suggested as the first hardfork many years ago), not to mention fix some outstanding bugs (such as the time warp vulnerability). I am certainly not by far the only person with these concerns, so I can say with a relatively high level of confidence that Segwit2x’s hardfork will fail.</p><p>Overall, Segwit2x seems to have one real purpose*: to try to stall Segwit longer. It is a distraction from the upcoming BIP148 softfork, which is already irreversibly deployed to the network. By promoting BIP91 and Segwit2x as an alternative to BIP148, what miners are really doing is another power grab to try to take back their veto, which has no purpose other than to be used by Bitmain to block the whole thing at the last minute. If too little of the economy has upgraded to BIP148 in time for August, it gives Bitmain the opportunity to perform a chain split attack, and fool outdated nodes into following their invalid chain, possibly becoming financially dependent on it before realising the attack has occurred.</p><p>The only solution to this is to spread awareness of BIP148 and ensure as much of the economy as possible has upgraded before August. This is true whether or not you support Segwit2x’s hardfork — in fact, even if you oppose Segwit, you should <em>still</em> help ensure everyone is upgraded to BIP148. BIP148 does not prohibit Segwit2x, nor does it require you or anyone else (not even miners) to even support or use Segwit themselves. The <em>only</em> thing BIP148 requires, is that miners can no longer stop <em>others</em> from adopting Segwit, and with enough support, that miners cannot perform a chain split attack against old nodes without taking a financial loss. If Segwit2x participants are honest, there are no risks to running BIP148; if they are dishonest, then BIP148 is necessary to keep your node secure.</p><p>* Re: Segwit2x’s one real purpose… I don’t mean to imply that all the participants to the NYA have this goal in mind! But rather that the design of Segwit2x is such that it <em>fits</em> this purpose. Bitmain may very well have done this intentionally, but it seems unlikely anyone else intended it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca480694a8c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BIP148 and the risks it entails for you (whether you run a BIP148 node or not)]]></title>
            <link>https://medium.com/@lukedashjr/bip148-and-the-risks-it-entails-for-you-whether-you-run-a-bip148-node-or-not-b7d2dbe85ce6?source=rss-b30f61693938------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7d2dbe85ce6</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[segwit]]></category>
            <dc:creator><![CDATA[Luke Dashjr]]></dc:creator>
            <pubDate>Thu, 18 May 2017 17:59:43 GMT</pubDate>
            <atom:updated>2017-05-20T02:51:15.462Z</atom:updated>
            <content:encoded><![CDATA[<p>BIP148 is happening beginning on August 1st, 2017. But what does that mean for the average user?</p><p><strong>For purposes of reading clarity, “legacy” means nodes not enforcing BIP148.</strong></p><h4>Risks for both legacy and BIP148 nodes (and the wallets trusting them)</h4><p>If and only if BIP148 has minority hashrate support, there will be a chain split. Whether your node supports BIP148 or not, there is a risk that your economic counterparties (ie, people you want to pay and people you want to pay you) will be on the other side of the split. So long as nobody double-spends, this should be mostly okay for 100 blocks (about 16 hours); the only difference will be that transactions might confirm at different times. But if 100 blocks pass and miners begin spending their newly mined bitcoins (different on each side of the split), the chains’ balances will begin to diverge, and transactions will become tied to one side or the other. There will be two “bitcoins”.</p><h4>Risks only for BIP148 nodes</h4><p>Hey, there are none! :)</p><h4>Risks only for legacy nodes</h4><p>If the chain splits, then when / if / every time the BIP148 chain gets longer*, it will <em>replace</em> the legacy chain. Transactions that had confirmed on the legacy chain will become unconfirmed (unless they are also confirmed on the BIP148 chain). Bitcoins mined by legacy miners will cease to exist, as they lose their blocks. (This cannot occur in the inverse direction: no matter how long the legacy chain gets, BIP148 nodes will never let it reorg out the BIP148 chain.)</p><p>If the chain splits, the BIP148 side will have Segwit activating, whereas the legacy side will remain stagnated. There is a possibility this will give a market bias in favour of the BIP148 side, even independently from its initial adoption.</p><p>* Note that even a minority-hashrate chain can get longer than the majority-hashrate chain with some variance, although this becomes less probable with time. (On the other hand, the longer the chain split goes on, the more likely the BIP148 side grows in hashrate relative to the legacy side.)</p><h4>Avoiding a chain split (and all the risks above)</h4><p>A chain split can be avoided entirely if a sufficient amount of the economy adopts BIP148. Miners depend on their minted bitcoins in order to pay electric costs and recoup ASIC R&amp;D costs. If the price they can sell their legacy bitcoins drops too significantly (possibly to zero when/if their blocks get reorg’d out by the BIP148 chain), they will have no choice but to switch to the BIP148 chain themselves, ensuring it is the longest chain for both BIP148 and legacy nodes. If the economy shows strong enough deployment of BIP148 prior to August 1st, it is even possible miners may switch preemptively, avoiding a chain split from occurring altogether. Note that only 51% of miners need to switch to the BIP148 chain to resolve or prevent the chain split, <em>not</em> the original 95% target.</p><p>BIP148 can also be automatically cancelled entirely by locking in Segwit before August 1st.</p><p>So there are a few ways a persistent chain split might be avoided:</p><p>• 95% of hashrate locks-in segwit before August 1st. No chain split at all.<br>• 51% of hashrate deploys BIP148 before August 1st. No chain split at all.<br>• 51% of hashrate deploys BIP148 after August 1st. Chain split gets resolved.<br>• Legacy miners are compelled by the economy to switch to BIP148 after Aug 1st. Chain split gets resolved.</p><p>Basically, everyone’s risks go down with more people running BIP148 nodes. :)</p><p><strong>Note:</strong> This is <strong>more people</strong> running BIP148 nodes, not merely people running more BIP148 nodes. Nodes only have significance when you’re using them to receive, so more than one or two per person is meaningless.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7d2dbe85ce6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>