Tuesday, December 3, 2019

How Bitcoin Can Be Hacked. One Way to Do it. (Not clickbait)

I refer to this post at https://www.reddit.com/r/ethfinance/comments/e52zyc/vertcoin_network_sabotaged_by_another_51_attack/.

There is something we can learn from this event. Vertcoin is a fork of Bitcoin protocol. So by right, technically, if Vertcoin can be attacked successfully, so can Bitcoin. Although maybe nobody have yet to figure out the way, sometime in the past I have a rough idea on how this can be made possible. While Vertcoin was successfully attacked by way of having more than 50% of its hashing power, the same requirement may not be necessary with Bitcoin, as we understand the longest chain takes precedence to become the main chain. So the question is, how can an attacker successfully reorg the Bitcoin chain cheaply, without having majority hashing power, and still be able to create the longest chain?

Theoretically, I can think of one approach. Here's how I think it is possible.

  1. An attacker (with full node of Bitcoin blockchain for all its historical data) process his mining offline, while continue to maintain the full node online, for most current data feed purpose.
  2. With this offline chain, the attacker possesses 100% of all the hashing power with no competition. Of course, this offline chain will still have all the actual historical record of all Bitcoin transactions details.
  3. With this 100% hashing power, the attacker identifies which block to reorg (no matter how old this block is) and re-mine all the blocks starting from there, offline, for their hashes.
  4. As he is the sole miner in his own offline chain, he will be able to overcome the mining difficulty and obtain all the hashes of all the blocks that will be reorged, up to the latest block.
  5. The attacker proceed to do multiple of his own transactions (offline, of course) beyond the most current transactions that are being done on the online chain, to obtain all the necessary hashes of his transactions.
  6. With all the hashes he found from reorg-ing his offline chain, he returns to the online chain that everyone is in, introduces all the hashes from all the way back to the block he intends to reorg up to the latest, plus further transactions of his own (already done offline, with all the needed hashes), and create the longest chain.

The idea is to take the mining difficulty offline (to make it manageable by eliminating miner competition by being the sole miner), figure out all the hashes of all the reorged blocks, offline, return to online mining, reorg the online chain by introducing all the new hashes found from offline mining to the online chain, and maintain the reorged chain as the longest chain to supplant the actual online Bitcoin blockchain.

Theoretically, with sufficient resource and expertise to do it optimally, the effort to reorg should be cheap, fast, and easy to implement, without the need to possess 51% mining power.

One constraint is that the attacker needs to mine his offline chain concurrently and in parallel with the online chain because he needs to keep track of the latest transaction details committed on the online block, to reorg them offline for the reorged hashes, that he will introduce online.

To be able to mine (or reorg) his offline chain concurrently and in parallel with the online chain, he will need a smart algorithm for that concurrency and parallelism. Such need for concurrency and parallelism is important NOT to reorg the chain, but to successfully supplant the actual online chain with the attacker's own newest transaction blocks for the longest chain.

Why a 51% hashing power is not necessary?

As mining is all about brute force + a lot of good luck, a miner does not necessarily need to have 51% hashing power to successfully mine a block, otherwise all small miners would die out already by now.

All he need is just damn good luck at the right time for that split second advantage (or maybe just 10 minutes minimum) to supplant the actual chain with his reorged chain successfully.

No need to have 51% mining power. And no need to have multi million budget to do it.

Disclaimer: My approach is just a theory.


No comments:

Post a Comment