Title: Double slending? Post by: Robertt on February 07, 2016, 12:25:36 PM 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 Title: Re: Double slending? Post by: shorena on February 07, 2016, 12:27:49 PM 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. Title: Re: Double slending? Post by: Robertt on February 07, 2016, 12:33:44 PM 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. Title: Re: Double slending? Post by: shorena on February 07, 2016, 12:45:33 PM 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 You send 0.25 to alice (the (u) marks unconfirmed coins) Code: you alice Alice now sends you 0.26. Code: you alice and the same input to bob (the (c) marks conflicting transactions) Code: you alice bob Now, if the first TX confirms, we have this. Code: you alice bob 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 If the TX from alice to you confirms, bobs 0.26 from alice are invalid and will disappear. Code: you alice bob 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. Title: Re: Double slending? Post by: Robertt on February 07, 2016, 12:49:42 PM 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 You send 0.25 to alice (the (u) marks unconfirmed coins) Code: you alice Alice now sends you 0.26. Code: you alice and the same input to bob (the (c) marks conflicting transactions) Code: you alice bob Now, if the first TX confirms, we have this. Code: you alice bob 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 If the TX from alice to you confirms, bobs 0.26 from alice are invalid and will disappear. Code: you alice bob 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? Title: Re: Double slending? Post by: Alaki on February 07, 2016, 01:03:19 PM Let's say I have 1 Bitcoin. 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.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? 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 Title: Re: Double slending? Post by: shorena on February 07, 2016, 01:09:27 PM -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 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. |