4

In all cases what you are describing is a double-spend. Bitcoin uses a UTXO model (not an account based model) which means that there is a set of coins also known as the UTXO set or Unspent Transaction Output set. Transactions destroy coins and create new coins. A new transaction attempting to spend a coin that has been destroyed is simply invalid. Your ...


4

Then the blochain of the "hacker" will have 1 block more than the others, thus it should be, at least for a few minutes, the "valid" blockchain This is incorrect. A block that contains an invalid transaction is invalid, period. The network's rule is that the longest(*) valid chain is the one to be treated as correct. A chain with any invalid blocks in it ...


3

A will be kicked out of the mempool when that block is received, and getrawtransaction will subsequently fail for it.


3

Yes, both scenarios are possible. The validity of a block is determined solely by its contents, not by when it is broadcast or received, so the attacker's longer chain is equally valid whether they broadcast it as they go, or all at once. (There is an exception to this principle on testnet because of the 20-minute rule, but that's not relevant here.)


2

First, a quick overview of what happens when you submit a transaction to the network: Each node that hears about your transaction will check to see if it is valid according to their view of the network. If it is valid, the node may broadcast the transaction to its peers, and may add the transaction to its local mempool. If it is invalid, the transaction ...


2

If two transactions spend the same coin (utxo) only one is allowed in each node's mempool. That may not be the tx that gets actually confirmed by a miner though and inserted into a block. In that case, the confirmed transaction "evicts" the double-spend from the mempool. It is possible that two competing miners each mine different blocks at the same height ...


2

I heard that the recommended waiting confirmation time for a bitcoin transaction is 6 blocks/ 1 hour. This is the recommendation to be extremely sure that a payment is included in the longest valid chain. This question has more information about that recommendation. Note that even in a non-malicious setting, sometimes two miners will find a block at the ...


2

In Bitcoin, it is recommended that big amount of transactions wait for 6 confirmations and smaller amounts wait for 3 confirmations. When a seller uses bitcoins to sell he must never deliver the product with an unconfirmed tx, because since it is in the mempool it can be modified. Once a new confirmation arrives the safer it will be to deliver the product. ...


2

Firstly, there is no "the mempool". There is no global mempool. Rather each node maintains its own mempool and accepts and rejects transaction to that mempool using their own internal policies. Most nodes have the same policies, but due to different start times, relay delays, and other factors, not every node has the same mempool, although they may ...


1

Many nodes today will not replace any transaction in their mempool with another transaction that spends the same inputs, making it difficult for spenders to adjust their previously-sent transactions to deal with unexpected confirmation delays or to perform other useful replacements. First paragraph of 'Abstract' section in BIP 125 Maybe if the transaction ...


1

An attack that attempts to outpace the mining power of the whole network by itself is called a majority-attack or "51%-attack". Concretely, your example is a doublespend attack by means of a majority attack. When the attacker publishes their chain-tip, each node performs a chain-reorganization to switch to the best chain. Concretely, the blocks B4 ...


1

Each node in the Bitcoin network tracks every single piece of bitcoin. This body is called the "Unspent Transaction Output Set" or UTXO Set for short. Every UTXO is uniquely identifiable and can only be spent once. If two transactions try to spend the same UTXO, only one of the two transactions can become part of the best chain. Including both transactions ...


1

It depends on what you mean by 'double spend'. Spending bitcoin just means using it to buy something. Therefore 'successfully' double spending bitcoin would just mean that you were able to buy something from two different people, even though one (or maybe both) end up being short of the bitcoin they thought they received. The way bitcoin works is that there ...


Only top voted, non community-wiki answers of a minimum length are eligible