2

I have a very basic understanding of how the bitcoin blockchain works and am trying to understand how manipulating transactions in a 51% attack works.

I just watched a video which stated 51% attacks can't steal bitcoins from people's wallets. Is this true?

My understanding is if someone successfully implemented a 51% attack i.e. they created a longer chain than the current chain, then they would most likely have manipulated one or more of the transactions which had been confirmed in the original true bitcoin chain.

I assume the reason they can't steal someone's bitcoin directly from their wallet is because they would be unable to create a transaction to send bitcoin from that person's wallet, as they would need their private key to do that.

That said if for example William had sent 1 bitcoin to Sarah who previously had 0 bitcoin in her wallet. Could they not simply remove that transaction from their new/manipulated chain? This would then mean Sarah no longer has the 1 bitcoin in her wallet effectively stealing that 1 bitcoin from her.

William would still have the 1 bitcoin meaning he could now reuse that 1 bitcoin. I assume this is what they mean by double spend i.e. he can now spend that same 1 bitcoin again.

If this is possible then the blockchain would view Sarah's wallet as having 0 bitcoin. If in a later block Sarah had sent that 1 bitcoin to her friend Helen, then wouldn't that transaction be invalid? If so would this mean the person creating the fake blockchain would have to also remove that invalid transaction?

If that is the case it could presumably create a knock on effect where multiple future transactions are now invalid. Helen's wallet (like Sarah's wallet) could have only contained the 1 bitcoin Sarah had sent her, so if Helen had sent that bitcoin to someone else that transaction would now also be invalid.

1 Answer 1

3

I just watched a video which stated 51% attacks can't steal bitcoins from people's wallets. Is this true?

Yes, 51% attack cannot steal coins controlled by other people's keys. When you sign a transaction with your private key, you include the entire transaction data as a message in the signature hashing algorithm. Thus changing any data within the transaction (output value, address of the receiver etc.) will render the signature invalid and hence the transaction as invalid. An attacker can only make cosmetic changes like signature malleability (S component of signature can be replaced with -S) which can also be done by any other miner or an intermediate node in between that is relaying your transaction.

My understanding is if someone successfully implemented a 51% attack then they would most likely have manipulated one or more of the transactions which had been confirmed in the original true bitcoin chain.

An attacker cannot manipulate transactions as I have stated above. What the attacker can definitely do is exclude the transaction from their version of the chain thus bringing in a censorship attack.

When you read news articles like "attackers stole coins from 51% attack" it does not mean they changed the transaction data. This is how the attack happens: An attacker sends some coins to an exchange. This gets recognized on the Bitcoin blockchain and after that gets reflected in your exchange account. Now on the exchange portal the attacker exchanges BTC for any other coin like say ETH and withdraw the ETH coins from the exchange account to their personal wallet. Now, they launch a 51% attack and create a different version of the Bitcoin blockchain that has excluded that transaction in which they sent the coins to the exchange. After your chain becomes the longest it will be accepted as the main chain. Thus you end up in BTC and the ETH that you got from the exchange. Although I have given the example of Bitcoin, do note that BTC has never experienced a 51% attack.

This would then mean Sarah no longer has the 1 bitcoin in her wallet effectively stealing that 1 bitcoin from her.

Yes, this is the same example I have mentioned above. However, as confirmations on the transactions increases, the more difficult it is for an attacker to exclude transactions. If there are tens of confirmations on the transaction, then reorging with just over 50% hash rate will take days if not weeks. Thus most recent transactions are more vulnerable to the attack than previous ones.

I think rest of your questions follow the similar tone. It is a best practice to wait for 6 confirmations, but if the amount sent is really large enough, it will be prudent to wait for tens if not hundreds of confirmations.

4
  • Thanks for taking the time to answer my questions. Just to be clear though. If there are 3 wallets, A,B,C. Wallet A contains 1 bitcoin and wallets B and C contain 0 bitcoin. In block 100 wallet a transfers it's 1 bitcoin to wallet B. Then 3 blocks later in block 103 wallet B sends the 1 bitcoin to wallet C.
    – Stephen
    Nov 18, 2019 at 8:28
  • If the owner of wallet A now wanted to implement a 51%+ attack to get their 1 bitcoin back (this just for example as it would of course be to costly to do this for just 1 bitcoin) they would need to start their own side chain from block 100 and remove the transaction from that block where their wallet A tranfers 1 bitcoin to wallet B.
    – Stephen
    Nov 18, 2019 at 8:28
  • When they then come to mine block 103 on their side chain i assume the side chain will now view the transaction for wallet B to wallet C as invalid, as wallet B now contains 0 bitcoin thus has no bitcoin to send to wallet C. This means that transaction will also be removed from the side chain. Is this correct?
    – Stephen
    Nov 18, 2019 at 8:29
  • @Stephen yes. you are correct.
    – Ugam Kamat
    Nov 18, 2019 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.