Bitcoin Forum
May 24, 2024, 12:47:07 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Double slending?  (Read 808 times)
Robertt (OP)
Member
**
Offline Offline

Activity: 112
Merit: 10


View Profile
February 07, 2016, 12:25:36 PM
 #1

Let's say you have 0.025 BTC.
You give it to someone, and they send you 0.026 BTC.
They double spend it, and you have around 0.5 left in your wallet.
If you send the 0.5 while the other transaction is unconfirmed, what happens to the 0.5?
Just something I've always wondered about
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1520


No I dont escrow anymore.


View Profile WWW
February 07, 2016, 12:27:49 PM
 #2

Let's say you have 0.025 BTC.
You give it to someone, and they send you 0.026 BTC.
They double spend it, and you have around 0.5 left in your wallet.
If you send the 0.5 while the other transaction is unconfirmed, what happens to the 0.5?
Just something I've always wondered about

I doubt the 0.5 would even be a valid transaction, because it requires conflicting inputs. In any way, as soon as once of the competing TX confirms the 0.5 TX is invalid because one of its inputs became invalid.

Im not really here, its just your imagination.
Robertt (OP)
Member
**
Offline Offline

Activity: 112
Merit: 10


View Profile
February 07, 2016, 12:33:44 PM
 #3

Let's say you have 0.025 BTC.
You give it to someone, and they send you 0.026 BTC.
They double spend it, and you have around 0.5 left in your wallet.
If you send the 0.5 while the other transaction is unconfirmed, what happens to the 0.5?
Just something I've always wondered about

I doubt the 0.5 would even be a valid transaction, because it requires conflicting inputs. In any way, as soon as once of the competing TX confirms the 0.5 TX is invalid because one of its inputs became invalid.

So would you eventually get the 0.5 BTC back and lose the 0.026?
Or would you end up with nothing left in your wallet.
Thanks.
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1520


No I dont escrow anymore.


View Profile WWW
February 07, 2016, 12:45:33 PM
 #4

Let's say you have 0.025 BTC.
You give it to someone, and they send you 0.026 BTC.
They double spend it, and you have around 0.5 left in your wallet.
If you send the 0.5 while the other transaction is unconfirmed, what happens to the 0.5?
Just something I've always wondered about

I doubt the 0.5 would even be a valid transaction, because it requires conflicting inputs. In any way, as soon as once of the competing TX confirms the 0.5 TX is invalid because one of its inputs became invalid.

So would you eventually get the 0.5 BTC back and lose the 0.026?
Or would you end up with nothing left in your wallet.
Thanks.

I probably misunderstood where the 0.5 btc came from on my first answer, let me try again.

It depends. Lets say you have a single input of 0.75 BTC and alice has a single input of 0.26

Code:
you	alice
0.75 0.26

You send 0.25 to alice (the (u) marks unconfirmed coins)

Code:
you	alice
0.5(u) 0.26
0.25(u)

Alice now sends you 0.26.

Code:
you	alice
0.26(u) 0.25(u)
0.5(u)

and the same input to bob (the (c) marks conflicting transactions)

Code:
you		alice		bob
0.26(u,c) 0.25(u) 0.26(u,c)
0.5(u)

Now, if the first TX confirms, we have this.

Code:
you		alice		bob
0.26(u,c) 0.25 0.26(u,c)
0.5

If the double spend to bob confirms, your 0.26 from alice are invalid and will disappear (or still show as conflicted/pending depending on your wallet).

Code:
you		alice		bob
0.5 0.25 0.26

If the TX from alice to you confirms, bobs 0.26 from alice are invalid and will disappear.

Code:
you		alice		bob
0.26 0.25 -
0.5

So the 0.5 change is unaffected by alice's double spend. This is also true if the 0.5 was a different input and not created by the TX sending 0.25 to alice.

Im not really here, its just your imagination.
Robertt (OP)
Member
**
Offline Offline

Activity: 112
Merit: 10


View Profile
February 07, 2016, 12:49:42 PM
 #5

Let's say you have 0.025 BTC.
You give it to someone, and they send you 0.026 BTC.
They double spend it, and you have around 0.5 left in your wallet.
If you send the 0.5 while the other transaction is unconfirmed, what happens to the 0.5?
Just something I've always wondered about

I doubt the 0.5 would even be a valid transaction, because it requires conflicting inputs. In any way, as soon as once of the competing TX confirms the 0.5 TX is invalid because one of its inputs became invalid.

So would you eventually get the 0.5 BTC back and lose the 0.026?
Or would you end up with nothing left in your wallet.
Thanks.

I probably misunderstood where the 0.5 btc came from on my first answer, let me try again.

It depends. Lets say you have a single input of 0.75 BTC and alice has a single input of 0.26

Code:
you	alice
0.75 0.26

You send 0.25 to alice (the (u) marks unconfirmed coins)

Code:
you	alice
0.5(u) 0.26
0.25(u)

Alice now sends you 0.26.

Code:
you	alice
0.26(u) 0.25(u)
0.5(u)

and the same input to bob (the (c) marks conflicting transactions)

Code:
you		alice		bob
0.26(u,c) 0.25(u) 0.26(u,c)
0.5(u)

Now, if the first TX confirms, we have this.

Code:
you		alice		bob
0.26(u,c) 0.25 0.26(u,c)
0.5

If the double spend to bob confirms, your 0.26 from alice are invalid and will disappear (or still show as conflicted/pending depending on your wallet).

Code:
you		alice		bob
0.5 0.25 0.26

If the TX from alice to you confirms, bobs 0.26 from alice are invalid and will disappear.

Code:
you		alice		bob
0.26 0.25 -
0.5

Wait.. Sorry I'm not exactly the best with this lol but thanks for trying to explain it
Maybe I could ask the question in another way

Let's say I have 1 Bitcoin.
I then send 0.1 Bitcoin to 1swag
1swag returns 0.2 Bitcoin to me and then does something (double spends?) that doesn't allow it to confirm
I send the 1.1 BTC I have to 1Lol
The 1Lol and the transaction I received are both unconfirmed, but the one I sent confirmed.
What happens to the unconfirmed BTC?
Alaki
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250


View Profile
February 07, 2016, 01:03:19 PM
Last edit: February 07, 2016, 02:31:45 PM by Alaki
 #6

 
Let's say I have 1 Bitcoin.
I then send 0.1 Bitcoin to 1swag
1swag returns 0.2 Bitcoin to me and then does something (double spends?) that doesn't allow it to confirm
I send the 1.1 BTC I have to 1Lol
The 1Lol and the transaction I received are both unconfirmed, but the one I sent confirmed.
What happens to the unconfirmed BTC?
Care to temme(us) about the(your) wallet name? AFAIK, blockchain(I'd guess, you're using blockchain wallet) won't(doesn't) allow you to spend 0.2BTC(u), unless & until they're confirmed.
Let's say 1Swag sends 0.2BTC(u) to you(someone), Therefore, 1.1(t)-0.2(u)= 0.9BTC-fee(spendable)
(u)-> unconfirmed.
(t)-> total.
P.S.-> Other wallets-> https://bitcointalk.org/index.php?topic=1356144.msg13803990#msg13803990
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1520


No I dont escrow anymore.


View Profile WWW
February 07, 2016, 01:09:27 PM
 #7

-snip-
Wait.. Sorry I'm not exactly the best with this lol but thanks for trying to explain it
Maybe I could ask the question in another way

Let's say I have 1 Bitcoin.
I then send 0.1 Bitcoin to 1swag
1swag returns 0.2 Bitcoin to me and then does something (double spends?) that doesn't allow it to confirm
I send the 1.1 BTC I have to 1Lol
The 1Lol and the transaction I received are both unconfirmed, but the one I sent confirmed.
What happens to the unconfirmed BTC?

Code:
you		swag		else
1 0.1 0
--- you send .1 to swag (tx1)
0.9(u) 0.1 0
0.1(u)
--- swag send 0.2 to you (tx2)
0.9(u) 0 0
0.2(u)
--- you send 1.1 to someone else (tx3)
0 0 1.1(u)
0
--- swag also sends 0.2 to alice (tx4)
you swag else alice
0 0 1.1(u,c) 0.2(u,c)

tx2 can only confirm if tx1 is confirmed and tx3 can only confirm if tx1 and tx2 are confirmed.

tx4 can only confirm if tx1 is confirmed.

If tx4 confirms, tx2 and tx3 are invalid, they never happened (you still have 0.9 btc).

If tx3 confirms, tx4 is invalid.

Im not really here, its just your imagination.
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!