<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ava Chow</title>
    <description>The website of Ava Chow, a programmer, Bitcoiner, and technology enthusiast.
</description>
    <link>http://achow101.com/</link>
    <atom:link href="http://achow101.com/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Wed, 03 Sep 2025 21:26:57 -0400</pubDate>
    <lastBuildDate>Wed, 03 Sep 2025 21:26:57 -0400</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>Building and Syncing Bitcoin 0.5.0 in 2022</title>
        <description>&lt;h1 id=&quot;building-and-syncing-bitcoin-050-in-2022&quot;&gt;Building and Syncing Bitcoin 0.5.0 in 2022&lt;/h1&gt;

&lt;p&gt;A couple of weeks ago, Jameson Lopp came to me with a question: Could I figure out how to build old versions of Bitcoin and give him instructions for doing so?
This intrigued me, and so I obliged.
Thankfully, the task was not particularly difficult as the Gitian build system was in use, and it seemed to work.
So I built down to 0.3.20, put the instructions into a &lt;a href=&quot;https://github.com/achow101/build-old-bitcoin&quot;&gt;repository on GitHub&lt;/a&gt;, and called it a day.&lt;/p&gt;

&lt;p&gt;A week later, Jameson put out a &lt;a href=&quot;https://blog.lopp.net/running-bitcoin-core-v0-7-and-earlier/&quot;&gt;blog post&lt;/a&gt; detailing his attempts to sync these old versions to the main chain.
But he noted that we was unable to sync and had gotten stuck at various blocks with all 4 major versions he attempted to sync.
This of course, nerd sniped me once again as the failures all looked like the BDB locks problem that had a &lt;a href=&quot;https://bitcoin.org/en/alert/2013-03-15-upgrade-deadline&quot;&gt;workaround&lt;/a&gt; published in 2013.
But Jameson had tried that, and it didn’t work.&lt;/p&gt;

&lt;h2 id=&quot;first-sync-attempt&quot;&gt;First Sync Attempt&lt;/h2&gt;

&lt;p&gt;So of course the first thing that I had to do was to try syncing an old node myself.
I chose to use 0.5.0 as this was the oldest version I could easily build (I didn’t want to deal with the extra steps 0.4 required).
As with Jameson, my attempt at syncing got stuck at block 258,354.
That confirms that this is a persistent issue with 0.5, not a spurious failure.&lt;/p&gt;

&lt;p&gt;The first thought is the BDB locks problem.
But instead of jumping to using that solution, I wanted to dig a bit more to figure out what actually happened.
Conveniently, in additon to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;debug.log&lt;/code&gt; file, we also have &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;db.log&lt;/code&gt; file which outputs messages from BDB itself.
Usually this second log file is empty, but this time it was not:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Lock table is out of available lock entries
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This led me to reading &lt;a href=&quot;https://docs.oracle.com/cd/E17275_01/html/programmer_reference/lock.html&quot;&gt;BDB’s documentation on the locking subsystem&lt;/a&gt;, which led me to the page on &lt;a href=&quot;https://docs.oracle.com/cd/E17275_01/html/programmer_reference/lock_max.html&quot;&gt;configuring sizes&lt;/a&gt; where we see the parameter the workaround mentions: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set_lk_max_locks&lt;/code&gt;.
Seeing that, I figured the correct course of action is to do as the workaround suggests and so I created a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DB_CONFIG&lt;/code&gt; file in the datadir with the line &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set_lk_max_locks 1000000&lt;/code&gt;.
I use 1000000 as I figured that a number larger than the suggestion in the workaround will be needed to sync the rest of the blockchain.&lt;/p&gt;

&lt;h2 id=&quot;second-attempt&quot;&gt;Second Attempt&lt;/h2&gt;

&lt;p&gt;With the parameter set, I restarted bitcoind and found that it still wasn’t syncing!
Looking at the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;debug.log&lt;/code&gt;, I kept seeing a few lines get spammed over and over:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;socket closed
disconnecting node 127.0.0.1:8333
trying connection 127.0.0.1:8333 lastseen=-429948.4hrs lasttry=-457726.1hrs
connected 127.0.0.1:8333
version message: version 70016, blocks=728263
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That’s quite odd.
The node is configured to only connect to a local node on this machine.
It worked fine earlier, so why is getting disconnected now?
I restarted my modern node but turned on network debug logging with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-debug=net&lt;/code&gt;, where I saw the problem:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;2022-03-20T21:50:33Z Header error: Size too large (headers, 5134836 bytes), peer=0
2022-03-20T21:50:33Z disconnecting peer=0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It seems that 0.5.0 pre-dates the implementation of a maximum size, currently 4 MiB, for p2p protocol messages.
This is a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;headers&lt;/code&gt; message responding to a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;getheaders&lt;/code&gt; message from the modern node.
Due to a bug in how 0.5.0 responds to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;getheaders&lt;/code&gt; messages, it ends up trying to respond with a significant portion of the blockchain that it knows about, and this exceeds the size limit.
Resolving this is simple - remove the protocol message limit on my modern node.&lt;/p&gt;

&lt;p&gt;On my modern node, I applied the following diff:&lt;/p&gt;

&lt;div class=&quot;language-diff highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gh&quot;&gt;diff --git a/src/net.cpp b/src/net.cpp
index 955eec46e3..001283dc71 100644
&lt;/span&gt;&lt;span class=&quot;gd&quot;&gt;--- a/src/net.cpp
&lt;/span&gt;&lt;span class=&quot;gi&quot;&gt;+++ b/src/net.cpp
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;@@ -749,7 +749,7 @@&lt;/span&gt; int V1TransportDeserializer::readHeader(Span&amp;lt;const uint8_t&amp;gt; msg_bytes)
     }
 
     // reject messages larger than MAX_SIZE or MAX_PROTOCOL_MESSAGE_LENGTH
&lt;span class=&quot;gd&quot;&gt;-    if (hdr.nMessageSize &amp;gt; MAX_SIZE || hdr.nMessageSize &amp;gt; MAX_PROTOCOL_MESSAGE_LENGTH) {
&lt;/span&gt;&lt;span class=&quot;gi&quot;&gt;+    if (hdr.nMessageSize &amp;gt; MAX_SIZE) {
&lt;/span&gt;         LogPrint(BCLog::NET, &quot;Header error: Size too large (%s, %u bytes), peer=%d\n&quot;, SanitizeString(hdr.GetCommand()), hdr.nMessageSize, m_node_id);
         return -1;
     }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And now I could continue syncing without having to resync blocks.&lt;/p&gt;

&lt;h2 id=&quot;third-attempt&quot;&gt;Third Attempt&lt;/h2&gt;

&lt;p&gt;With the p2p problem out of the way, I figured the sync would continue as I have also increased the BDB locks.
But to my surprise, it did not.
This time though, the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;db.log&lt;/code&gt; had something different to say:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Lock table is out of available object entries
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Looking back at the BDB documentation, there’s another option that mentions “objects” - &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set_lk_max_objects&lt;/code&gt;.
I added &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set_lk_max_objects 1000000&lt;/code&gt; to my &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DB_CONFIG&lt;/code&gt; and restarted.&lt;/p&gt;

&lt;h2 id=&quot;fourth-attempt&quot;&gt;Fourth Attempt&lt;/h2&gt;

&lt;p&gt;Finally I am able to get past block 258,354.
In fact, this attempt was able to sync the entire blockchain!
I just had to wait about two weeks.&lt;/p&gt;

&lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt;

&lt;p&gt;0.5.0 was released in November 2011.
It’s remarkable that Bitcoin has actually maintained backwards compatibility over the past 10 years.
Furthermore, this is proof that Bitcoin has indeed only had soft forks since 2011.&lt;/p&gt;

&lt;p&gt;Overall, this took two weeks in order to sync the blockchain.
While 0.5.0 did not end up requiring multiple minutes to validate a single block, around block 395,000, each block started to take multiple seconds.
This slowdown persisted through to the chain tip and ended up making the sync extraordinarily slow.
In the end, I was observing four seconds per block.&lt;/p&gt;

&lt;p&gt;Besides the long time it took to sync the blockchain, 0.5.0 also ended up temporarily having a much larger datadir than a modern Bitcoin node.
I observed that, while it was running, it consumed 800 GB of disk space.
It likely would have consumed more if I had not had to restart it because my computer ran out of disk space.
But it turns out that a lot of that disk space is freed when the node shuts down.
This is because the database uses journaling and those journal files take up 400+ GB.
On shutdown, those journal files are compacted into the main database and cleaned up, freeing a ton of space.&lt;/p&gt;

&lt;p&gt;The 0.5.0 datadir ended up being 400 GB after it was shut down when syncing completed.
301 GB of that are the block data, stored in blk*.dat files.
Interestingly, this is less than the 372 GB of block data for my modern node.
This discrepancy is of course due to witness data which 0.5.0 does not download.
The modern node also stores “undo data” in the rev*.dat files, which conssume another 52 GB.
However 0.5.0’s databases are far larger, at 99 GB, whereas the modern node only requires 4.6 GB for the chainstate, and 35 GB for the transaction index (which is optional but I have enabled anyways).
So while modern nodes require a little bit more storage than 0.5.0, they still have more compact databases (which also do not grow to insane sizes while running) and sync far faster.&lt;/p&gt;

&lt;p&gt;0.5.0 is certainly not the oldest Bitcoin software, it was just the most convenient old version for me to test.
This experiment should be repeated in the future with even older versions to test how compatible Bitcoin really is.&lt;/p&gt;
</description>
        <pubDate>Tue, 29 Mar 2022 17:42:00 -0400</pubDate>
        <link>http://achow101.com/2022/03/syncing-0.5.0</link>
        <guid isPermaLink="true">http://achow101.com/2022/03/syncing-0.5.0</guid>
        
        
      </item>
    
      <item>
        <title>URI Argument Injection Vulnerability in Bitcoin Core 0.18 and Earlier</title>
        <description>&lt;h1 id=&quot;uri-argument-injection-vulnerability-in-bitcoin-core-018-and-earlier&quot;&gt;URI Argument Injection Vulnerability in Bitcoin Core 0.18 and Earlier&lt;/h1&gt;

&lt;p&gt;This article describes an URI Argument Injection vulnerability discovered in Bitcoin Core 0.18 and earlier.
The vulnerability was fixed in Bitcoin Core 0.19.0.
Bitcoin Core 0.19.0 and later are not vulnerable.
This vulnerability only affects Windows and Linux.&lt;/p&gt;

&lt;h2 id=&quot;background&quot;&gt;Background&lt;/h2&gt;

&lt;p&gt;In 2019, I was browsing the &lt;a href=&quot;https://web.archive.org/web/20190808154342/https://pwnies.com/nominations/&quot;&gt;pwnie award nominations&lt;/a&gt; and found an entry titled “RCE in Qt5-Based GUI Apps.”
As Bitcoin Core’s GUI (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bitcoin-qt&lt;/code&gt;) uses Qt5, this immediately piqued my interest.
The &lt;a href=&quot;https://www.bleepingcomputer.com/news/security/qt5-based-gui-apps-susceptible-to-remote-code-execution/&quot;&gt;linked article&lt;/a&gt; describes a vulnerability in multiple Qt5 based software could have malicious code executed on a user’s computer after clicking a malicious URI.
I proceeded to investigate whether this same vulnerability affects and found that it was theoretically possible.
However it seems that this vulnerability is unlikely to actually be exploited.&lt;/p&gt;

&lt;h2 id=&quot;uri-handlers&quot;&gt;URI Handlers&lt;/h2&gt;

&lt;p&gt;Understanding this vulnerability first requires that we understand how URIs are handled.
Windows and Linux handles this in a similar manner.
MacOS handles URIs differently so it is not affected by this vulnerability.&lt;/p&gt;

&lt;p&gt;In Windows, the operating system executes a pre-registered command with the URI as an argument.
This command is stored in the Windows registry and contains format specifiers for the location within in the command to insert the URI.
Windows replaces the format specifier &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%1&lt;/code&gt; with the URI and then executes the command string.
For Bitcoin Core, the registry key is&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;HKEY_CLASSES_ROOT\bitcoin\shell\open\command
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and the command is&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&quot;C:\Program Files\Bitcoin\bitcoin-qt.exe&quot; &quot;%1&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In Linux, the desktop environment searches for a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.desktop&lt;/code&gt; file which contains a line like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MimeType=x-scheme-handler/bitcoin&lt;/code&gt;.
It then executes the command specified by the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Exec=&lt;/code&gt; line.
A common &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.desktop&lt;/code&gt; file for Linux has:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Exec=bitcoin-qt %u
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This command is, like Windows, a string with format specifiers.
The desktop environment will replace the format specifier &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%u&lt;/code&gt; with the URI and execute the command string.&lt;/p&gt;

&lt;h2 id=&quot;uri-argument-injection&quot;&gt;URI Argument Injection&lt;/h2&gt;

&lt;p&gt;Since URI handling in both Windows and Linux basically amounts to creating a string containing the URI and then executing it, a maliciously crafted URI could make the string such that it looks like a command with additional command line arguments.
For example, consider the URI &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bitcoin:BC1QXUFYM7NNUSQZW9R2U5G98USKDAT7XQN4VYZ63S&quot; &quot;-argument&lt;/code&gt;.
With the Window’s URI command, the simple string replacement it does would create the command&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&quot;C:\Program Files\Bitcoin\bitcoin-qt.exe&quot; &quot;bitcoin:BC1QXUFYM7NNUSQZW9R2U5G98USKDAT7XQN4VYZ63S&quot; &quot;-argument&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Notice how this looks like the URI is followed by a command line argument &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-argument&lt;/code&gt;.
In fact, it not only looks like that, it is interpreted by the OS that way and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-argument&lt;/code&gt; is provided to the software as a separate command line argument instead of as part of the URI as it should be.
In this way, a malicious URI could cause the software to start with a dangerous command line argument.&lt;/p&gt;

&lt;h2 id=&quot;injecting-arguments-into-bitcoin-core&quot;&gt;Injecting Arguments into Bitcoin Core&lt;/h2&gt;

&lt;p&gt;Since URI argument injection is a known issue, software developers have ways to avoid them.
Bitcoin Core’s argument parser ignores any arguments that follow a URI.
So it is not possible to use inject Bitcoin Core specific arguments through a URI.
However, as noted earlier, the problem is with Qt.&lt;/p&gt;

&lt;p&gt;The Qt framework specifies a set of Qt specific command line arguments.
When Qt is initialized, the command line arguments are be passed into Qt in order for those arguments to be processed by Qt.
This is done before Bitcoin Core processes the command line arguments.
Qt will look through the argument list, find the arguments it can handle, and remove them from the list as it handle them.
Then the arguments get passed to Bitcoin Core’s argument parser.
This processing by Qt does not recognize URIs and will process any arguments regardless of their position in the arguments list.
Thus it is possible to use a URI to inject Qt specific arguments.&lt;/p&gt;

&lt;h2 id=&quot;dangerous-command-line-arguments&quot;&gt;Dangerous Command Line Arguments&lt;/h2&gt;

&lt;p&gt;Most of the Qt arguments are benign and &lt;a href=&quot;https://doc.qt.io/qt-5/qguiapplication.html#supported-command-line-options&quot;&gt;Qt’s documentation&lt;/a&gt; specifies the available arguments.
These arguments primarily affect the way that the application looks.
However there is one specific argument that is problematic: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-platformpluginpath&lt;/code&gt;.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-platformpluginpath&lt;/code&gt; loads some plugin from a path and executes it.
With some other tricks (described in the original “RCE in Qt5” article), it is possible to get a malicious plugin onto the victim’s computer, and once they click a malicious URI that injects &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-platformpluginpath&lt;/code&gt;, have that plugin be executed.
As a malicious plugin can be executed, this is classified as a remote code execution vulnerability.&lt;/p&gt;

&lt;h2 id=&quot;uri-argument-injection-mitigations&quot;&gt;URI Argument Injection Mitigations&lt;/h2&gt;

&lt;p&gt;Of course, operating systems, browser developers, and software developers do not necessarily do the naive implementation.
As previously mentioned, Bitcoin Core ignores command line arguments found after a URI.
So a URI that injects arguments cannot cause Bitcoin Core to start with any additional Bitcoin Core specific command line arguments.
Additionally, Bitcoin Core specifically registers a URI handler that surrounds the URI with double quotes so that an argument cannot be injected with just spaces.
The attacker has to make a URI that itself contains double quotes to do the injection.&lt;/p&gt;

&lt;p&gt;But browser developers are aware of the double quote trick, so they will sanitize the URI before passing it to the operating system to be handled.
Browsers will escape the double quotes, and often do other sanitizing such as replacement of spaces, to ensure that the OS treats the entire URI as a single URI argument, not as multiple command line arguments.
For example, for the URI &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bitcoin:BC1QXUFYM7NNUSQZW9R2U5G98USKDAT7XQN4VYZ63S&quot; &quot;-argument&lt;/code&gt;, a possible string actually used would be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bitcoin:BC1QXUFYM7NNUSQZW9R2U5G98USKDAT7XQN4VYZ63S\&quot; \&quot;-argument&lt;/code&gt; and the final command&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;`&quot;C:\Program Files\Bitcoin\bitcoin-qt.exe&quot; &quot;bitcoin:BC1QXUFYM7NNUSQZW9R2U5G98USKDAT7XQN4VYZ63S\&quot; \&quot;-argument&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Since the double quotes are escaped by being preceded with a backslash (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;\&lt;/code&gt;), they are not treated as delimiters between arguments but instead as part of a single argument string.
Another method of sanitizing includes using URL encoding of special characters instead of escaping.&lt;/p&gt;

&lt;p&gt;It is important to note that browsers must do this sanitizing in Windows.
Windows itself does not sanitize the URI, so a browser which does not sanitize the URI would allow for arguments to be injected.
However most of the browsers in use today will sanitize the URI in some way which prevents this vulnerability from being exploited.&lt;/p&gt;

&lt;p&gt;When it comes to Linux, the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%u&lt;/code&gt; specifier specifically means that the entire URI is to be treated as a single argument.
Properly implemented desktop environments will do this correctly and not allow part of the URI to be treated as separate arguments.
I do not know of any desktop environment that does not do this, so on Linux, the desktop environments prevent this vulnerability from being exploited.&lt;/p&gt;

&lt;p&gt;Thus, in practice, argument injection via a URI is almost impossible to execute with Bitcoin Core and modern browsers and desktop environments.
It is because of these mitigations that I believe that this vulnerability cannot actually be exploited.&lt;/p&gt;

&lt;h2 id=&quot;bitcoin-cores-fix&quot;&gt;Bitcoin Core’s Fix&lt;/h2&gt;

&lt;p&gt;Even though I believe that this vulnerability cannot actually be exploited, it is still prudent to fix the issue.
The fix for this vulnerability is to disallow Qt from processing command line arguments.
Instead of initializing Qt with the real list of command line arguments, we initialize it with an empty list of arguments.
This was implemented in &lt;a href=&quot;https://github.com/bitcoin/bitcoin/pull/16578&quot;&gt;PR #16578&lt;/a&gt; which was merged in August 2019.
While this does fix the problem, it does also have the downside that users who do wish to use Qt’s other command line arguments to customize how it looks will be unable to do so via command line arguments.
Instead this will need to be done through environment variables.
A future followup would be to allow only some of Qt’s command line arguments to be used and/or disallow the dangerous ones.&lt;/p&gt;

&lt;h2 id=&quot;demonstration&quot;&gt;Demonstration&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://www.twitch.tv/videos/897351419&quot;&gt;Video on twitch.tv&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;cve&quot;&gt;CVE&lt;/h2&gt;

&lt;p&gt;This vulnerability has been assigned CVE-2021-3401.&lt;/p&gt;

&lt;h2 id=&quot;timeline&quot;&gt;Timeline&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;2019-08-02: Vulnerability discovered&lt;/li&gt;
  &lt;li&gt;2019-08-03: Vulnerability reported to security@bitcoincore.org&lt;/li&gt;
  &lt;li&gt;2019-08-03 - 2019-08-09: Further vulnerability investigation, disclosure to additional developers, and development of fix&lt;/li&gt;
  &lt;li&gt;2019-08-09: PR #16578 opened&lt;/li&gt;
  &lt;li&gt;2019-08-15: PR #16578 merged&lt;/li&gt;
  &lt;li&gt;2019-11-24: 0.19.0.1 released containing fix&lt;/li&gt;
  &lt;li&gt;2021-02-01: 0.18.0 End of Life&lt;/li&gt;
  &lt;li&gt;2021-02-01: Disclosure published&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Mon, 01 Feb 2021 10:00:00 -0500</pubDate>
        <link>http://achow101.com/2021/02/0.18-uri-vuln</link>
        <guid isPermaLink="true">http://achow101.com/2021/02/0.18-uri-vuln</guid>
        
        
      </item>
    
      <item>
        <title>Announcing the Bitcoin Core Usage Survey</title>
        <description>&lt;h1 id=&quot;announcing-the-bitcoin-core-usage-survey&quot;&gt;Announcing the Bitcoin Core Usage Survey&lt;/h1&gt;

&lt;p&gt;Today I am launching a survey aimed at gathering information about how people use Bitcoin Core.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://survey.alchemer.com/s3/6081474/8acd79087feb&quot;&gt;Click here to take the survey&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This survey is generously made possible by a grant from &lt;a href=&quot;https://dci.mit.edu/&quot;&gt;MIT’s Digital Currency Initiative&lt;/a&gt; and is being run with the help and collaboration of the researchers at &lt;a href=&quot;https://maiden.global/&quot;&gt;Maiden Labs&lt;/a&gt;.
A special thanks to Square Crypto &lt;a href=&quot;https://twitter.com/sqcrypto/status/1338665428550365184&quot;&gt;grant recipient&lt;/a&gt; Jamaal Montasser for his input throughout the design as well.&lt;/p&gt;

&lt;p&gt;The survey will remain up for 6 weeks, until March 2nd, 2021.&lt;/p&gt;

&lt;h2 id=&quot;goals&quot;&gt;Goals&lt;/h2&gt;

&lt;p&gt;The goal of this survey is to learn why people use Bitcoin Core, how they use it, and what features are used.
The results of the survey will be used to inform what features should be focused on and prioritized.
By understanding how our users behave and use Bitcoin Core, we will be better able to write software that suits their needs.&lt;/p&gt;

&lt;p&gt;Additionally the survey will allow users to provide feedback, such as feature requests, so that we can include things that people want.&lt;/p&gt;

&lt;h2 id=&quot;results&quot;&gt;Results&lt;/h2&gt;

&lt;p&gt;The plan is to share the results of this survey publicly.
At the very least, the results will be shared with other Bitcoin Core developers so that many of the people involved will have data that can be used.&lt;/p&gt;

&lt;h2 id=&quot;privacy&quot;&gt;Privacy&lt;/h2&gt;

&lt;p&gt;As many people involved in Bitcoin are very privacy conscious, this survey was designed in order to preserve survey taker’s privacy as much as possible.
The survey uses &lt;a href=&quot;https://www.alchemer.com/&quot;&gt;Alchemer&lt;/a&gt; and is configured so that no information about the survey taker is stored.
While the survey does ask for location, survey source, and email, these are all entirely optional and can be left blank if so desired.
Additionally IP information is not collected and the survey does not make use of any kind of tracking cookies.
Even so, if you want to preserve your privacy as much as possible, I recommend using the &lt;a href=&quot;https://www.torproject.org/&quot;&gt;Tor browser&lt;/a&gt; to take it.
I have tested it with Tor and it does not appear to have any issues with the website; no annoying CAPTCHAs to fill out and the web page works as expected.&lt;/p&gt;

&lt;h2 id=&quot;survey-breakdown&quot;&gt;Survey Breakdown&lt;/h2&gt;

&lt;p&gt;In this section, I will go through the various questions being asked and what the purpose of asking them is.
There are some questions which change which questions are asked.
These are intended to accommodate the wide variety of participants that we expect so that only relevant questions will be answered.&lt;/p&gt;

&lt;h3 id=&quot;meta-and-screener-questions&quot;&gt;Meta and Screener Questions&lt;/h3&gt;

&lt;p&gt;The questions in this section just provide some additional context about our survey participants as well as determining which questions are relevant to the participant.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Which country are you based in?&lt;/li&gt;
  &lt;li&gt;Where did you hear about this study?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These two questions allow us to control for potential bias due to the source of the participants (e.g. users that come from Reddit may be different from those who come from Twitter) as well as gain some insight into how users are distributed around the world.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Do you run a node with Bitcoin Core?&lt;/li&gt;
  &lt;li&gt;Do you use the Bitcoin Core Wallet?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These two questions direct the participant to different questions.
Depending on the answer, different questions will be asked as some are not relevant to those who, for example, do not use the Bitcoin Core wallet.&lt;/p&gt;

&lt;h3 id=&quot;currently-node-operator-questions&quot;&gt;Currently Node Operator Questions&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Why do you own and/or use Bitcoin?&lt;/li&gt;
  &lt;li&gt;Why do you run a Bitcoin Core node?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These questions aim to provide us with the motivations for users to run a node.
This will help us change how the node behaves so that it can better fit with why people are using Bitcoin Core as a node.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;How long have you run a Bitcoin Core node?&lt;/li&gt;
  &lt;li&gt;How often do you update your Bitcoin Core node?&lt;/li&gt;
  &lt;li&gt;What version are you running?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These questions give us information about how frequently people actually update their node software as well as telling us what versions are actually in use.
This will help us with deciding when and whether a new bug fix release should be made.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Select core features you’ve used on Bitcoin Core’s node over the last six months&lt;/li&gt;
  &lt;li&gt;If applicable, select all of the settings for which you have changed the default value&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These two questions inform us as to what features people are using.
This will help us know where to prioritize ongoing development.
For some features, this could be informative as to whether a feature should be removed or changed.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What other Bitcoin software or hardware projects do you often use, if any?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Knowing what other software is being used can help us learn where there are deficiencies in Bitcoin Core that should be remedied.
This would let us know what features we may want to implement as people are using other software for those features.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;When you run into problems with your Core node, how do you usually troubleshoot those problems?&lt;/li&gt;
  &lt;li&gt;What’s the primary way you stay informed of Bitcoin Core development?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These questions allow us to learn where users are getting their information.
This will help us with knowing where to go to distribute information in the event that something needs to be widely known.
Additionally this lets us know where developers may need to increase their presence in order to better aid users.&lt;/p&gt;

&lt;h3 id=&quot;previously-operated-node-questions&quot;&gt;Previously Operated Node Questions&lt;/h3&gt;

&lt;p&gt;Many of the questions for this section are the same as for the Current Node Operator questions.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;When did you stop running a Bitcoin Core node?&lt;/li&gt;
  &lt;li&gt;Why did you run a Bitcoin Core node?&lt;/li&gt;
  &lt;li&gt;What’s the reason why you stopped running a Bitcoin Core node?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These questions will inform us what stops people from running a Bitcoin Core node so that we can improve.&lt;/p&gt;

&lt;h3 id=&quot;currently-use-the-wallet-questions&quot;&gt;Currently Use the Wallet Questions&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;What is most important to you when looking for a new wallet?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This question allows us to know what users want so that we can focus on desired features.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;How did you find yourself primarily using the Bitcoin Core wallet?&lt;/li&gt;
  &lt;li&gt;How do you primarily use the Bitcoin Core wallet?&lt;/li&gt;
  &lt;li&gt;Is Bitcoin Core the only wallet you use?&lt;/li&gt;
  &lt;li&gt;What other wallets do you use and why do you use them instead of the Core wallet?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These two questions tell us how users use the wallet.
With this information, we will be able to decide which set of features should be prioritized or more actively worked on.
Knowing what other software is being used also lets us know what is missing in Bitcoin Core that we may want to emulate.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What does the Bitcoin Core wallet do better than other bitcoin wallets you have tried, if any?&lt;/li&gt;
  &lt;li&gt;Select features you’ve used on Bitcoin Core’s wallet over the last six months?&lt;/li&gt;
  &lt;li&gt;What feature would you be most disappointed to see removed from the Bitcoin Core wallet?&lt;/li&gt;
  &lt;li&gt;What features or actions did you wish the Bitcoin Core wallet supported better?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This questions lets us know what features we should prioritize, keep, and improve.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;How many UTXOs are in your Bitcoin Core wallet?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This question is specifically to aid with the design of our coin selection algorithm.
The coin selection algorithm is what decides what inputs to use in a transaction and is an integral part of the wallet.
It can be optimized to different kinds of wallets.
This question allows us to know what kind of wallets the coin selection algorithm should be targeting to better serve the majority of our users.&lt;/p&gt;

&lt;h3 id=&quot;previously-used-the-wallet-questions&quot;&gt;Previously Used the Wallet Questions&lt;/h3&gt;

&lt;p&gt;Many of the questions for this section are the same as for the Currently Use the Wallet questions.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;How long were you using the Bitcoin Core wallet for?&lt;/li&gt;
  &lt;li&gt;When did you stop using the Bitcoin Core wallet?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These questions are to learn how long people tend to use the wallet for and whether stopping the use of the wallet is related to the node.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What’s the reason you no longer use the Bitcoin Core wallet?&lt;/li&gt;
  &lt;li&gt;What wallet did you switch to?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We want to know what turned users off to another wallet so that we can make the wallet better to meet the needs that others were fulfilling.&lt;/p&gt;

&lt;h3 id=&quot;never-used-the-wallet-questions&quot;&gt;Never Used the Wallet Questions&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;What wallet do you use?&lt;/li&gt;
  &lt;li&gt;How did you decide which wallet to use?&lt;/li&gt;
  &lt;li&gt;Did you consider using the Bitcoin Core wallet?&lt;/li&gt;
  &lt;li&gt;Do you remember why you decided to not use the Bitcoin Core wallet?&lt;/li&gt;
  &lt;li&gt;What is most important to you when looking for a new wallet?&lt;/li&gt;
  &lt;li&gt;What feature would you be most disappointed to see removed from your current wallet?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although users who see these questions do not use Bitcoin Core for their wallet, we would like to know why and whether there are things from the wallet that they use that we should implement in Bitcoin Core.&lt;/p&gt;

&lt;h3 id=&quot;never-used-bitcoin-core-questions&quot;&gt;Never Used Bitcoin Core Questions&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Do you own Bitcoin?&lt;/li&gt;
  &lt;li&gt;What wallet do you use to store Bitcoin?&lt;/li&gt;
  &lt;li&gt;Why do you own and/or use Bitcoin?&lt;/li&gt;
  &lt;li&gt;Have you considered running a Bitcoin Node?&lt;/li&gt;
  &lt;li&gt;What’s stopping you from running a node?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although users who see these questions do not use Bitcoin Core, it is still useful for us to know why they do not so that we can hopefully address those concerns and onboard new users.&lt;/p&gt;

&lt;h2 id=&quot;acknowledgements&quot;&gt;Acknowledgements&lt;/h2&gt;

&lt;p&gt;Special thanks to MIT’s DCI for generously sponsoring this survey, and for the researchers at &lt;a href=&quot;https://maiden.global/&quot;&gt;Maiden Labs&lt;/a&gt;, particularly Zach Herring and Shira Frank, who helped me put this survey together.
Additional thanks to Jamaal Montasser, Samuel Dobson, Sjors Provoost, and Jeremy Rubin who all provided additional insight into the questions and goals of this survey.&lt;/p&gt;
</description>
        <pubDate>Tue, 19 Jan 2021 14:30:00 -0500</pubDate>
        <link>http://achow101.com/2021/01/bitcoin-core-survey</link>
        <guid isPermaLink="true">http://achow101.com/2021/01/bitcoin-core-survey</guid>
        
        
      </item>
    
      <item>
        <title>What&apos;s Coming To The Bitcoin Core Wallet in 0.21</title>
        <description>&lt;h1 id=&quot;whats-coming-to-the-bitcoin-core-wallet-in-021&quot;&gt;What’s Coming To The Bitcoin Core Wallet in 0.21&lt;/h1&gt;

&lt;p&gt;Bitcoin Core 0.21 brings about a turning point to the Bitcoin Core wallet with the introduction of two major features and an eventual breaking of compatibility.
The landmark wallet features of this release are Descriptor Wallets and the SQLite database backend.
In this article, I will be explaining what these features are, what else is changing, and what the plan for the future is.&lt;/p&gt;

&lt;h2 id=&quot;upcoming-features&quot;&gt;Upcoming Features&lt;/h2&gt;

&lt;h3 id=&quot;descriptor-wallets&quot;&gt;Descriptor Wallets&lt;/h3&gt;

&lt;p&gt;The headlining wallet feature for Bitcoin Core 0.21 is Descriptor Wallets.
Descriptor Wallets store &lt;a href=&quot;https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md&quot;&gt;Output Script Descriptors&lt;/a&gt; in the wallet and use these to generate the addresses that users can use.
Legacy Wallets (the non-descriptor wallet type, and the only type of wallet previous versions would create) instead used private keys to generate addresses.
For even more detailed information on Descriptor Wallets, please read the &lt;a href=&quot;https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes.md#experimental-descriptor-wallets&quot;&gt;tentative release notes&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;the-problem-with-legacy-wallets&quot;&gt;The Problem with Legacy Wallets&lt;/h3&gt;

&lt;p&gt;Legacy Wallets were initially designed by Satoshi himself.
As this was when Bitcoin was first created, the understanding of what Bitcoin could do and how Bitcoin can be used was not as well understood as it is today.
As such, the wallet was built around the private keys and everything based around private keys even though Bitcoin has a scripting language that supports a lot more than just private keys.
So Legacy Wallets primarily contain private keys, and from these private keys, addresses are made.&lt;/p&gt;

&lt;p&gt;Even with just private keys, the Legacy Wallet was designed long before BIP 32 Hierarchical Deterministic Wallets were invented.
It was designed to use a random number generator to create private keys, not deriving them from a seed.
While the Legacy Wallet does support BIP 32 now, it is still not up to the level of support that other wallets have.
This support is done by replacing the RNG with BIP 32 derivation.
But there is no support for watching extended public keys (xpubs) and pubkeys cannot be derived, nor are pubkeys stored by the wallet.&lt;/p&gt;

&lt;p&gt;Since Bitcoin was first created, we have learned that there are many more things that output scripts can do than just single keys.
The scripting system in Bitcoin is powerful, but Bitcoin Core’s wallet cannot make use of it because more than just keys are involved in scripts.
Even just the introduction of P2SH introduced some issues for the Bitcoin Core wallet, and supporting the watching of scripts is largely bolted on and not integrated very well.
Watch-only in Legacy Wallets does not quite work as one would expect, and having a mix of watch-only and non-watch-only things in a Legacy Wallet only makes things more confusing.
Ultimately, extending the Legacy Wallet has primarily been hacking in new features rather than having a truly well designed wallet that can make the full use of Bitcoin.&lt;/p&gt;

&lt;h3 id=&quot;benefits-of-descriptor-wallets&quot;&gt;Benefits of Descriptor Wallets&lt;/h3&gt;

&lt;p&gt;In contrast with Legacy Wallets, Descriptor Wallets are designed to support the Bitcoin scripting system through the use of descriptors.
Descriptors explicitly give an output script (and thus address) as well as all of the keys and scripts necessary to sign them.
This essentially means that Descriptor Wallets are a script based wallet, while Legacy Wallets are key based.&lt;/p&gt;

&lt;p&gt;A Descriptor Wallet will then be able to support any kind of descriptor.
Newly introduced descriptors for new script types can be easily added to the wallet by adding a new descriptor.
For example, the Taproot proposal introduces a new address type and output scripts.
This can be easily added to the Bitcoin Core wallet by implementing a new descriptor.&lt;/p&gt;

&lt;p&gt;Alternative ways of deriving keys and scripts can be added by implementing them in the simpler descriptor module.
For example, Miniscript will eventually be added to the descriptor module.
This will allow descriptors to describe arbitrary scripts, which means that the wallet will be able to create addresses for arbitrary scripts.&lt;/p&gt;

&lt;p&gt;Descriptor Wallets also bring a simpler and saner way to do watch-only wallets in Bitcoin Core.
The confusing behavior of having mixed watch-only and non-watch-only things in Legacy Wallet is not present in Descriptor Wallets.
Descriptor Wallets can only have descriptors imported into them as well, so the scripts that it will watch for is explicit and can be computed.
There will no longer be the Legacy Wallet behavior of watching for something related to an import but was not explicitly imported.
Notably, because descriptors support xpub derivation, watch-only Descriptor Wallets can watch for BIP 32 wallets such as hardware wallets.
This paves the way for full hardware wallet support in a future release of Bitcoin Core.&lt;/p&gt;

&lt;h3 id=&quot;sqlite-database-backend&quot;&gt;SQLite Database Backend&lt;/h3&gt;

&lt;p&gt;As Descriptor Wallets are a wholly new type of wallet which is backwards incompatible, it made sense to introduce a new database backend at the same time.
So newly created Descriptor Wallets will now use SQLite as the database backend, instead of Berkeley DB that is used for Legacy Wallets.
This will eventually lead to the outright removal of Berkeley DB.
The introduction of a new database backend is motivated by the fact that Berkeley DB is not suitable for our use case, and the age of the version of Berkeley DB that we use.&lt;/p&gt;

&lt;h4 id=&quot;the-problem-with-berkeley-db&quot;&gt;The problem with Berkeley DB&lt;/h4&gt;

&lt;p&gt;Berkeley DB is not very suitable for our use case as an application data file; it was not designed to be used in this way.
Instead it was designed for large, multithreaded databases, which the wallet is not.
Because of this, the Legacy Wallet has several hacks to force Berkeley DB to behave like an application data file database, and these hacks can result in undesirable behavior.
Notably, Berkeley DB wallet files can be easily corrupted which can result in the loss of private keys, which is not good.&lt;/p&gt;

&lt;p&gt;Furthermore, Berkeley DB requires a database environment and it produces extra files which typically need to be moved with the database file if it is moved elsewhere.
Without those extra environment files, data can be lost.
This means that Berkeley DB is not portable, but that is unsuitable for a wallet file.
Many users expect it to be a singular file that can be transferred to other computers or to other directories for backups.
The Berkeley DB environment requirement also forces us to have directories for each wallet.
This is confusing and unintuitive to users.&lt;/p&gt;

&lt;p&gt;Lastly, the version of Berkeley DB used by Bitcoin Core is more than 10 years old.
We use Berkeley DB 4.8 which was released in 2010.
The requirement on this aging version of Berkeley DB is because backwards incompatible changes were introduced to the database environment files.
This means that wallets loaded with a newer version of Berkeley DB cannot be loaded with an older version of Berkeley DB, and this breaks downgrade compatibility.
This age has thus introduced additional issues for us.
For example, to compile Berkeley DB using C++11, a patch is required.
Berkeley DB 4.8 also &lt;a href=&quot;https://github.com/bitcoin/bitcoin/issues/19411&quot;&gt;cannot currently be compiled on the macOS Big Sur beta&lt;/a&gt; which is problematic for users who use (and will use) that OS and want to self compile Bitcoin Core.
So a new database backend is desired.&lt;/p&gt;

&lt;h4 id=&quot;why-sqlite&quot;&gt;Why SQLite&lt;/h4&gt;

&lt;p&gt;SQLite was chosen to be the new database backend because the SQLite developers provide several guarantees with regards to compatibility, support, and testing.
The SQLite developers advertise that SQLite is suitable as an application data file, which is what we want for the wallet.
SQLite is also very well tested and very widely used, so bugs and corruption issues tend to be found and fixed quickly.
Furthermore, SQLite makes few file format changes, and all of these file format changes are feature dependent and backwards compatible.
This means that if we don’t use a particular feature, then the file format will not change and it will be possible to upgrade and downgrade SQLite versions.
Even though we currently use the latest version of SQLite, we have found that it is possible to use a version of SQLite from 2013.&lt;/p&gt;

&lt;p&gt;SQLite is also designed to be portable and does not require a database environment.
While it does temporarily produce extraneous files, those files are removed as soon as it is done with them, and everything is written to the database file when a database write completes.
This is in contrast to Berkeley DB where a completed write does not guarantee that the data was written to the database file, it may have been written to an environment file.
The lack of the environment will also allow us to move to single wallet files instead of wallet directories.&lt;/p&gt;

&lt;p&gt;Other databases, such as LMDB, were also in consideration however none of the databases investigated had all of the same guarantees of SQLite.
For example, LMDB is not portable across different CPU architectures, so this was determined to not be suitable.
Many other databases have database environments and environment files, so these were not suitable for use either.
SQLite was the only widely used database system that had all of the features that we wanted for a wallet file.&lt;/p&gt;

&lt;h3 id=&quot;no-longer-creating-the-default-wallet&quot;&gt;No Longer Creating The Default Wallet&lt;/h3&gt;

&lt;p&gt;The Bitcoin Core wallet used to always create a wallet for the user when one did not already exist.
With the introduction of the multiwallet feature and the ability to create and open specifically named wallets, the default created wallet started to become more of an issue rather than a useful feature.
In particular, users would sometimes find that their wallet appeared to disappear when some configuration changed.
Of course, the wallet would not actually disappear, just that the data directory changed and a new default wallet was created.
This can be very confusing and extra stressful to the user as a new blank wallet is created.
This situation can be hard to debug, hard to explain, and difficult for non-technical users to fix.&lt;/p&gt;

&lt;p&gt;So The default wallet will no longer be created if it doesn’t exist.
Instead users will be prompted to create a new wallet or open an existing wallet.
In this way, when a configuration mistake occurs, a new empty wallet won’t be created so users won’t think that all of their Bitcoin has disappeared.
Furthermore, not creating a default wallet means that disk space is not unnecessarily used.
Users can create a wallet of the type and name that they want instead of having an unnamed default wallet taking up space on disk.&lt;/p&gt;

&lt;p&gt;Since users expect that their wallets be loaded when they start, there have been changes to the configuration system as well.
These changes, while not wallet related, allow for Bitcoin Core to save which wallets to load again on the next startup.
So the wallets that users create and load from the GUI will automatically be loaded again on the next startup unless they were closed during the session.
For RPC users, a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;load_on_startup&lt;/code&gt; argument has been added to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;createwallet&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;loadwallet&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;unloadwallet&lt;/code&gt; RPCs to specify whether a wallet should be loaded on startup.&lt;/p&gt;

&lt;h2 id=&quot;compatibility&quot;&gt;Compatibility&lt;/h2&gt;

&lt;p&gt;An important change to the wallet is that compatibility will be breaking.
Backwards compatibility has always been a key pillar in the Bitcoin Core wallet.
Changes have always had to consider users who decided to downgrade after an upgrade and users who bring in old wallets to a new release.
But maintaining backwards compatibility is difficult, and almost impossible to do when making large sweeping changes.&lt;/p&gt;

&lt;p&gt;Unfortunately, to make progress, sometimes compatibility needs to be broken.
Sometimes the past needs to be left behind.
As the Bitcoin Core wallet moves to making Descriptor Wallets the default, and later, only, wallet type, a future release of Bitcoin Core will no longer be able to open Legacy Wallets.&lt;/p&gt;

&lt;p&gt;Of course this does not mean that the change will be overnight and occur in one release.
Nor does this mean that Bitcoin Core will begin to make gratuitous backwards compatibility breaking changes.
Instead we will be making it easy to move from Legacy Wallets to Descriptor Wallets.
We will be making every effort to make Descriptor Wallets backwards compatible with previous versions that have them.&lt;/p&gt;

&lt;p&gt;As such, there will be a long deprecation cycle for Legacy Wallets and Berkeley DB.
The &lt;a href=&quot;https://github.com/bitcoin/bitcoin/issues/20160&quot;&gt;proposed timeline&lt;/a&gt; is to only have the final removal occur in late 2023.
In the meantime, we will be introducing ways to migrate a Legacy Wallet to a Descriptor Wallet.
It is, and will be, possible to take an existing Legacy Wallet, and make a Descriptor Wallet which exactly matches it.
There will be tooling that allows users to do this.
Even after the removal of Legacy Wallets and Berkeley DB, it will be possible to migrate Legacy Wallets to Descriptor Wallets through the use of a minimally dependent migration tool.&lt;/p&gt;

&lt;p&gt;As we get closer to the actual removal date, there will also be warnings and instructions on how to migrate a wallet.
So even users who don’t read the release notes and don’t pay attention to the Bitcoin Core news will know that they should migrate, and how to do so.
Even though compatibility will be breaking, we are not leaving users out to dry and we are doing everything that we can to make sure that the change to Descriptor Wallets only is as smooth as possible.&lt;/p&gt;
</description>
        <pubDate>Wed, 21 Oct 2020 14:30:00 -0400</pubDate>
        <link>http://achow101.com/2020/10/0.21-wallets</link>
        <guid isPermaLink="true">http://achow101.com/2020/10/0.21-wallets</guid>
        
        
      </item>
    
      <item>
        <title>Atomic Swaps Across Bitcoin Chain Splits</title>
        <description>&lt;h1 id=&quot;atomic-swaps-across-bitcoin-chain-splits&quot;&gt;Atomic Swaps Across Bitcoin Chain Splits&lt;/h1&gt;

&lt;h2 id=&quot;updates&quot;&gt;Updates&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;A previous version of this suggested the use of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;OP_CHECKLOCKTIMEVERIFY&lt;/code&gt; but after futher thought, I do not believe that is necessary.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;p&gt;There has been a bit of interest regarding a way to do atomic swaps between two blockchains which will split from each other with a hard fork. This post describes a way to do so with neither party needing to trust each other or a third party. This post is written in the context of the Segwit2x hard fork (and an example will be given using that) but can be applied to any such hard forks.&lt;/p&gt;

&lt;h2 id=&quot;requirements&quot;&gt;Requirements&lt;/h2&gt;

&lt;p&gt;First, let’s establish what we want to do&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Allow two parties, Alice and Bob, to swap their coins in the future at or after the time of the hard fork without trusting each other a third party&lt;/li&gt;
  &lt;li&gt;Allow both parties to back out of the agreement at any time and neither lose coins.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;the-method&quot;&gt;The Method&lt;/h2&gt;

&lt;h3 id=&quot;the-multisig-address&quot;&gt;The Multisig Address&lt;/h3&gt;

&lt;p&gt;To do this, we need both parties to approve the transaction, so we use a simple 2-of-2 mulltisig address. This way the transactions that pay from the address must be signed by both parties. Once we create the address, both Alice and Bob will fund the address with the coins they wish to swap.&lt;/p&gt;

&lt;h3 id=&quot;the-spending-transactions&quot;&gt;The Spending Transactions&lt;/h3&gt;

&lt;p&gt;The first transaction will send the entirety of the coins in the above address to Alice on chain A. To do this, we simply create a transaction which sends the coins to an Alice’s address and include the replay protection that is employed by chain A (e.g. a specific output that chain B will reject). We then set the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nLocktime&lt;/code&gt; value of the transaction to be that of the fork activation height or time.  We will actually set this to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;fork activation height/time&amp;gt; + 2 days&lt;/code&gt; to allow for the backing out transaction. Alice should have a copy of this transaction, and Bob can as well.&lt;/p&gt;

&lt;p&gt;The second transaction is very similar to the first transaction. It will send the entirety of the coins in the above address to Bob on chain B. To do this, we create a transaction which sends the coins to Bob’s address and include the replay protection that is employed by chain B (e.g. a new parameter that makes this transaction invalid on chain A). We then set the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nLocktime&lt;/code&gt; value of the transaction to be that of the fork activation height or time.  We will actually set this to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;fork activation height/time&amp;gt; + 2 days&lt;/code&gt; to allow for the backing out transaction. Bob should have a copy of this transaction, and Alice can as well.&lt;/p&gt;

&lt;h3 id=&quot;backing-out&quot;&gt;Backing out&lt;/h3&gt;

&lt;p&gt;If Alice or Bob decides that they really don’t want to go through with the swap, they have a way to back out after the fork activation height. To back out, Alice and Bob create a third transaction which sends the amount that they put in (minus transaction fees) back to themselves on their respective addresses. This transaction does not have a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nLocktime&lt;/code&gt; value at all so it can be broadcast at any time. If Alice or Bob wants to back out of the atomic swap at any time, this back out transaction can be broadcast and once it confirms, the prior two transactions will be invalidated. Both Alice and Bob should have a copy of this transaction.&lt;/p&gt;

&lt;h3 id=&quot;fork-day-events&quot;&gt;Fork Day Events&lt;/h3&gt;

&lt;p&gt;When the hard fork activates, if Alice or Bob wishes to back out, they should broadcast the back out transaction immediately. Because it was done in advance, the transaction fees may not be enough and a Child-Pays-For-Parent transaction may be needed. It will have two days to confirm.&lt;/p&gt;

&lt;p&gt;If Alice and Bob wish to continue with the swap, then they will wait until 2 days after the fork occurs and broadcast their respective transactions. Alice will broadcast here transaction to the network using chain A and Bob will broadcast his transaction to the network using chain B. Because both transactions employ replay protection, they are not at risk of being replayed on either network and thus losing coins.&lt;/p&gt;

&lt;h2 id=&quot;an-example-with-segwit2x&quot;&gt;An Example with Segwit2x&lt;/h2&gt;

&lt;p&gt;Now we will have an example atomic swap with Segwit2x. The examples will be done with Bitcoin Core.&lt;/p&gt;

&lt;p&gt;Suppose Alice wishes to swap 10 B2X for 10 of Bob’s BTC. This means that after the swap is complete, Alice will have 20 BTC and Bob will have 20 B2X.&lt;/p&gt;

&lt;p&gt;First they will create their addresses. Alice generates a new address and retrieves its public key:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bitcoin-cli getnewaddress
1Hs12LwwdXu2bhiuqyPfmWqUmTcZSBqEiS
$ bitcoin-cli validateaddress 1Hs12LwwdXu2bhiuqyPfmWqUmTcZSBqEiS
{
  &quot;isvalid&quot;: true,
  &quot;address&quot;: &quot;1Hs12LwwdXu2bhiuqyPfmWqUmTcZSBqEiS&quot;,
  &quot;scriptPubKey&quot;: &quot;76a914b8f6d4790d053d6b781f5fe229ecab8aab881d4388ac&quot;,
  &quot;ismine&quot;: true,
  &quot;iswatchonly&quot;: false,
  &quot;isscript&quot;: false,
  &quot;iswitness&quot;: false,
  &quot;pubkey&quot;: &quot;02fd4dbc0f5076881586ce7ae84a3bd2854d2c2ca7782e7d3de9d4cfe64c20daa9&quot;,
  &quot;iscompressed&quot;: true,
  &quot;account&quot;: &quot;&quot;,
  &quot;timestamp&quot;: 1505671741,
  &quot;hdkeypath&quot;: &quot;m/0&apos;/0&apos;/3&apos;&quot;,
  &quot;hdmasterkeyid&quot;: &quot;5daeb23c6fda331386be884baab609d78531292e&quot;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And Bob generates a new address and retrieves its public key:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bitcoin-cli getnewaddress
1JngAG1EfbjLqcfe3qcHNeV4Aeqc3NK4v3
$ bitcoin-cli validateaddress 1JngAG1EfbjLqcfe3qcHNeV4Aeqc3NK4v3
{
  &quot;isvalid&quot;: true,
  &quot;address&quot;: &quot;1JngAG1EfbjLqcfe3qcHNeV4Aeqc3NK4v3&quot;,
  &quot;scriptPubKey&quot;: &quot;76a914c31d8ba0a258f80eabade40a705f5831c8d28d6488ac&quot;,
  &quot;ismine&quot;: true,
  &quot;iswatchonly&quot;: false,
  &quot;isscript&quot;: false,
  &quot;iswitness&quot;: false,
  &quot;pubkey&quot;: &quot;0208fe052d79b9feeb2d5b12ba72d5fab857a055275d1c550573c61c251751a643&quot;,
  &quot;iscompressed&quot;: true,
  &quot;account&quot;: &quot;&quot;,
  &quot;timestamp&quot;: 1505671741,
  &quot;hdkeypath&quot;: &quot;m/0&apos;/0&apos;/4&apos;&quot;,
  &quot;hdmasterkeyid&quot;: &quot;5daeb23c6fda331386be884baab609d78531292e&quot;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now they are going to create the multisig address:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bitcoin-cli addmultisigaddress 2 &apos;[&quot;02fd4dbc0f5076881586ce7ae84a3bd2854d2c2ca7782e7d3de9d4cfe64c20daa9&quot;,&quot;0208fe052d79b9feeb2d5b12ba72d5fab857a055275d1c550573c61c251751a643&quot;]&apos;
34sQK7HNe7eXwhduxcCNTxXaRJFyBWH6K4
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now Alice and Bob are going to fund that address with transactions &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$TX_A&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$TX_B&lt;/code&gt;. These have outputs &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$VOUT_A&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$VOUT_B&lt;/code&gt; which fund the above address.&lt;/p&gt;

&lt;p&gt;We now need to create our spending transactions. First we create Alice’s spending transaction. The replay protection that we employ here is an OP_RETURN output with the string &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RP=!&amp;gt;1x&lt;/code&gt; as implemented in this &lt;a href=&quot;https://github.com/btc1/bitcoin/pull/134&quot;&gt;Pull Request to btc1&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bitcoin-cli createrawtransaction &apos;[{&quot;txid&quot;:&quot;$TX_A&quot;,&quot;vout&quot;:$VOUT_A},{&quot;txid&quot;:&quot;$TX_B&quot;,&quot;vout&quot;:$VOUT_B}]&apos; &apos;{&quot;1Hs12LwwdXu2bhiuqyPfmWqUmTcZSBqEiS&quot;:19.999,&quot;data&quot;:&quot;52503d213e3178&quot;}&apos; 495072
0200000002..e08d0700
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next we create Bob’s spending transaction. The replay protection that we employ here is that the transaction will be larger than 999920 bytes and less than 1000000 bytes so that it is too large to fit in a Bitcoin block but just small enough to fit in a Segwit2x block. To do so, we create 1886 outputs which have a maximum script size of 520 bytes. Note that we actually give it 516 bytes of data for the 1882 outputs because three bytes are used to represent the size of the data and one byte for the OP_RETURN. Unfortunately this transaction is going to be nonstandard, but it is the only known way to make a transaction only valid on the Segwit2x chain without using UTXO tainting.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bitcoin-cli createrawtransaction &apos;[{&quot;txid&quot;:&quot;$TX_A&quot;,&quot;vout&quot;:$VOUT_A},{&quot;txid&quot;:&quot;$TX_B&quot;,&quot;vout&quot;:$VOUT_B}]&apos; &apos;{&quot;1JngAG1EfbjLqcfe3qcHNeV4Aeqc3NK4v3&quot;:19.999,&quot;data&quot;:&quot;&amp;lt;516 bytes of data&amp;gt;&quot;,&amp;lt;repeat 1882 times&amp;gt;}&apos; 495072
0200000002..e08d0700
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then we create our back out transaction:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bitcoin-cli createrawtransaction &apos;[{&quot;txid&quot;:&quot;$TX_A&quot;,&quot;vout&quot;:$VOUT_A},{&quot;txid&quot;:&quot;$TX_B&quot;,&quot;vout&quot;:$VOUT_B}]&apos; {&quot;1JngAG1EfbjLqcfe3qcHNeV4Aeqc3NK4v3&quot;:9.999,&quot;1Hs12LwwdXu2bhiuqyPfmWqUmTcZSBqEiS&quot;:9.999}&apos; 494785
0200000002..c18c0700
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Lastly we sign these transactions:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bitcoin-cli signrawtransaction 0200000002..e08d0700
0200000002..e08d0700
$ bitcoin-cli signrawtransaction 0200000002..e08d0700
0200000002..e08d0700
$ bitcoin-cli signrawtransaction 0200000002..c18c0700
0200000002..c18c0700
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And broadcast them:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bitcoin-cli sendrawtransaction 0200000002..e08d0700
{TXID}
$ bitcoin-cli sendrawtransaction 0200000002..e08d0700
{TXID}
$ bitcoin-cli sendrawtransaction 0200000002..c18c0700
{TXID}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;software-for-this-example&quot;&gt;Software For This Example&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://gist.github.com/achow101/b1cd6155f96f72464a6a51439108ed1a&quot;&gt;Bash Script to create Bob’s spending transaction&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;acknowledgements&quot;&gt;Acknowledgements&lt;/h2&gt;

&lt;p&gt;I think Greg Maxwell first posted about this method on Reddit but did not go into as much detail or with an example as I have done here. I cannot find the post for it though.&lt;/p&gt;

</description>
        <pubDate>Wed, 11 Oct 2017 22:00:00 -0400</pubDate>
        <link>http://achow101.com/2017/10/chain-split-atomic-swaps</link>
        <guid isPermaLink="true">http://achow101.com/2017/10/chain-split-atomic-swaps</guid>
        
        
      </item>
    
      <item>
        <title>Bitcointalk Account Name Change</title>
        <description>&lt;h1 id=&quot;bitcointalk-accounts-name-change&quot;&gt;Bitcointalk Accounts Name Change&lt;/h1&gt;

&lt;p&gt;My primary account (290195) on Bitcointalk.org has had its name changed from knightdk to achow101. My secondary account (uid 466100) has had its name changed from achow101 to achow101_alt.&lt;/p&gt;
</description>
        <pubDate>Sat, 06 Aug 2016 11:36:00 -0400</pubDate>
        <link>http://achow101.com/2016/08/bctalk-name-change</link>
        <guid isPermaLink="true">http://achow101.com/2016/08/bctalk-name-change</guid>
        
        
      </item>
    
      <item>
        <title>Bitcoin Core Troubleshooting FAQ and Tips</title>
        <description>&lt;h1 id=&quot;bitcoin-core-troubleshooting-faq-and-tips&quot;&gt;Bitcoin Core Troubleshooting FAQ and Tips&lt;/h1&gt;

&lt;p&gt;Over the past year, I have been hanging out on various Bitcoin forums, the most frequented being Bitcointalk, and helping people out with various tech support issues with Bitcoin Core. I decided to compile the most frequent issues and troubleshooting tips into this post here, partially to help people troubleshoot their install, and partially to help me not have to keep posting the same thing over and over again.&lt;/p&gt;

&lt;p&gt;This document will continue to grow as I hear of more and more troubleshooting issues.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;#faq&quot;&gt;Troubleshooting FAQ&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#tips&quot;&gt;Troubleshooting Tips&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;frequently-asked-questions&quot;&gt;&lt;a name=&quot;faq&quot;&gt;&lt;/a&gt;Frequently Asked Questions&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;#stuck-tx&quot;&gt;Stuck Transaction&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#wrong-bal&quot;&gt;Wallet Balance is Wrong&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#empty-wallet&quot;&gt;Wallet is empty&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;a-transaction-is-stuck-how-do-i-make-it-confirm&quot;&gt;&lt;a name=&quot;stuck-tx&quot;&gt;&lt;/a&gt;A transaction is stuck, how do I make it confirm?&lt;/h3&gt;

&lt;p&gt;In Bitcoin Core, it is fairly easy to remove a transaction from your wallet so that you can resend the transaction with a higher fee. There are two methods to do so, the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;abandontransaction&lt;/code&gt; command and the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-zapwallettxes&lt;/code&gt; startup option.&lt;/p&gt;

&lt;p&gt;To use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;abandontransaction&lt;/code&gt; RPC, you first must be running Bitcoin Core 0.12 or later. Then open up the &lt;a href=&quot;#debug-console&quot;&gt;debug console&lt;/a&gt; and use the command&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;abandontransaction &amp;lt;txid&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;txid&amp;gt;&lt;/code&gt; is the transaction id of your stuck transaction. Do this for every stuck transaction. If the command is successful, there will be no error and no output.&lt;/p&gt;

&lt;p&gt;If &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;abandontransaction&lt;/code&gt; did not work or if you do not have Bitcoin Core 0.12 or later, then you can use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-zapwallettxes&lt;/code&gt; startup option. To do so, just follow the instrucionts to &lt;a href=&quot;#option-startup&quot;&gt;start Bitcoin Core with an option&lt;/a&gt; where the option you want to use is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-zapwallettxes&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;wallet-balance-is-incorrect&quot;&gt;&lt;a name=&quot;wrong-bal&quot;&gt;&lt;/a&gt;Wallet Balance is incorrect&lt;/h3&gt;

&lt;p&gt;If your wallet balance is incorrect, a number of things could have gone wrong. First double check that you are fully synced. Check a block explorer to see the latest block height. Next open Bitcoin Core and hover your mouse over the check mark at the bottom right hand corner. It should pop up with a little info box that says how many blocks Bitcoin Core has processed. This number should match the latest block height in the block explorer. If it does not, wait for Bitcoin Core to finish syncing. If you are synced, try &lt;a href=&quot;#option-startup&quot;&gt;starting Bitcoin Core with the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-rescan&lt;/code&gt; option&lt;/a&gt;. If that does not fix the problem, next check your receiving addresses at File &amp;gt; Receiving addresses. Make sure that you are not missing any addresses. If you are, &lt;a href=&quot;#address-in-wallet&quot;&gt;check whether the addresses you are missing are still in your wallet&lt;/a&gt;. If the address is missing from your wallet, then you will have to restore from a recent backup in order to recover it. Otherwise there is nothing that can be done.&lt;/p&gt;

&lt;h3 id=&quot;wallet-is-empty&quot;&gt;&lt;a name=&quot;empty-wallet&quot;&gt;&lt;/a&gt;Wallet is empty&lt;/h3&gt;

&lt;p&gt;If your wallet is empty and you see no familiar transactions or addresses, it is likely that the wallet file Bitcoin Core is currently using is not your actual wallet. If you had recently pressed the Reset Options button in Settings &amp;gt; Options, then your data directory may have been reverted to the default. To check, go to Help &amp;gt; Debug Window and go to the Information tab. In the field labeled Datadir, the path to your data directory will be listed. If that is not what you expect (custom if it was set, or default if not), then this is why your wallet is empty. If you had a custom data directory, you must &lt;a href=&quot;#option-startup&quot;&gt;start Bitcoin Core with the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-datadir=&amp;lt;path&amp;gt;&lt;/code&gt; option&lt;/a&gt; where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;path&amp;gt;&lt;/code&gt; is the path to your data directory.&lt;/p&gt;

&lt;h2 id=&quot;troubleshooting-tips&quot;&gt;&lt;a name=&quot;tips&quot;&gt;&lt;/a&gt;Troubleshooting tips&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;#debug-console&quot;&gt;Using the Debug Console&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#option-startup&quot;&gt;Start Bitcoin Core with options&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#address-in-wallet&quot;&gt;Check for a private key in the wallet&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#debug-log&quot;&gt;Open the debug.log file&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;enter-commands-into-the-debug-console&quot;&gt;&lt;a name=&quot;debug-console&quot;&gt;&lt;/a&gt;Enter commands into the debug console&lt;/h3&gt;

&lt;p&gt;To open the debug console, go to Help &amp;gt; Debug Window in Bitcoin Core. In the new window that pops up, click on the Console tab. This is the debug console. You type the commands in the small box at the bottom of the window. The command &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;help&lt;/code&gt; will give you a list of all commands available. Typing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;help &amp;lt;command name&amp;gt;&lt;/code&gt;, where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;command name&amp;gt;&lt;/code&gt; is one of the commands, will give you the usage for that command.&lt;/p&gt;

&lt;p&gt;The debug window will let you know if something was successful through the output of each command. Most of the commands will have an output. If the output is in black text, then your command was successfully run. If the output is in red text and has some sort of error code, then the command failed and there was an error.&lt;/p&gt;

&lt;p&gt;The commands also take arguments in JSON format, so entering the commands with proper JSON format and escaping is essential.&lt;/p&gt;

&lt;h3 id=&quot;start-bitcoin-core-with-a-startup-option&quot;&gt;&lt;a name=&quot;option-startup&quot;&gt;&lt;/a&gt;Start Bitcoin Core with a startup option&lt;/h3&gt;

&lt;p&gt;Starting Bitcoin Core with startup options can be very useful. The method of doing so is dependent on your Operating System&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;#windows-startup&quot;&gt;Windows&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#linux-startup&quot;&gt;Linux&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#mac-startup&quot;&gt;Mac OSX&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;windows&quot;&gt;&lt;a name=&quot;windows-startup&quot;&gt;&lt;/a&gt;Windows&lt;/h4&gt;

&lt;p&gt;Right click the shortcut that you use for starting Bitcoin Core. Click on Properties in that menu. In the Properties window, go to the box labeled Target. Click the box and move your cursor all the way to the right, past what is already in there. Then just type the options you want, making sure that there is a space between what is already in the box and your option, and a space between each option. Then just click OK and double click the shortcut to start Bitcoin Core. When Bitcoin Core is fully started, you can repeat this process and remove the options that you added.&lt;/p&gt;

&lt;h4 id=&quot;linux&quot;&gt;&lt;a name=&quot;linux-startup&quot;&gt;&lt;/a&gt;Linux&lt;/h4&gt;

&lt;p&gt;Open the terminal in Linux. If you did not install Bitcoin Core and are just running the binary, navigate to the directory you have the bitcoin-qt file in. Then type&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bitcoin-qt &amp;lt;options&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;options&amp;gt;&lt;/code&gt; are your startup options. Just make sure to have a space between each option. Press enter and Bitcoin Core will start with those options.&lt;/p&gt;

&lt;h4 id=&quot;mac-osx&quot;&gt;&lt;a name=&quot;mac-startup&quot;&gt;&lt;/a&gt;Mac OSX&lt;/h4&gt;

&lt;p&gt;Disclaimer: I don’t have a Mac so I am not 100% sure that this works, but it should.&lt;/p&gt;

&lt;p&gt;Open the Mac terminal. Then type&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;open Bitcoin-Qt.app --args &amp;lt;options&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;options&amp;gt;&lt;/code&gt; are your startup options. Just make sure to have a space between each option. Press enter and Bitcoin Core will start with those options.&lt;/p&gt;

&lt;h3 id=&quot;check-if-the-private-key-to-an-address-is-in-the-wallet&quot;&gt;&lt;a name=&quot;address-in-wallet&quot;&gt;&lt;/a&gt;Check if the private key to an address is in the wallet&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;#debug-console&quot;&gt;Open the debug console&lt;/a&gt; and use the command&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dumpprivkey &amp;lt;address&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;address&amp;gt;&lt;/code&gt; is the Bitcoin address whose private key you want to check is in the wallet. If the command was successful, it will print the private key to the console. DO NOT SHARE THE PRIVATE KEY WITH ANYONE. This key should begin with a ‘5’, ‘K’, or ‘L’. If it does not, it is not a private key. If the command failed with an error, the private key to the address is not in your wallet.&lt;/p&gt;

&lt;h3 id=&quot;get-the-debuglog-file&quot;&gt;&lt;a name=&quot;debug-log&quot;&gt;&lt;/a&gt;Get the debug.log file&lt;/h3&gt;

&lt;p&gt;The debug.log file is a log file that is very useful for troubleshooting. It does not leak any information about your private keys so your Bitcoin is always safe. To get the debug.log file, open Bitcoin Core and go to Help &amp;gt; Debug Window and go to the Information tab. Near the bottom right hand corner of the window is a button labeled Open with Debug log file. Click this to access the file. Now you can save the file elsewhere or copy the contents to send to someone.&lt;/p&gt;

&lt;p&gt;If Bitcoin Core is unable to open for some reason, go to the data directory. If you set a custom data directory on first startup or with the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--datadir&lt;/code&gt; option, then you must go there. The default locations are described at https://en.bitcoin.it/wiki/Data_directory#Default_Location. Once you are at the data directory, find the file named &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;debug.log&lt;/code&gt;. This is the file we are looking for. You can open this with any text editor and share the file with others.&lt;/p&gt;
</description>
        <pubDate>Sun, 24 Jul 2016 23:00:00 -0400</pubDate>
        <link>http://achow101.com/2016/07/Bitcoin-Core-Troubleshooting</link>
        <guid isPermaLink="true">http://achow101.com/2016/07/Bitcoin-Core-Troubleshooting</guid>
        
        
      </item>
    
      <item>
        <title>Announcing the Bitcoin Fork Monitor</title>
        <description>&lt;h1 id=&quot;updates&quot;&gt;Updates&lt;/h1&gt;

&lt;p&gt;July 18th 2017: The site has been revived and rewritten in python and django in anticipation of the BIP 91 and BIP 148 forks.&lt;/p&gt;

&lt;p&gt;June 19th 2016: The site has been shut down due to the expense of maintaining it.&lt;/p&gt;

&lt;h1 id=&quot;the-bitcoin-fork-monitor&quot;&gt;The Bitcoin Fork Monitor&lt;/h1&gt;

&lt;p&gt;I have created a new website, http://btcforkmonitor.info, which monitors the blockchain for the status of planned forks. It will continuously be updated as new forks are planned and deployed. It will only support forks that are assigned a BIP number and supported by a significant proportion of the Bitconi community. The site automatically follows and updates as new blocks are added and it will determine whether the block is supporting a specific fork.&lt;/p&gt;

&lt;h2 id=&quot;how-it-works&quot;&gt;How it works&lt;/h2&gt;

&lt;p&gt;The website uses a bitcoind in the background to receive, validate, and relay blocks to the actual site process. The site’s servlet backend will receive the block and examine the raw block data to determine which fork, if any, that the block supports.&lt;/p&gt;

&lt;h2 id=&quot;the-source-code&quot;&gt;The source code&lt;/h2&gt;

&lt;p&gt;This website is open source. The source code can be found at https://github.com/achow101/ForkMonitor. It is written in Java and utilizes the &lt;a href=&quot;gwtproject.org&quot;&gt;Google Web Toolkit&lt;/a&gt;, &lt;a href=&quot;objectdb.com&quot;&gt;ObjectDB&lt;/a&gt;, and &lt;a href=&quot;zeromq.org&quot;&gt;ZeroMQ&lt;/a&gt; libraries. The site and the source code is licensed under the Affero Gneral Public License.&lt;/p&gt;

&lt;h2 id=&quot;see-also&quot;&gt;See also&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://bitcointalk.org/index.php?topic=1458929.0&quot;&gt;Project Discussion on Bitcointalk&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://bitcointalk.org/index.php?topic=1456884.0&quot;&gt;Service Announcement on Bitcointalk&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Sun, 08 May 2016 10:00:00 -0400</pubDate>
        <link>http://achow101.com/2016/05/Fork-Monitor</link>
        <guid isPermaLink="true">http://achow101.com/2016/05/Fork-Monitor</guid>
        
        
      </item>
    
      <item>
        <title>Clearing the FUD around Segwit</title>
        <description>&lt;h1 id=&quot;clearing-the-fud-around-segregated-witness&quot;&gt;Clearing the FUD around Segregated Witness&lt;/h1&gt;

&lt;p&gt;Lately I have been noticing on a variety of online bitcoin communities such as &lt;a href=&quot;https://bitcointalk.org&quot;&gt;bitcointalk.org&lt;/a&gt;, &lt;a href=&quot;https://reddit.com/r/bitcoin&quot;&gt;/r/bitcoin&lt;/a&gt;, &lt;a href=&quot;https://reddit.com/r/btc&quot;&gt;/r/btc&lt;/a&gt;, &lt;a href=&quot;https://bitco.in/forum/&quot;&gt;bitco.in&lt;/a&gt;, and &lt;a href=&quot;https://forum.bitcoin.com&quot;&gt;bitcoin.com&lt;/a&gt; that many users do not understand what Segregated Witness (commonly known as segwit) is and what it does. I have seen that there are plenty of either uninformed or misinformed users spreading FUD (fear, uncertainty, doubt) about segwit. I am here to clear this up.&lt;/p&gt;

&lt;h2 id=&quot;what-is-segwit&quot;&gt;What is SegWit?&lt;/h2&gt;

&lt;p&gt;Segregated Witness is a solution created by the Bitcoin Core developers. It is spearheaded by Pieter Wuille, Johnson Lau, and Eric Lombrozo. The general high-level idea of segwit is that the signatures in a transaction (also called the witness data) are skipped when calculating the transaction id. By doing so it solves many issues that Bitcoin has. These benefits are laid out &lt;a href=&quot;https://bitcoincore.org/en/2016/01/26/segwit-benefits/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;clearing-up-the-myths&quot;&gt;Clearing up the myths&lt;/h2&gt;

&lt;p&gt;In this section, I will clear up many of the myths and misinformation that surround segwit. This will grow and change as people respond to me.&lt;/p&gt;

&lt;h3 id=&quot;myth-segwit-is-primarily-for-the-lightning-network&quot;&gt;Myth: Segwit is primarily for the Lightning Network&lt;/h3&gt;

&lt;p&gt;This is simply not true. The true and original purpose of segwit was to prevent transaction malleability. Since it removes the signatures from the data that is hashed to become the transaction id, there is then simply no way for a third party to change the signature data so that it was still valid but produced a different transaction id from the original. This attack is the High-S/Low-S attack which works because the signatures which protect the rest of the transaction from being modified cannot protect itself. With this separation, segwit is no longer vulnerable to these transaction malleability attacks as the txid is then calculated from data that cannot be changed at all by a third party.&lt;/p&gt;

&lt;p&gt;Although it began as a transaction malleability fix, it has evolved to something a little more complex. Segwit introduces a new hash pre-image generation algorithm which will make signature hashing operations scale linearly. The hash pre-image is the data that is to be hashed. This hash will be signed and that is the signature for the transaction. The change enables the use of hash midstates which allows for faster and more efficient hashing. This makes the relationship between the number of signature hashes and the time to generate them linear instead of the former quadratic relationship.&lt;/p&gt;

&lt;p&gt;Additionally, to maintain backwards compatibility, the size of the transaction that counts for part of the block size is the size of the data with the old transaction serialization. This means that the witness data is not included in this calculation. This means that a significant portion of the data in a transaction is not counted in the block size more transactions can then fit in a block. This is effectively a capacity increase. However full nodes will still be downloading all of the witness data to verify blocks and transactions and they will still have the same network bandwidth cost as an increased block size to support a similar capacity would have.&lt;/p&gt;

&lt;h3 id=&quot;myth-segwit-as-a-soft-fork-is-more-dangerous-than-a-hard-fork&quot;&gt;Myth Segwit as a soft fork is more dangerous than a hard fork&lt;/h3&gt;

&lt;p&gt;Segwit deployed as a soft fork is actually safer than a hard fork. A soft fork means that backwards and forwards compatibility is maintained. Old versions of Bitcoin software will be able to function with no ill effect when a soft fork is deployed. In contrast, a hard fork requires that every single Bitcoin user upgrade their software to support the new consensus rules. This has the effect of being not backwards compatible and thus forcing users to upgrade to the latest version or risk being kicked off of the Bitcoin network.&lt;/p&gt;

&lt;p&gt;Segwit was in fact originally planned as a hard fork, but the developers realized that it could be done as a soft fork and doing so would be safer than a hard fork. The only differences between segwit as a soft fork and as a hard fork is where the witness root hash goes and whether the witness data is counted in the block size or not. With the witness root hash, it could have either been in the block header or in the coinbase transaction. Segwit chose to put it in the coinbase transaction as an OP_RETURN output. This is safer because this allows for segwit to be done as a softfork even though the data is still the same size as it would have been if it were in the header. The other difference is whether to include the witness data in the block size count, and to maintain backwards compatibility while also having the capacity increase, it was decided to not do so.&lt;/p&gt;

&lt;h3 id=&quot;myth-segwit-is-kludgy-hacked-together-software-that-is-not-ready&quot;&gt;Myth: Segwit is kludgy hacked together software that is not ready.&lt;/h3&gt;

&lt;p&gt;No, this is very far from the truth. The Bitcoin Core developers have very strict testing and require that a test exist to test every single scenario. When new functionality is introduced, an automated test must also exist. The developers will also review the code and test it themselves to guarantee that it works as intended. Segwit is also written by some of very good developers who both came up with the concept and then implemented it. Before being added to Bitcoin Core, it will be tested very thoroughly over several days or even weeks to make sure that it is all ready. The implementation now is already being tested, with it being run by several people and on its fourth iteration of the segregated witness test network.&lt;/p&gt;

&lt;p&gt;There are however, a few hacks which are designed to allow segwit nodes to maintain compatibility with older software. The witness root hash being placed in the Coinbase transaction and the witness data not being counted towards the block size are two most prominent hacks that segwit employs. These are necessary to maintain the compatibility with non-upgraded nodes.&lt;/p&gt;

&lt;h3 id=&quot;myth-segwit-is-much-more-complex-than-a-super-simple-hard-fork&quot;&gt;Myth: Segwit is much more complex than a super simple hard fork.&lt;/h3&gt;

&lt;p&gt;While Segwit is indeed more complex and introduces many changes, but it is a relatively simple conceptual change, similar to a hard fork to increase the blocksize limit. On the surface, they appear simple. Segwit ignores the signatures when calculating the transactions, but as a soft fork, some additional changes must be made to make segwit transactions compatible with non-segwit nodes. These changes then have side effects which can be beneficial to Bitcoin. It also contains more functionality than a hard fork increasing the block size limit. The hard fork to increase the blocksize limit also appears simple, but additional changes need to be made to support the deployment and to solve the quadratic hashing issue with transactions.&lt;/p&gt;

&lt;p&gt;Additionally the BIPs and the Segwit Wallet Dev Guide are detailed and can help developers implement Segwit properly.&lt;/p&gt;

&lt;h3 id=&quot;myth-when-segwit-activates-i-wont-be-able-to-send-or-receive-my-bitcoin-anymore-if-i-dont-upgrade&quot;&gt;Myth: When segwit activates, I won’t be able to send or receive my Bitcoin anymore if I don’t upgrade.&lt;/h3&gt;

&lt;p&gt;With the way that segwit is designed, people can still send their transactions using Pay-to-Pubkey-Hash, Pay-to-Script-Hash, and Pay-to-Pubkey outputs as the current software do. These outputs and they way to spend from these outputs will not change. The signatures for verifying these transactions will not be moved and will remain in the scriptsig.&lt;/p&gt;

&lt;p&gt;What segwit does change is that it adds two new output types, Pay-to-Witness-Pubkey-Hash and Pay-To-Witness-Script-Hash. These two new output types require that the signatures to spend from those outputs are in a new Script Witness array which is not included in the hash of the transaction. The scriptsig of the inputs that spend those output types are empty. These output types are still compatible with non-upgraded nodes because they will always validate as true to those non-upgraded nodes because when they validate those transactions, the stack is not empty and not zero. Upgraded nodes will validate them fully because those nodes have access to the signatures and recognize that what the output format is.&lt;/p&gt;

&lt;p&gt;Segwit also creates a new type of Pay-to-Script-Hash address. The redeemscript of the p2sh address is one of the two new witness output types. The redeemscript is hashed and that becomes a p2sh address. This allows for senders who have not yet upgraded to send to a person who has upgraded and the recipient, when he spends from this p2sh output, can take advantage of segwit’s benefits.&lt;/p&gt;

&lt;p&gt;Overall, the changes that segwit makes do maintain compatibility with non-upgraded nodes. With these changes, a non-upgraded user can send Bitcoin using the current output types, thus able to send to both upgraded and non-upgraded users. Because the transaction uses the current output types, the following transaction cannot take advantage of segwit. However, a non-upgraded user can send to a segwit output nested in a p2sh output which allows them to send to upgraded users who can then take advantage of segwit for the following transaction. Upgraded users can also spend from any of the output types and still create the current output types so they can send to non-upgraded users as well.&lt;/p&gt;

&lt;h3 id=&quot;myth-if-i-dont-upgrade-i-can-be-attacked-by-people-sending-me-transactions-with-segwit-outputs&quot;&gt;Myth: If I don’t upgrade, I can be attacked by people sending me transactions with segwit outputs&lt;/h3&gt;

&lt;p&gt;If you don’t upgrade, your wallet will not know of the segwit outputs. It will not know that these outputs are meant for you. This can of course create problems if an upgraded user decides to create a segwit output when sending to a non-upgraded user. The non-upgraded user will not recognize the transaction is for him and this can create disputes. Unfortunately this flaw cannot be fixed through the consensus rules but rather through software implementation. For this, the best thing to do is for software to not use the segwit output types at all but rather continue to use the currently used p2pkh, p2sh, and p2pk output types. This can still take advantage of segwit because the new segwit output types can be nested inside of a p2sh address. New wallet addresses should be of this type; the p2wpkh or p2wsh output is placed as the redeemscript of a p2sh address. Thus users can still send to each other without issue and the upgraded users can still take advantage of segwit.&lt;/p&gt;

&lt;h3 id=&quot;myth-miners-who-dont-upgrade-to-segwit-will-be-forced-off-of-the-network&quot;&gt;Myth: Miners who don’t upgrade to segwit will be forced off of the network&lt;/h3&gt;

&lt;p&gt;This is not true, miners will not be forked off of the network. Segwit will be deployed using BIP9 versionbits which uses a 95% threshold. If a miner had less than 5% of the hash power and did not upgrade, he would not run into significant trouble so long as he follows certain rules (the standardness rules) which most miners do actually follow today. If this miner follows the standardness rules of today which are widely accepted by everyone, then he does not risk being forked. His blocks would simply not contain an transactions that spend from the output types nor have transactions that create the new output types. His blocks do not need to have the witness root hash in the coinbase so long as the block does not contain any transactions that have witnesses.&lt;/p&gt;

&lt;p&gt;However, if the miner did not follow the standardness rules, then he could end up including transactions with witnesses but he wouldn’t have the witnesses nor would he have the witness root hash in the coinbase. This would be an invalid block and it would be orphaned. Because the vast majority of the hash power supports segwit, this miner’s small fork would end up orphaned and he would switch back to the longest blockchain which was extended on by the segwit miners.&lt;/p&gt;

&lt;p&gt;Additionally, the miner has an incentive to upgrade as less and less transactions will continue to be the current normal transactions. More and more will have the segwit outputs which and spend from them which reduces the fees that this miner could get. Eventually, there will be some point where there are no transactions that this miner could include a block and thus he has an incentive to upgrade in order to get the transaction fees. If he did not, he would only earn from the block subsidy.&lt;/p&gt;

&lt;h3 id=&quot;myth-the-witness-discounts-are-to-incentivise-people-to-use-segwit&quot;&gt;Myth: The witness discounts are to incentivise people to use segwit&lt;/h3&gt;

&lt;p&gt;The primary idea behind the discounts are to incentivise wallets to manage change differently and clean up the UTXO set. This is best explained by Adam Back &lt;a href=&quot;https://www.reddit.com/r/Bitcoin/comments/4d3pdg/clearing_the_fud_around_segwit/d1nxn28&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;see-also&quot;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki&quot;&gt;BIP 141: Segregated Witness (Consensus Layer)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki&quot;&gt;BIP 143: Transaction Signature Verification for Version 0 Witness Program&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/bitcoin/bips/blob/master/bip-0144.mediawiki&quot;&gt;BIP 144: Segregated Witness (Peer Services)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://bitcoincore.org/en/segwit_wallet_dev/&quot;&gt;Segregated Witness Wallet Development Guide&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://bitcoincore.org/en/2016/01/26/segwit-benefits/&quot;&gt;Segregated Witness Benefits&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Fri, 01 Apr 2016 16:00:00 -0400</pubDate>
        <link>http://achow101.com/2016/04/Segwit-FUD-Clearup</link>
        <guid isPermaLink="true">http://achow101.com/2016/04/Segwit-FUD-Clearup</guid>
        
        
      </item>
    
      <item>
        <title>Welcome to my new website!</title>
        <description>&lt;p&gt;Welcome to my new website! This website is still hosted on Github but now I am using Jekyll which allows me to update the website more easily and add more more pages and info about stuff that I am doing.&lt;/p&gt;
</description>
        <pubDate>Sat, 27 Feb 2016 11:42:00 -0500</pubDate>
        <link>http://achow101.com/2016/02/New-Website</link>
        <guid isPermaLink="true">http://achow101.com/2016/02/New-Website</guid>
        
        
      </item>
    
  </channel>
</rss>
