14 votes
Accepted

How is a Transaction Output Marked as Spent?

Every full Bitcoin node maintains a database of which unspent outputs are left. When verifying a transaction, all its inputs are fetched from the database. If one is missing, validation fails. Among ...
user avatar
11 votes
Accepted

Does proof-of-work contribute directly to prevent double-spending?

There are multiple definitions of the term "double spending" at play here. First, there is the actual definition of double spending: to spend the same money multiple times. A simple example of this is ...
user avatar
  • 61.4k
10 votes
Accepted

How does BitCoin prevent fraud during confirmation period?

This is definitely a concern, and is the reason why Bitcoin users are encouraged to wait for several confirmations before accepting a transaction and delivering goods. It's not quite as easy as you ...
user avatar
10 votes

Double Spending - Does each node maintain a list of unspent transaction references?

Each full node must maintain a list of all unspent outputs. Currently there are 15 million unspent outputs with a total size of 525 MB. To check whether a new transaction is a double-spend, Bitcoin ...
user avatar
  • 8,694
9 votes
Accepted

Why doesn't bitcoin place additional constraints on competing block chain forks, other than length of chain? (e.g., time and confirmation count)

My question then is: why doesn't bitcoin specify a maximum duration of time and/or a maximum number of confirmations, after which a competing/forking block is rejected even if it's backed by a longer ...
user avatar
  • 28.7k
8 votes

Why doesn't bitcoin place additional constraints on competing block chain forks, other than length of chain? (e.g., time and confirmation count)

First, a quick clarification: assuming two chains both have valid blocks, it's the chain with the most proof of work that wins, not necessarily the chain with the most blocks. Second, thanks for the ...
user avatar
8 votes
Accepted

Understanding a Bitcoin Double Spending Transaction by Performing one on yourself

How to Double Spend You can double spend using Electrum quite easily. Even without duplicating your wallet, be it on the same or on 2 different machines. Btw.: Duplicating wallets is super easy with ...
user avatar
  • 3,154
7 votes

How do miners detect double-spending?

The other two answers explain what has to be done to discover doublespends. I'll try to explain how it works. There are no "balances", there are "coins" A common misunderstanding is that there is a ...
user avatar
  • 63.4k
7 votes
Accepted

Is something gained by double spending myself on a 51% attack?

Double spending is not about doubling, but about using the same UTXO twice. So, you won't gain anything by double spending coins to yourself. Let me explain you, with a simple example, how double-...
user avatar
  • 2,702
7 votes
Accepted

Are bitcoins (or fractions of bitcoins) labeled with IDs?

So are bitcoins, or the smallest allowable bitcoin fractions, distinctly labeled entities? They are unspent amounts (outputs of prior transactions) associated with addresses. Unspent transaction ...
user avatar
6 votes
Accepted

How to minimize risk when accepting zero confirmation payments?

From http://www.cryptocoinsnews.com/news/the-mathematically-secure-way-to-accept-zero-confirmation-transactions/2014/02/13, here is what services like MyCelium and BitPay may be doing: More ...
user avatar
6 votes
Accepted

What exactly happens when a node detects a double spend?

When a node hears about a new transaction, they try to accept it to their in-memory pool of transactions. If a node hears about a transaction that conflicts with one of the transactions that is ...
user avatar
  • 13.7k
6 votes
Accepted

How does SPV prevent double spending of UTXO?

In a bitcoin transaction, A's address is not scanned for spendable Unspent Transaction Outputs (UTXOs). Full nodes simply check if the inputs of the transaction are really unspent. There is no ...
user avatar
  • 1,214
6 votes
Accepted

Single tx included in two different blocks

Occasionally, minor alternate chains emerge if multiple blocks are found for a given blockheight. Usually, these alternate chains only last for a single blocked, and are quickly dropped once another ...
user avatar
  • 16.5k
6 votes
Accepted

Would first-seen prevent a double spend attack?

First of all, what is the goal? The Bitcoin consensus rules already completely eliminate the possibility of an "double spend" within any individual version of history ("chain"). ...
user avatar
6 votes

Why is PoW even necessary?

The problem that Bitcoin solved was the double spending problem. The scenario that causes the double spending problem does not pertain to "miner x" trying to spend Bob's money—he can't ...
user avatar
  • 63.4k
5 votes
Accepted

Could any standard fee transaction be double spent by using a higher fee?

The original design assumes a common behavior of processing the incoming transaction on FIFO basis. That means the first transaction received by a miner wins and all conflicting transactions received ...
user avatar
  • 1,394
5 votes
Accepted

What happens if a miner confirms their own double spend?

Every single Bitcoin node in the network will reject and ignore the block as invalid if there is a double spend in it. The block won't even spread very far, because the peers that first receive it ...
user avatar
  • 2,052
5 votes
Accepted

Is it possible to use Selfish Mining to steal bitcoins?

Selfish Mining cannot be used to change transactions in any way, therefore, it is impossible to steal funds in such fashion. Also, Selfish Mining is somewhat the opposite of Double-Spending, as ...
user avatar
  • 63.4k
5 votes

What can a dishonest node do (or try to do)?

just off the top of my head, here are some things a dishonest miner can do: fail to include one or more transactions in the block. this is not technically 'dishonest', since the protocol does not ...
user avatar
  • 1,693
5 votes

How do miners detect double-spending?

Yes, miners check the blockchain to ensure all new transactions are valid before including them into a block. However, it also depends on your definition of "miner". If you mean the people running ...
user avatar
  • 8,724
5 votes
Accepted

Regarding CVE-2018-17144 and test cases

There are tests for that. The specifically broken pattern was a block containing a single transaction spending the same output, which originated from an earlier block, twice. Testing it without ...
user avatar
  • 7,479
5 votes
Accepted

How does the blockchain prevent spending money during a "short fork"?

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 ...
user avatar
5 votes
Accepted

how does bitcoin solve the same chain replay attack?

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 ...
user avatar
  • 4,676
5 votes
Accepted

What happens if a miner deliberately ignores a transaction, and "wins"?

Miners have complete perogative over what transactions to include. They may include random transactions, the highest fee paying transactions, just their own transactions, or no transactions at all. If ...
user avatar
4 votes

Does using Ripple to accept Bitcoin reduce risk of Bitcoin fraud?

With Bitcoin there are various ways to mitigate the risks and issues you mention to allow some use of payments with zero confirmations instead of waiting for sufficient confirmations to be sure the ...
user avatar
  • 1,754
4 votes

Double spend transactions flag the node as "bad"?

Your current peers can ban (for some time, not forever) your IP-address. Just connect to other nodes in case. The network itself can not do anything with you because there is no such thing in protocol....
user avatar
  • 6,592
4 votes
Accepted

What's the easiest way to someone to double-spend 0-confirmation transactions?

Peter Todd wrote [Replace-By-Fee Tools](https://github.com/petertodd/replace-by-fee-tools ) Basic usage: ./double-spend.py <address> <amount> Creates two transactions in ...
user avatar
  • 26.4k
4 votes
Accepted

Speeding up confirmation by double-spending a transaction stuck in mempool

Yes, it is quite possible to successfully double-spend an unconfirmed transaction. Only about 20% of hash power today strictly mines the first transaction seen. Here is a chart showing the ...
user avatar
4 votes
Accepted

Can a malicious majority miner rewrite history?

Let's assume for a minute that your theory is true, and that actual nodes on the network would not accept this new, valid, and longer block chain. That on itself would be a bug. Maybe it isn't ...
user avatar

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