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 ...
Andrew Chow's user avatar
  • 68.5k
9 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 ...
UTF-8's user avatar
  • 3,224
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 ...
Murch's user avatar
  • 72.6k
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-...
sr_gi's user avatar
  • 3,192
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 ...
RedGrittyBrick's user avatar
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 ...
sanket1729's user avatar
  • 1,296
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 ...
Raghav Sood's user avatar
  • 16.9k
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"). ...
Pieter Wuille's user avatar
6 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 ...
Pieter Wuille's 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 ...
Murch's user avatar
  • 72.6k
6 votes

Why is not good having forks in a blockchain?

if I imagine to work with isolated transactions chained each other according to money flow, then i understand that we wish to have a single chain because forks would mean the presence of double-spend ...
Andrew Chow's user avatar
  • 68.5k
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 ...
Jestin's user avatar
  • 8,822
5 votes

Is "fee higher than block reward" attack possible?

An attack like this is possible, it is just a way to profit off a 51% attack. However you must remember several things: if a miner controls less than 51% of the hashpower, then chances are they will ...
chytrik's user avatar
  • 18k
5 votes
Accepted

What happens to rejected transactions (i.e double spend or invalid transactions)?

Invalid transactions are never included in valid blocks. They can be included in a block, but that block would be rejected as invalid (and not classified as an orphan block).
Andrew Chow's user avatar
  • 68.5k
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 ...
G. Maxwell's user avatar
  • 7,696
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 ...
Pieter Wuille's 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 ...
pinhead's user avatar
  • 4,992
4 votes

double spending

How do nodes bootstrap if some of the nodes are evil? It's actually not that difficult to obtain a very large number of IP addresses. There are botnets that have hundreds of thousands of nodes. ...
Nick ODell's user avatar
  • 29.3k
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 ...
Pieter Wuille's user avatar
4 votes

How do miners detect double-spending?

Yes, they do. Mining software indexes the blockchain database so that lookups like this are relatively quick (that is, they don't have to laboriously search through gigabytes of transactions).
Greg Hewgill's user avatar
  • 3,431
4 votes

What if a pair of double-spent transactions are collected into a new block?

When Alice sends the bitcoin, she spends an Unspent Transaction Output (UTXO) created by a previous transaction. To create a doublespend, she has to use the same UTXO as an input for another ...
Murch's user avatar
  • 72.6k
4 votes

It's possible to spend a BTC without fee to forge a payment?

The simplest protection is to not consider a payment to have been made to you until it receives some number of confirmations. The number can depend on the value of the payment. For small payments, one ...
David Schwartz's user avatar
4 votes

Low fee Electrum wallet transaction disappeared, now when I increase the fee it seems to be rejected as a double spend

I faced a similar issue and found this reddit post quite helpful. I'm not a bitcoin expert but I will write an answer describing what I think is happening, since there are no other answers yet. When ...
dimyG's user avatar
  • 141
4 votes
Accepted

Detecting unconfirmed double spends using bitcoind

bitcoind has a debugging option named mempoolrej. You can enable this by adding debug=mempoolrej to your bitcoin.conf file. This debugging options tells bitcoind to print out information about the ...
Andrew Chow's user avatar
  • 68.5k
4 votes
Accepted

How does Bitcoin protect against doublespends?

No one on the network has a 'balance', they just have the keys to the outputs of previous transactions which they haven't spent yet. At the start, Alice holds the keys to some Unspent Transaction ...
meshcollider's user avatar
  • 11.8k
4 votes
Accepted

Is in-person double-spending attacks negligible on bitcoin payments?

Double spending attacks can certainly happen in person. A customer could have set up a system on a different computer which they remote into on their phone to initiate a double spend attack. However ...
Andrew Chow's user avatar
  • 68.5k
4 votes
Accepted

My blockchain.info wallet was hacked. How can I create a double send to foil the attacker?

So some background as to what happened here. I wanted to claim my bitcoin diamond air drop. I googled and this video came up first. The video played this weird music which I think was hypnotic in ...
Marcus Scipio's user avatar
4 votes

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

So are bitcoins, or the smallest allowable bitcoin fractions, distinctly labeled entities? No, but almost. Bitcoins are literally just a value which is assigned to a script (see Scripts below). ...
JBaczuk's user avatar
  • 7,318
4 votes

Can two or more transactions sent from the same address be mined in the same block in Bitcoin's blockchain?

Will both Bob's transactions be confirmed in the same block? This cannot be guaranteed. They might or might not. consider the case when Bob sends all 10 bitcoins to Alice in one transaction and ...
RedGrittyBrick's user avatar
4 votes

Why is PoW even necessary?

But why is it even necessary since transactions are confirmed only if they contain valid signature? Proof of work is not used for transaction validation. A signature prevents other people stealing ...
meshcollider's user avatar
  • 11.8k

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