Bitcoin Forum
May 07, 2024, 05:09:11 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What happens if double-double spending happens?  (Read 1206 times)
RealBitcoin (OP)
Hero Member
*****
Offline Offline

Activity: 854
Merit: 1007


JAYCE DESIGNS - http://bit.ly/1tmgIwK


View Profile
July 26, 2015, 01:36:24 PM
 #1

What happens at this scenario

1) Wallet A sends 1 BTC to wallet B (before 1 confirm)

2) Wallet A double-sends 1 BTC to wallet C (before 1 confirm)

3) Wallet B sends the 1 BTC to walled D (before 1 confirm)

4) Wallet C sends the 1 BTC to wallet E (before 1 confirm)


Where will the 1 BTC go to? Will it double itself? Where will the destination of the 1 BTC go to, or if multiple destinations then specify please.

I`m just curous what happense in a double-double spend.

1715058551
Hero Member
*
Offline Offline

Posts: 1715058551

View Profile Personal Message (Offline)

Ignore
1715058551
Reply with quote  #2

1715058551
Report to moderator
1715058551
Hero Member
*
Offline Offline

Posts: 1715058551

View Profile Personal Message (Offline)

Ignore
1715058551
Reply with quote  #2

1715058551
Report to moderator
Bitcoin mining is now a specialized and very risky industry, just like gold mining. Amateur miners are unlikely to make much money, and may even lose money. Bitcoin is much more than just mining, though!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
achow101
Staff
Legendary
*
Offline Offline

Activity: 3388
Merit: 6587


Just writing some code


View Profile WWW
July 26, 2015, 01:40:41 PM
 #2

The 1 BTC will go to the transaction that is first confirmed. Most nodes will reject and not relay double spends. They will keep the first one that they see. So, if the first transaction is sent first, it will probably reach most of the network before the second is sent, thus the first transaction will confirm first. It really depends on which transaction reaches which miners first and whichever transaction that the miner who mines the next block includes. It WILL NOT double itself. There will only be 1 BTC spent and the double spent transaction will be dropped after the other is confirmed.

CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1075


Ian Knowles - CIYAM Lead Developer


View Profile WWW
July 26, 2015, 01:45:56 PM
 #3

For some reason it just doesn't seem to "sink in" that "you cannot double-spend Bitcoin at all".

If the Bitcoin system "actually allowed double-spending" then it would be 100% *useless* and would not have ever been known to anyone (as it would have solved *nothing at all*).

What is often called "double-spending" is just a problem of vendors wanting to accept txs before they have been confirmed enough times (the minimum being once although small re-orgs do happen regularly which is why more confirmations are generally recommended).

The blockchain will never accept a "double-spend" and the "best chain" is always the one with the most work so it will be up to the miners to end up deciding which txs are legit or are rejected in such scenarios (but you'll never find one single "double spend" in the history of the current blockchain).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
ezeminer
Legendary
*
Offline Offline

Activity: 2184
Merit: 1118

Lie down. Have a cookie


View Profile
July 26, 2015, 04:56:45 PM
 #4

For some reason it just doesn't seem to "sink in" that "you cannot double-spend Bitcoin at all".

If the Bitcoin system "actually allowed double-spending" then it would be 100% *useless* and would not have ever been known to anyone (as it would have solved *nothing at all*).

What is often called "double-spending" is just a problem of vendors wanting to accept txs before they have been confirmed enough times (the minimum being once although small re-orgs do happen regularly which is why more confirmations are generally recommended).

The blockchain will never accept a "double-spend" and the "best chain" is always the one with the most work so it will be up to the miners to end up deciding which txs are legit or are rejected in such scenarios (but you'll never find one single "double spend" in the history of the current blockchain).


Double-spending can be achieved with a 51% hashrate attack. Meaning a corrupt player can confirm whatever they'd like and control the transactions. That evildoer would have the "Best Chain" and the rest of the network would have to work to beat him.

shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1499


No I dont escrow anymore.


View Profile WWW
July 26, 2015, 05:29:31 PM
 #5

For some reason it just doesn't seem to "sink in" that "you cannot double-spend Bitcoin at all".

If the Bitcoin system "actually allowed double-spending" then it would be 100% *useless* and would not have ever been known to anyone (as it would have solved *nothing at all*).

What is often called "double-spending" is just a problem of vendors wanting to accept txs before they have been confirmed enough times (the minimum being once although small re-orgs do happen regularly which is why more confirmations are generally recommended).

The blockchain will never accept a "double-spend" and the "best chain" is always the one with the most work so it will be up to the miners to end up deciding which txs are legit or are rejected in such scenarios (but you'll never find one single "double spend" in the history of the current blockchain).


Double-spending can be achieved with a 51% hashrate attack.

Nope it only allows you to reverse transactions. There is no way (with the current code) to use a single input in two confirmed(!) transactions.

Im not really here, its just your imagination.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4623



View Profile
July 26, 2015, 05:30:16 PM
 #6

Double-spending can be achieved with a 51% hashrate attack.

No. it can't.

With control over a significant majority of the global hash power, it is possible to choose which VALID transactions get confirmed.  It is NOT possible to confirm two transactions that both spend the same bitcoins (that would be an INVALID transaction). Even with 100% of the hash power double-spending can not be achieved.

Meaning a corrupt player can confirm whatever they'd like and control the transactions.

No.  They can't confirm "whatever they'd like".  They can only confirm VALID transactions. If they attempt to confirm invalid transactions (such as a double spend), then the entire network will ignore their blocks.

That evildoer would have the "Best Chain" and the rest of the network would have to work to beat him.

It isn't enough to have the chain with the most proof of work.  They have to have a VALID chain with the most proof of work.
ezeminer
Legendary
*
Offline Offline

Activity: 2184
Merit: 1118

Lie down. Have a cookie


View Profile
July 26, 2015, 06:12:50 PM
 #7

Double-spending can be achieved with a 51% hashrate attack.

No. it can't.

With control over a significant majority of the global hash power, it is possible to choose which VALID transactions get confirmed.  It is NOT possible to confirm two transactions that both spend the same bitcoins (that would be an INVALID transaction). Even with 100% of the hash power double-spending can not be achieved.

Meaning a corrupt player can confirm whatever they'd like and control the transactions.

No.  They can't confirm "whatever they'd like".  They can only confirm VALID transactions. If they attempt to confirm invalid transactions (such as a double spend), then the entire network will ignore their blocks.

That evildoer would have the "Best Chain" and the rest of the network would have to work to beat him.

It isn't enough to have the chain with the most proof of work.  They have to have a VALID chain with the most proof of work.

Thanks for clearing that up. I need to get my information from better sources..

DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4623



View Profile
July 26, 2015, 07:01:16 PM
 #8

Thanks for clearing that up. I need to get my information from better sources..

Much of the confusion comes from the fact that it has become common to use the words "double spend" to mean something other than an actual double spend.

One of the truly innovative things that was accomplished with the creation of the bitcoin protocol was that it provided a decentralized way to make it impossible to double spend a digital asset. Prior to the creation of bitcoin, it was possible to use a digital signature system to provide a chain of custody proof that control of a digital asset was being transferred from one person to another.  However, it required a centralized "clearing house" to make sure that the digital asset wasn't duplicated and control of multiple copies of it wasn't turned over to multiple recipients.

Without the centralized clearing house, a malevolent entity could make an exact duplicate of the digital asset and then "spend" both copies.  There would be no way to determine which was the "valid" one, and which was the "invalid" copy.  Each recipient would receive an equally "valid" instance of the asset.

The bitcoin protocol uses a blockchain with a proof-of-work to create a public record of which transaction is the "valid" one.  Any other transaction that attempts to transfer control of the asset is "invalid", and this can be determined and proven by everyone that has access to the blockchain.  Nodes do not trust the information they receive. Every full node on the network validates every transaction they ever receive (and reject invalid transactions regardless of where they come from).  Every full node on the network validates every block that is ever receives (and rejects invalid blocks regardless of how much hash power was used to create it).  One of the "rules" of the protocol that is used to determine if a transaction is "valid" is that it cannot spend an input that has already been spent in an earlier block in the blockchain.  One of the "rules" of the protocol that is used to determine if a block is valid is that it cannot include any invalid transactions.

So, with a large enough share of the global hashpower, you could choose which of multiple transactions is the "valid" ONE.  You caould even go back a few blocks and remove a previously "valid" transaction, replacing it with a different transaction that spends the same inputs.  However, at any given time, you could only include ONE transaction in the blockchain that spends any given input, and during the time that any particular transaction is in the blockchain, it is the ONLY valid transaction spending that input.

Therefore, it is impossible for 2 (or more) transactions which both attempt to spend the same input to both be simultaneously in a "confirmed" state.  It will ALWAYS be publicly clear which transaction is the "valid" transaction at that moment.

What CAN happen with enough hash power is theft and fraud.  The entity with control of a large enough percentage of the global hash power could create a transaction to purchase a product or service.  Then they could wait for that transaction to receive enough confirmations for the merchant to feel comfortable providing the product or service.  Then they could go back and unconfirm the original transaction and in its place confirm a new transaction that sends the bitcoins to an address under the thief's control.  As such, they will have taken possession of the product or service without providing the agreed payment.  Although you may frequently hear people mistakenly describe this as a "double-spend" (possibly because there are two different transactions being created), it isn't truly a "double-spend" since the first transaction stops being valid when the replacement transaction is confirmed.

Another thing that can happen is that someone can broad cast multiple unconfirmed transactions that each share the same input. Although only one of these transactions will make it into the blockchain and be confirmed, until that happens it is impossible for the network to know which is the "valid" transaction.  If a merchant is willing to provide a product or service prior to a transaction receiving its first confirmation, then it can be possible to get the merchant to see the unconfirmed transaction that pays their address while getting a significant percentage of the global hash power to see an unconfirmed transaction spending the same input paying the thief's address.  This will occasionally be described as a "double-spend attempt" (since there are two competing transactions that are both "attempting" to be confirmed).  Only one of the two transactions will ever be confirmed though, so it isn't an actual "double-spend".
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!