Author

Topic: Double slending? (Read 834 times)

copper member
Activity: 1498
Merit: 1528
No I dont escrow anymore.
February 07, 2016, 08:09:27 AM
#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.
sr. member
Activity: 266
Merit: 250
February 07, 2016, 08:03:19 AM
#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://bitcointalksearch.org/topic/m.13803990
member
Activity: 112
Merit: 10
February 07, 2016, 07:49:42 AM
#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?
copper member
Activity: 1498
Merit: 1528
No I dont escrow anymore.
February 07, 2016, 07:45:33 AM
#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.
member
Activity: 112
Merit: 10
February 07, 2016, 07:33:44 AM
#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.
copper member
Activity: 1498
Merit: 1528
No I dont escrow anymore.
February 07, 2016, 07:27:49 AM
#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.
member
Activity: 112
Merit: 10
February 07, 2016, 07:25:36 AM
#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
Jump to: