Bitcoin Forum
June 08, 2024, 07:25:13 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Double spend  (Read 656 times)
MadGamer (OP)
Legendary
*
Offline Offline

Activity: 1568
Merit: 1031


View Profile
November 14, 2016, 10:56:06 AM
 #1

On the Bitcoin wiki and Wikipedia I see this :

Double-spending is the result of successfully spending some money more than once. Bitcoin protects against double spending by verifying each transaction added to the block chain to ensure that the inputs for the transaction had not previously already been spent.

If as mentioned above the Bitcoin network is actually protected against the double spending then how come Blockchain.info is listing some double spends from time to time ?
ranochigo
Legendary
*
Offline Offline

Activity: 2982
Merit: 4193



View Profile
November 14, 2016, 11:03:31 AM
Last edit: November 14, 2016, 11:20:17 AM by ranochigo
 #2

A successful doublespend is when [at least] two transactions with conflicting inputs are both included in a block. Blockchain.info displays transactions that has conflicting inputs that are usually unconfirmed. Reference nodes marks an input as spent when they see a transaction that spends it. Even though reference nodes do not relay transactions with conflicting inputs in their mempool, the attacker can relay two conflicting transactions to different nodes at the same time. Both transactions will then be seen by Blockchain.info due to their huge number of connections.

The double spends are usually not successful since miners do not mine transactions with inputs that are spent, double spends are usually not successful. However, there is one occasion when there was a network fork and the network was split[1].

[1] https://bitcointalk.org/index.php?topic=152348.0

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
mocacinno
Legendary
*
Offline Offline

Activity: 3416
Merit: 5008


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
November 14, 2016, 11:05:36 AM
 #3

Once a transaction is added to a block, it's allmost impossible to doublespend the inputs, but as long as the transaction is unconfirmed, it's pretty easy to do so.

My best guess is that the person who wrote the wiki meanth that once your transaction is confirmed, it's protected against double-spending.

A successful doublespend is when two transactions with conflicting inputs are both included in a block.
The way i always understood the concept, double spending means only one of many transactions spending the same inputs is included in a block, the other one is cancelled. This is what makes it dangerous. You think you have received funds from somebody, but a completely different transaction spending the same input is included in a block, and your transaction is cancelled, hence, you are no longer payed.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
MadGamer (OP)
Legendary
*
Offline Offline

Activity: 1568
Merit: 1031


View Profile
November 14, 2016, 11:16:11 AM
 #4

A successful doublespend is when two transactions with conflicting inputs are both included in a block. Blockchain.info displays transactions that has conflicting inputs that are usually unconfirmed. Reference nodes marks an input as spent when they see a transaction that spends it. Even though reference nodes do not relay transactions with conflicting inputs in their mempool, the attacker can relay two conflicting transactions to different nodes at the same time. Both transactions will then be seen by Blockchain.info due to their huge number of connections.

Once a transaction is added to a block, it's allmost impossible to doublespend the inputs, but as long as the transaction is unconfirmed, it's pretty easy to do so.

My best guess is that the person who wrote the wiki meanth that once your transaction is confirmed, it's protected against double-spending.

A successful doublespend is when two transactions with conflicting inputs are both included in a block.
The way i always understood the concept, double spending means only one of many transactions spending the same inputs is included in a block, the other one is cancelled. This is what makes it dangerous. You think you have received funds from somebody, but a completely different transaction spending the same input is included in a block, and your transaction is cancelled, hence, you are no longer payed.

It's now making more sense after you explained it, I assume that's why exchanges and BTC services requires more then one confirmation most of the time ?
mocacinno
Legendary
*
Offline Offline

Activity: 3416
Merit: 5008


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
November 14, 2016, 11:19:26 AM
 #5

It's now making more sense after you explained it, I assume that's why exchanges and BTC services requires more then one confirmation most of the time ?

That is correct. As long as a transaction is unconfirmed, it only exists in the memory of the nodes. An attacker can actually generate a transaction spending input A with a very low fee, and directly afterwards create a second transaction spending input A but with a much larger fee.
Most miners will include the transaction with the larger fee into a block, voiding the first transaction. Only waiting for at least one confirmation will protect a service against this problem.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
ranochigo
Legendary
*
Offline Offline

Activity: 2982
Merit: 4193



View Profile
November 14, 2016, 11:25:28 AM
 #6

It's now making more sense after you explained it, I assume that's why exchanges and BTC services requires more then one confirmation most of the time ?
When a transaction has a confirmation, it means that the transaction is already included in the blockchain and every node will know that the UXTO is spent and a new one is made. Miners and nodes will not include transactions that spend the inputs.

Blocks may become orphaned if a longer valid chain is found, the more confirmations, the lower the chance. If a miner controls 51% of the network's hashrate, the miner can reverse his own confirmed transactions and spend it again.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!