Bitcoin Forum
December 18, 2017, 07:38:03 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Double spent UTXO combined with valid UTXO  (Read 1024 times)
maarx
Hero Member
*****
Offline Offline

Activity: 546



View Profile
August 31, 2015, 08:24:04 AM
 #1

Hi, what happens if a double spent bitcoin gets merged with a valid bitcoin, and sent as 2 bitcoins to another address?

e.g.

valid_utxo1 +
invalid_utxo2

will it become an invalid transaction? if so, what happens to the original valid bitcoin? will it be assigned a new utxo? will the other address receive 1 bitcoin and not the doublespent one?

So, what is the immediate scenario and what is the scenario after say, 6 blocks?

..C..
.....................
........Finally C is .........
..............
...........            ............
       ............            ............
...................      ....................


1513582683
Hero Member
*
Offline Offline

Posts: 1513582683

View Profile Personal Message (Offline)

Ignore
1513582683
Reply with quote  #2

1513582683
Report to moderator
1513582683
Hero Member
*
Offline Offline

Posts: 1513582683

View Profile Personal Message (Offline)

Ignore
1513582683
Reply with quote  #2

1513582683
Report to moderator
1513582683
Hero Member
*
Offline Offline

Posts: 1513582683

View Profile Personal Message (Offline)

Ignore
1513582683
Reply with quote  #2

1513582683
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1513582683
Hero Member
*
Offline Offline

Posts: 1513582683

View Profile Personal Message (Offline)

Ignore
1513582683
Reply with quote  #2

1513582683
Report to moderator
1513582683
Hero Member
*
Offline Offline

Posts: 1513582683

View Profile Personal Message (Offline)

Ignore
1513582683
Reply with quote  #2

1513582683
Report to moderator
DannyHamilton
Legendary
*
Offline Offline

Activity: 2002



View Profile
August 31, 2015, 12:05:53 PM
 #2

Hi, what happens if a double spent bitcoin gets merged with a valid bitcoin, and sent as 2 bitcoins to another address?

e.g.

valid_utxo1 +
invalid_utxo2

will it become an invalid transaction? if so, what happens to the original valid bitcoin? will it be assigned a new utxo? will the other address receive 1 bitcoin and not the doublespent one?

So, what is the immediate scenario and what is the scenario after say, 6 blocks?

Double-spends don't exist in the blockchain.  They can't.  That's the reason the blockchain exists in the first place.

Perhaps you are talking about two unconfirmed transactions that both spend the same UTXO?

As an example:

To begin with, a wallet has control of 2 valid, confirmed UTXO:
UTXO_A
UTXO_D

Unconfirmed Transaction 1
Spends UTXO_A
Creates UTXO_B

Unconfirmed Transaction 2
Spends UTXO_A
Creates UTXO_C

Transaction 3
Spends unconfirmed UTXO_B and confirmed UTXO_D
Creates UTXO_E

What happens if Transaction 2 is confirmed (and the block it is confirmed in does not get orphaned)?

Transaction 1 then becomes invalid and is dropped from the memory pool of all nodes that receive the block that confirmed Transaction 2.  Essentially, Transaction 1 no longer exists.  If the sender of Transaction 1 tries to re-broadcast the transaction, then all peers will reject the transaction as invalid and will refuse to relay it.

Since transaction 3 is attempting to spend a non-existent output (UTXO_B), it is an invalid transaction.  Any peer that received the block that confirmed Transaction 2 will drop Transaction 3 from their memory pool. If the sender of Transaction 3 tries to re-broadcast the transaction, then all peers will reject the transaction as invalid and will refuse to relay it.

Since the entire network refuses to acknowledge Transaction 3 as valid, it won't be added to any blocks, and will be treated as if it simply doesn't exist.

Therefore UTXO_A remains spent (in Transaction 2), UTXO_C remains unspent and confirmed (in Transaction 2), UTXO_B doesn't exist (because Transaction 1 is invalid), UTXO_D remains unspent (because Transaction 3 is invalid), and UTXO_E doesn't exist (because Transaction 3 is invalid).

unholycactus
Hero Member
*****
Offline Offline

Activity: 980


https://reg-charity.org/


View Profile WWW
August 31, 2015, 02:19:55 PM
 #3

In simple terms, a transaction needs all it's past connected input/output to be confirmed before it can confirm itself. Anything that doesn't confirm correctly will be rejected.

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!