Bitcoin Chain Fork Double Spend Incident
Notice: This page is a new case study and some aspects have not been fully researched. Some sections may be incomplete or reflect inaccuracies present in initial sources. Please check the References at the bottom for further information and perform your own additional assessment. Please feel free to contribute by adding any missing information or sources you come across. If you are new here, please read General Tutorial on Wikis or Anatomy of a Case Study for help getting started.
Notice: This page contains sources which are not attributed to any text. The unattributed sources follow the initial description. Please assist by visiting each source, reviewing the content, and placing that reference next to any text it can be used to support. Feel free to add any information that you come across which isn't present already. Sources which don't contain any relevant information can be removed. Broken links can be replaced with versions from the Internet Archive. See General Tutorial on Wikis, Anatomy of a Case Study, and/or Citing Your Sources Guide for additional information. Thanks for your help!
A larger-than-usual block with more transaction inputs was mined and broadcast, causing a fork in the Bitcoin blockchain. Bitcoin 0.8 nodes managed this well, but pre-0.8 nodes rejected it, resulting in an unexpected split. The 0.8-incompatible chain held about 60% of the mining hash power, preventing an automatic resolution. To restore a canonical chain, BTCGuild and Slush downgraded their Bitcoin 0.8 nodes to 0.7, making the majority hashpower favor the chain without the larger block, eventually causing 0.8 nodes to reorganize to the pre-0.8 chain. During this period, there was a notable double spend, but it was an experiment rather than a malicious act.
This is a global/international case not involving a specific country.[1][2]
About Bitcoin
Bitcoin is the largest and first blockchain network, originally launched by an anonymous founder Satoshi Nakamoto.
About Gavin Andresen
Gavin Andresen is one of the lead developers for the bitcoin blockchain.
About BTC-e
BTC-e was one of the largest historic exchanges prior to it's shutdown by authorities in 2017.
The Reality
Insufficient testing had been performed on bitcoin blocks[1]. No testing had been performed with blocks that were smaller in size but required more locks to be established on the BerkeleyDB[1].
What Happened
The bitcoin blockchain split into two, with 0.8+ version nodes running a separate chain. A double-spend transaction was able to occur against the BTC-e exchange at this time.
| Date | Event | Description |
|---|---|---|
| March 12th, 2013 2:08:00 AM MDT | BTC-E Deposit Made | "Well before I knew what later have happened, I deposited $10000-worth Bitcoins to BTC-e over OKPAY's Bitcoin payment, I paid OKPAY address 12z2n8YCJw1BEsJhhQPLCTuLqwH341nKnE 211.9093 BTC and 0.0005 BTC as transaction fee."[2] |
| March 12th, 2013 3:30:00 AM MDT | Transaction Included | "The transaction was included in version 0.8's fork, block 225446"[2] |
| March 12th, 2013 4:08:00 AM MDT | Credit To BTC-E Account | "Deposit completed, $9800 credited to my BTC-e account"[2] |
| March 12th, 2013 6:53:00 AM MDT | Replay Withdrawal To Pre-0.8 Chain | "After some study, I recognized, the transaction, though included in version 0.8's fork, was never confirmed by the pre-0.8 fork, so I decided to make two double spend transactions on two of the vins of the OKPAY transaction, and broadcasted them with the raw transaction API, 0.001 BTC transaction fee included in each transaction."[2] |
| March 12th, 2013 7:01:00 AM MDT | Double Spend Transaction Included | "The double spend transaction was included in pre-0.8 fork block 225446"[2] |
| March 12th, 2013 12:22:02 PM MDT | Bitcoin Talk Post | An article about the double spend and the timeline of events is posted on the Bitcoin Talk forum[2]. The sequence of events began with a deposit of $10,000 worth of Bitcoins to BTC-e over OKPAY's Bitcoin payment, resulting in $9800 credited to the BTC-e account. However, it was later realized that the transaction was never confirmed by the pre-0.8 fork, prompting the initiator to execute two double spend transactions on two of the vins of the OKPAY transaction. These transactions were broadcasted with the raw transaction API, each including a 0.001 BTC transaction fee. Subsequently, the double spend transaction was included in the pre-0.8 fork block 225446. This incident raised concerns about the security of Bitcoin transactions and prompted discussions about potential solutions to prevent similar occurrences in the future, highlighting the need for heightened vigilance among merchants considering Bitcoin transactions[2]. |
| March 13th, 2013 3:49:16 AM MDT | Announcement Of Fund Return | Okpay announces that the funds have been returned in the BitcoinTalk forum[3]. |
| March 13th, 2013 3:57:47 AM MDT | Funds Returned In Blockchain | Blockchain transaction believed to be the return of the funds which were taken through the double-spend[4]. |
| March 20th, 2013 10:34:00 AM MDT | Post-Mortem Released | A post-mortem / bitcoin improvement proposal is released by Gavin Andresen with additional details about the incident on the Bitcoin Wiki[5]. The BIP number 50 is assigned shortly thereafter. |
| March 20th, 2013 11:01:00 AM MDT | Gregory Maxwell Contributes | Gregory Maxwell expands the BIP article to include that all versions of the bitcoin client prior to 0.8 were affected and added more details. Interestingly, block sizes were set to 500Kb at this time[6]. |
| March 22nd, 2013 9:38:00 AM MDT | Randy Brito Critical Contribution | Randy Brito (of Bitcoin Venezuela)[7] changes "broadcast" to "broadcasted"[8], despite both being correct and "broadcast" being in far more common use globally[9]. |
| July 13th, 2019 4:25:00 AM MDT | Hack Used As Example | Eric Wall references the chain split in a discussion to refute the statement that "The Bitcoin blockchain has never been hacked"[10]. |
| October 10th, 2022 8:52:34 AM MDT | Stoppable Finance Bankless Article | The incident is included in an article by Stoppable Finance when comparing bitcoin against Solana[11]. "Bitcoin has had two network outages since its inception"[11]. |
Technical Details
"A block that had a larger number of total transaction inputs than previously seen was mined and broadcasted. Bitcoin 0.8 nodes were able to handle this, but some pre-0.8 Bitcoin nodes rejected it, causing an unexpected fork of the blockchain. The pre-0.8-incompatible chain (from here on, the 0.8 chain) at that point had around 60% of the mining hash power ensuring the split did not automatically resolve (as would have occurred if the pre-0.8 chain outpaced the 0.8 chain in total work, forcing 0.8 nodes to reorganise to the pre-0.8 chain).
In order to restore a canonical chain as soon as possible, BTCGuild and Slush downgraded their Bitcoin 0.8 nodes to 0.7 so their pools would also reject the larger block. This placed majority hashpower on the chain without the larger block, thus eventually causing the 0.8 nodes to reorganise to the pre-0.8 chain."
"During this time there was at least one large double spend. However, it was done by someone experimenting to see if it was possible and was not intended to be malicious."
"Because max-sized blocks had been successfully processed on the testnet, it did not occur to anyone that there could be blocks that were smaller but require more locks than were available. Prior to 0.7 unmodified mining nodes self-imposed a maximum block size of 500,000 bytes, which further prevented this case from being triggered. 0.7 made the target size configurable and miners had been encouraged to increase this target in the week prior to the incident.
Bitcoin 0.8 did not use Berkeley DB. It switched to LevelDB instead, which did not implement the same locking limits as BDB. Therefore it was able to process the forking block successfully.
Note that BDB locks are also required during processing of re-organizations. Versions prior to 0.8 may be unable to process some valid re-orgs."
The transaction, presently invalid based on the current bitcoin blockchain[12][13]:
12814b8ad57ce5654ba69eb26a52ddae1bff42093ca20cef3ad96fe7fd85d195
Payout transaction: https://www.blockchain.com/explorer/transactions/btc/cf7121622d6b208357b2a115cc75a9be283f8996dd7d6f612923b30f600bcadd
gmaxwell answered it: a large majority of mining power switched to running 0.7 -- which meant restarting the miners and clearing their memory pools. With the right dynamics, a rebroadcast would not repropagate because most nodes had not been restarted and would not rebroadcast it. Thus, those miners that restarted, started mining without it, and accepted the double-spend as a first-spend.
Total Amount Lost
The total amount lost has been estimated at $10,000 USD.
Immediate Reactions
Large mining pools BTC Guild and SlushPool reverted their bitcoin clients back to the 0.7 version of the chain and continued to mine on 0.7. This resulted in 0.7 resuming the longest chain.
Ultimate Outcome
The issue was resolved on August 16th, 2013[1] which forked unpatched nodes off the network.
Total Amount Recovered
The total amount recovered has been estimated at $10,000 USD. The individual performing the double spend was not malicious in nature.
Ongoing Developments
This situation meant that older nodes which did not implement that improvement proposal or manually increase their number of supported locks would not be able to validate the bitcoin blockchain.
Individual Prevention Policies
This case does not appear to have resulted in a loss to any individual.
For the full list of how to protect your funds as an individual, check our Prevention Policies for Individuals guide.
Platform Prevention Policies
Policies for platforms to take to prevent this situation have not yet been selected in this case.
For the full list of how to protect your funds as a financial service, check our Prevention Policies for Platforms guide.
Regulatory Prevention Policies
No specific regulatory policies have yet been identified in this case.
For the full list of regulatory policies that can prevent loss, check our Prevention Policies for Regulators guide.
References
- ↑ 1.0 1.1 1.2 1.3 March 2013 Chain Fork Post-Mortem - BIPS.xyz (Accessed Oct 11, 2022)
- ↑ 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 A successful DOUBLE SPEND US$10000 against OKPAY this morning. - BitcoinTalk (Aug 14, 2023)
- ↑ OkPay - "The payment has been successfully completed" - BitcoinTalk (Accessed Mar 13, 2024)
- ↑ Transaction Returning The Funds - Blockchain.com (Accessed Mar 13, 2024)
- ↑ BIP_0050 Original Version From March 20th, 2013 10:34:00 AM MDT - Bitcoin Wiki (Accessed Mar 8, 2024)
- ↑ BIP 0050 Gregory Maxwell Changes - Bitcoin Wiki (Accessed Mar 14, 2024)
- ↑ Randy Brito User Profile - Bitcoin Wiki (Accessed Mar 14, 2024)
- ↑ Randy Brito Broadcasted Change - Bitcoin Wiki (Accessed Mar 14, 2024)
- ↑ Broadcast Versus Broadcasted - Michigan Public (Accessed Mar 14, 2024)
- ↑ ercwl - "$10,000 double-spend against OKPAY as a result of the 2013 LevelDB/BerkeleyDB chainsplit" - Twitter (Accessed Mar 12, 2024)
- ↑ Double Spent Deposit To BTC-E - Blockchain (Accessed Mar 12, 2024)
- ↑ Blockchain Transaction Double-Spent Deposit To BTC-E - Blockchain Archive March 14th, 2013 9:17:20 PM MDT (Accessed Mar 12, 2024)
- ↑ https://bitcointalk.org/index.php?topic=152348.msg1617466#msg1617466 (Accessed Mar 13, 2024)
Cite error: <ref> tag with name "newsletter-11414" defined in <references> is not used in prior text.