Bitcoin Forum
May 10, 2024, 03:43:22 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Double spent UTXO combined with valid UTXO  (Read 1131 times)
maarx (OP)
Hero Member
*****
Offline Offline

Activity: 882
Merit: 517


cloverdex.io


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?



























.What is Cloverdex platform?.
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
ANN Thread | Website
Telegram | Twitter
Whitepaper | Reddit
1715355802
Hero Member
*
Offline Offline

Posts: 1715355802

View Profile Personal Message (Offline)

Ignore
1715355802
Reply with quote  #2

1715355802
Report to moderator
1715355802
Hero Member
*
Offline Offline

Posts: 1715355802

View Profile Personal Message (Offline)

Ignore
1715355802
Reply with quote  #2

1715355802
Report to moderator
1715355802
Hero Member
*
Offline Offline

Posts: 1715355802

View Profile Personal Message (Offline)

Ignore
1715355802
Reply with quote  #2

1715355802
Report to moderator
"Bitcoin: mining our own business since 2009" -- Pieter Wuille
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



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
Legendary
*
Offline Offline

Activity: 1078
Merit: 1024



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:  

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