calkob (OP)
|
|
February 25, 2016, 09:49:20 PM |
|
Last night i was at a local Bitcoin meetup and a question was asked about how does bitcoin stop a double spend between blocks. In other words what stops alice from sending 10 BTC to 10 people when she only has 1 BTC, during the 10 mins to find a block? Is it simply the nodes know that she only had 1 and so reject the transaction? The answer that was given wasnt really that good and i think was even more confusing. it actually confused me and i thought i understood this. Could someone please explain in laymans terms so that i can explain it myself in future
|
|
|
|
Lauda
Legendary
Offline
Activity: 2674
Merit: 2965
Terminated.
|
|
February 25, 2016, 09:55:16 PM |
|
She can't 'double spend' between blocks. Technically she could but this is really hard to do as soon as the transaction has a single confirmation. Do you mean unconfirmed transactions? You should not generally accept 0-conf transactions unless the amount is negligible or you trust the other party. There are a few known types of attacks in regards to double spends. This image might also be useful for your general understanding.
|
"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" 😼 Bitcoin Core ( onion)
|
|
|
calkob (OP)
|
|
February 25, 2016, 10:11:57 PM |
|
She can't 'double spend' between blocks. Technically she could but this is really hard to do as soon as the transaction has a single confirmation. Do you mean unconfirmed transactions? You should not generally accept 0-conf transactions unless the amount is negligible or you trust the other party. There are a few known types of attacks in regards to double spends. This image might also be useful for your general understanding. So if she can't double spend between blocks what is stopping her from doing that? is it the wallet that wont allow her to send more than she has? edit: i am talking about a confirmed 1 BTC in her wallet what stops her sending it 10 times. is it the fact that all other nodes know she only has 1 BTC?
|
|
|
|
achow101
Staff
Legendary
Offline
Activity: 3542
Merit: 6885
Just writing some code
|
|
February 25, 2016, 10:14:36 PM |
|
She can't 'double spend' between blocks. Technically she could but this is really hard to do as soon as the transaction has a single confirmation. Do you mean unconfirmed transactions? You should not generally accept 0-conf transactions unless the amount is negligible or you trust the other party. There are a few known types of attacks in regards to double spends. This image might also be useful for your general understanding. So if she can't double spend between blocks what is stopping her from doing that? is it the wallet that wont allow her to send more than she has? The double spends are spending inputs that are already spent. It is entirely possible for her to create 10 transactions that spend the same input and send the Bitcoin to 10 different people. However, the consensus rules allow only one of those transactions to be confirmed and thus committed to permanent history. Any transaction that spend off of the other rejected transactions would forever remain unconfirmed and thus susceptible to being impermanent.
|
|
|
|
Lauda
Legendary
Offline
Activity: 2674
Merit: 2965
Terminated.
|
|
February 25, 2016, 10:21:55 PM |
|
The double spends are spending inputs that are already spent. It is entirely possible for her to create 10 transactions that spend the same input and send the Bitcoin to 10 different people. However, the consensus rules allow only one of those transactions to be confirmed and thus committed to permanent history. Any transaction that spend off of the other rejected transactions would forever remain unconfirmed and thus susceptible to being impermanent.
In simpler wording: As long as the transactions are unconfirmed you are able to send the same money to several people. However, once it settles only a single person will have actually received the coins. So if she can't double spend between blocks what is stopping her from doing that? is it the wallet that wont allow her to send more than she has?
What I was talking about is a transaction that already has a confirmation (which is what I understood from your post). It seems like this is not the case with your question. I am talking about a confirmed 1BTC in her wallet what stops her sending it 10 times. is it the fact that all other nodes know she only has 1BTC?
Technically nothing, however this is not that 'easy' to do, especially if you are an average user.
|
"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" 😼 Bitcoin Core ( onion)
|
|
|
calkob (OP)
|
|
February 25, 2016, 10:26:08 PM |
|
The double spends are spending inputs that are already spent. It is entirely possible for her to create 10 transactions that spend the same input and send the Bitcoin to 10 different people. However, the consensus rules allow only one of those transactions to be confirmed and thus committed to permanent history. Any transaction that spend off of the other rejected transactions would forever remain unconfirmed and thus susceptible to being impermanent.
In simpler wording: As long as the transactions are unconfirmed you are able to send the same money to several people. However, once it settles only a single person will have actually received the coins. So if she can't double spend between blocks what is stopping her from doing that? is it the wallet that wont allow her to send more than she has?
What I was talking about is a transaction that already has a confirmation (which is what I understood from your post). It seems like this is not the case with your question. I am talking about a confirmed 1BTC in her wallet what stops her sending it 10 times. is it the fact that all other nodes know she only has 1BTC?
Technically nothing, however this is not that 'easy' to do, especially if you are an average user. Thanks for the replies Just outa interest how would this sorta thing be done then, is it command line stuff, because a bitcoin wallet wont let you create multiple transactions for bitcoin that you don't own,
|
|
|
|
achow101
Staff
Legendary
Offline
Activity: 3542
Merit: 6885
Just writing some code
|
|
February 25, 2016, 10:29:00 PM |
|
Thanks for the replies Just outa interest how would this sorta thing be done then, is it command line stuff, because a bitcoin wallet wont let you create multiple transactions for bitcoin that you don't own, Some poorly written software will allow you to double spend. Other times a person can write custom software to do double spends. You can also manually create double spends through command line stuff. Or you can trick wallets into creating double spends by making them clear the unconfirmed transactions so that it "forgot" that you already spent an input.
|
|
|
|
AgentofCoin
Legendary
Offline
Activity: 1092
Merit: 1001
|
|
February 25, 2016, 10:37:38 PM |
|
Thanks for the replies Just outa interest how would this sorta thing be done then, is it command line stuff, because a bitcoin wallet wont let you create multiple transactions for bitcoin that you don't own, Some poorly written software will allow you to double spend. Other times a person can write custom software to do double spends. You can also manually create double spends through command line stuff. Or you can trick wallets into creating double spends by making them clear the unconfirmed transactions so that it "forgot" that you already spent an input. I just like to point out to OP that there has never been a successful double-spend. You may be able to send the same output txs twice, but only one will be confirmed and the other denied. Thus, the BTC is only actually spent once. A double-spend in when both are successful and if that happened successfully would mean Bitcoin is very broken.
|
I support a decentralized & unregulatable ledger first, with safe scaling over time. Request a signed message if you are associating with anyone claiming to be me.
|
|
|
Lauda
Legendary
Offline
Activity: 2674
Merit: 2965
Terminated.
|
|
February 25, 2016, 10:44:44 PM |
|
I just like to point out to OP that there has never been a successful double-spend.
Wrong. It is possible to double spend 0-conf transactions and there have been cases of this. In addition to a double spend during a hard fork in 2013. There are probably more cases. A double-spend in when both are successful and if that happened successfully would mean Bitcoin is very broken.
No. Double-spending is the result of successfully spending some money more than once. It has nothing to do with "both being successful (confirmations)".
|
"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" 😼 Bitcoin Core ( onion)
|
|
|
calkob (OP)
|
|
February 25, 2016, 10:45:57 PM |
|
Thanks for the replies Just outa interest how would this sorta thing be done then, is it command line stuff, because a bitcoin wallet wont let you create multiple transactions for bitcoin that you don't own, Some poorly written software will allow you to double spend. Other times a person can write custom software to do double spends. You can also manually create double spends through command line stuff. Or you can trick wallets into creating double spends by making them clear the unconfirmed transactions so that it "forgot" that you already spent an input. I just like to point out to OP that there has never been a successful double-spend. You may be able to send the same output txs twice, but only one will be confirmed and the other denied. Thus, the BTC is only actually spent once. A double-spend in when both are successful and if that happened successfully would mean Bitcoin is very broken. Yeah i knew that, thanks tho it was really to try and get a better understanding so i could answer questions about it to newbies. thanks all
|
|
|
|
AgentofCoin
Legendary
Offline
Activity: 1092
Merit: 1001
|
|
February 26, 2016, 01:08:25 AM |
|
I just like to point out to OP that there has never been a successful double-spend.
Wrong. It is possible to double spend 0-conf transactions and there have been cases of this. In addition to a double spend during a hard fork in 2013. There are probably more cases. A double-spend in when both are successful and if that happened successfully would mean Bitcoin is very broken.
No. Double-spending is the result of successfully spending some money more than once. It has nothing to do with "both being successful (confirmations)". My comment should have been read in its whole, not as separate parts. I was referring to double-spends with both txs being confirmed. I don't see double-spends prior to a single confirmation being a "successful" double-spend. There are potentially thousands of double-spend attempts a day. Peter Todd even made a program that's only purpose is to double-spend very easily. I think a "successful double-spend" comes when the blockchain accepts both tx as valid spends. Which would also be the end of the Bitcoin experiment. Satoshi designed the blockchain to prevent actual double-spending of coins. So, in that light, I still stand behind my original post.
|
I support a decentralized & unregulatable ledger first, with safe scaling over time. Request a signed message if you are associating with anyone claiming to be me.
|
|
|
shorena
Copper Member
Legendary
Offline
Activity: 1498
Merit: 1540
No I dont escrow anymore.
|
|
February 26, 2016, 09:33:07 AM |
|
I just like to point out to OP that there has never been a successful double-spend.
Wrong. It is possible to double spend 0-conf transactions and there have been cases of this. In addition to a double spend during a hard fork in 2013. There are probably more cases. A double-spend in when both are successful and if that happened successfully would mean Bitcoin is very broken.
No. Double-spending is the result of successfully spending some money more than once. It has nothing to do with "both being successful (confirmations)". My comment should have been read in its whole, not as separate parts. I was referring to double-spends with both txs being confirmed. I don't see double-spends prior to a single confirmation being a "successful" double-spend. There are potentially thousands of double-spend attempts a day. Peter Todd even made a program that's only purpose is to double-spend very easily. I think a "successful double-spend" comes when the blockchain accepts both tx as valid spends. Which would also be the end of the Bitcoin experiment. Satoshi designed the blockchain to prevent actual double-spending of coins. So, in that light, I still stand behind my original post. In that case there will never be one, because indeed bitcoin was designed to avoid double spends like you define them. The other kind is still a thing, hence people call them "double spend" even though they are not under a stricter definition of the term. Im not entirely sure what your intention here is, but it does not help understanding the issue if you come around the corner with a different definition other than the one that is commonly accepted. OP specifically asked about unconfirmed transactions (note the "between the blocks").
|
Im not really here, its just your imagination.
|
|
|
AgentofCoin
Legendary
Offline
Activity: 1092
Merit: 1001
|
|
February 26, 2016, 04:32:35 PM |
|
In that case there will never be one, because indeed bitcoin was designed to avoid double spends like you define them. The other kind is still a thing, hence people call them "double spend" even though they are not under a stricter definition of the term. Im not entirely sure what your intention here is, but it does not help understanding the issue if you come around the corner with a different definition other than the one that is commonly accepted. OP specifically asked about unconfirmed transactions (note the "between the blocks"). The following is my understanding, the basis for my above statement, and may be incorrect. When Satoshi and other earlier designers of digital currencies worried about "double-spending" in their systems, I was under the assumption they were referring to an actual duplication of the digital currency in a standard transaction. Satoshi overcame this long lasting problem of duping in other systems, by creating the blockchain system. As a result, when an attempt at a double-spend occurs, it can't be considered a true or successful "double-spending" as before because only one of the spends will ever be valid, in the Bitcoin system. Before Bitcoin, there were two valid spends, aka a "double-spend". Prior to the blockchain, a double-spend's definition was the actual duping of the money. Now, you are saying the commonly accepted double-spend's definition seems to be only when anyone pushs the same outputs twice. According to the bitcoin wiki: https://en.bitcoin.it/wiki/Double-spendingBitcoin protects against double spending by verifying each transaction added to the block chain to ensure that the inputs for the transaction had not previously already been spent. By the above explanation, I assumed when "Bitcoin protects against double spending" it was in regards to my definition. When the explanation uses the term "double spending", I think the context is with my definition. Either I'm very wrong or giving this too much thought.
|
I support a decentralized & unregulatable ledger first, with safe scaling over time. Request a signed message if you are associating with anyone claiming to be me.
|
|
|
achow101
Staff
Legendary
Offline
Activity: 3542
Merit: 6885
Just writing some code
|
|
February 26, 2016, 05:30:05 PM |
|
In that case there will never be one, because indeed bitcoin was designed to avoid double spends like you define them. The other kind is still a thing, hence people call them "double spend" even though they are not under a stricter definition of the term. Im not entirely sure what your intention here is, but it does not help understanding the issue if you come around the corner with a different definition other than the one that is commonly accepted. OP specifically asked about unconfirmed transactions (note the "between the blocks"). The following is my understanding, the basis for my above statement, and may be incorrect. When Satoshi and other earlier designers of digital currencies worried about "double-spending" in their systems, I was under the assumption they were referring to an actual duplication of the digital currency in a standard transaction. Satoshi overcame this long lasting problem of duping in other systems, by creating the blockchain system. As a result, when an attempt at a double-spend occurs, it can't be considered a true or successful "double-spending" as before because only one of the spends will ever be valid, in the Bitcoin system. Before Bitcoin, there were two valid spends, aka a "double-spend". Prior to the blockchain, a double-spend's definition was the actual duping of the money. Now, you are saying the commonly accepted double-spend's definition seems to be only when anyone pushs the same outputs twice. According to the bitcoin wiki: https://en.bitcoin.it/wiki/Double-spendingBitcoin protects against double spending by verifying each transaction added to the block chain to ensure that the inputs for the transaction had not previously already been spent. By the above explanation, I assumed when "Bitcoin protects against double spending" it was in regards to my definition. When the explanation uses the term "double spending", I think the context is with my definition. Either I'm very wrong or giving this too much thought. In bitcoin, it is impossible to double spend in the conventional definition of the term. However the new definition of the term in the context of bitcoin is any transaction which spends the same inputs of any transaction that has already been broadcasted.
|
|
|
|
AgentofCoin
Legendary
Offline
Activity: 1092
Merit: 1001
|
|
February 26, 2016, 06:47:20 PM Last edit: February 26, 2016, 06:59:06 PM by AgentofCoin |
|
The following is my understanding, the basis for my above statement, and may be incorrect. When Satoshi and other earlier designers of digital currencies worried about "double-spending" in their systems, I was under the assumption they were referring to an actual duplication of the digital currency in a standard transaction. Satoshi overcame this long lasting problem of duping in other systems, by creating the blockchain system. As a result, when an attempt at a double-spend occurs, it can't be considered a true or successful "double-spending" as before because only one of the spends will ever be valid, in the Bitcoin system. Before Bitcoin, there were two valid spends, aka a "double-spend". Prior to the blockchain, a double-spend's definition was the actual duping of the money. Now, you are saying the commonly accepted double-spend's definition seems to be only when anyone pushs the same outputs twice. According to the bitcoin wiki: https://en.bitcoin.it/wiki/Double-spendingBitcoin protects against double spending by verifying each transaction added to the block chain to ensure that the inputs for the transaction had not previously already been spent. By the above explanation, I assumed when "Bitcoin protects against double spending" it was in regards to my definition. When the explanation uses the term "double spending", I think the context is with my definition. Either I'm very wrong or giving this too much thought. In bitcoin, it is impossible to double spend in the conventional definition of the term. However the new definition of the term in the context of bitcoin is any transaction which spends the same inputs of any transaction that has already been broadcasted. OK, well I don't claim to be a Bitcoin expert, I only came upon Bitcoin in Late 2013. My understanding comes from what I have read previously. Maybe the bitcoin wiki page should be made more clear then. To me, it seems to use the term "double spend" incorrectly at times when trying to define it. It makes it seem Bitcoin "prevents" double spending, when according to the new definition, Bitcoin actually allows "double spending", but only one spend will be prevented from being confirmed. Is there a place online where a glossary of official terms for Bitcoin is available? Like what a "spend" is actually defined as. Edit: fixed typo and added the word "official terms"
|
I support a decentralized & unregulatable ledger first, with safe scaling over time. Request a signed message if you are associating with anyone claiming to be me.
|
|
|
achow101
Staff
Legendary
Offline
Activity: 3542
Merit: 6885
Just writing some code
|
|
February 26, 2016, 08:43:00 PM |
|
OK, well I don't claim to be a Bitcoin expert, I only came upon Bitcoin in Late 2013. My understanding comes from what I have read previously.
Maybe the bitcoin wiki page should be made more clear then.
To me, it seems to use the term "double spend" incorrectly at times when trying to define it. It makes it seem Bitcoin "prevents" double spending, when according to the new definition, Bitcoin actually allows "double spending", but only one spend will be prevented from being confirmed.
Is there a place online where a glossary of official terms for Bitcoin is available? Like what a "spend" is actually defined as.
Edit: fixed typo and added the word "official terms"
Here is a glossary: https://bitcoin.org/en/developer-glossary. It defines a double spend as A transaction that spends the same input as spent in another transaction.
|
|
|
|
cjmoles
Legendary
Offline
Activity: 1176
Merit: 1017
|
|
February 26, 2016, 11:00:05 PM |
|
The way I've always thought of it is that a "spend" is not considered a spend until it is published on the ledger. If it is broadcast but not confirmed then it is only a "promise to pay" and nothing more until it is published. One should never accept a zero confirmation broadcast as a valid payment until it is published as a confirmed transaction in the ledger. Do we have a consensus here?
|
|
|
|
shorena
Copper Member
Legendary
Offline
Activity: 1498
Merit: 1540
No I dont escrow anymore.
|
|
February 27, 2016, 12:44:20 AM |
|
The following is my understanding, the basis for my above statement, and may be incorrect. When Satoshi and other earlier designers of digital currencies worried about "double-spending" in their systems, I was under the assumption they were referring to an actual duplication of the digital currency in a standard transaction. Satoshi overcame this long lasting problem of duping in other systems, by creating the blockchain system. As a result, when an attempt at a double-spend occurs, it can't be considered a true or successful "double-spending" as before because only one of the spends will ever be valid, in the Bitcoin system. Before Bitcoin, there were two valid spends, aka a "double-spend". Prior to the blockchain, a double-spend's definition was the actual duping of the money. Now, you are saying the commonly accepted double-spend's definition seems to be only when anyone pushs the same outputs twice. According to the bitcoin wiki: https://en.bitcoin.it/wiki/Double-spendingBitcoin protects against double spending by verifying each transaction added to the block chain to ensure that the inputs for the transaction had not previously already been spent. By the above explanation, I assumed when "Bitcoin protects against double spending" it was in regards to my definition. When the explanation uses the term "double spending", I think the context is with my definition. Either I'm very wrong or giving this too much thought. In bitcoin, it is impossible to double spend in the conventional definition of the term. However the new definition of the term in the context of bitcoin is any transaction which spends the same inputs of any transaction that has already been broadcasted. OK, well I don't claim to be a Bitcoin expert, I only came upon Bitcoin in Late 2013. My understanding comes from what I have read previously. Maybe the bitcoin wiki page should be made more clear then. To me, it seems to use the term "double spend" incorrectly at times when trying to define it. It makes it seem Bitcoin "prevents" double spending, when according to the new definition, Bitcoin actually allows "double spending", but only one spend will be prevented from being confirmed. Is there a place online where a glossary of official terms for Bitcoin is available? Like what a "spend" is actually defined as. Edit: fixed typo and added the word "official terms"I think the wiki is fine and so is it to use "double spend" in a difference sense or with a different understanding and context. Hence my remark towards the context in which the question was asked. I think OP is aware that a traditional double spend is impossible with bitcoin. The way I've always thought of it is that a "spend" is not considered a spend until it is published on the ledger. If it is broadcast but not confirmed then it is only a "promise to pay" and nothing more until it is published. One should never accept a zero confirmation broadcast as a valid payment until it is published as a confirmed transaction in the ledger. Do we have a consensus here?
Well as someone that runs a full node I can take this "promise to pay" (me or someone else) and keep rebroadcasting it until it is indeed confirmed. Under certain circumstances I do accept 0-conf payments as paid, e.g. when I know my end of the deal requires some hours to pass and Im confident the TX will confirm. All that nit picking aside, yes I think we can agree that a bitcoin payment is only done once it has at least one confirmation. A "double promise" sounds clunky though.
|
Im not really here, its just your imagination.
|
|
|
AgentofCoin
Legendary
Offline
Activity: 1092
Merit: 1001
|
|
February 27, 2016, 01:00:43 AM |
|
The way I've always thought of it is that a "spend" is not considered a spend until it is published on the ledger. If it is broadcast but not confirmed then it is only a "promise to pay" and nothing more until it is published. One should never accept a zero confirmation broadcast as a valid payment until it is published as a confirmed transaction in the ledger. Do we have a consensus here?
Lol. I don't know anything anymore, but I think from the prior comments above of double-spending (especially the definition knightdk provided me from the Bitcoin.org Developers glossary), your definition of "spend" would not be correct as well. So I'm guessing there will be no consensus here, lol. Even though in general I agree with your reasoning, I think the counter argument is as follows: A "spend" is not when a tx has at least a single confirmation, but is any tx that is broadcasted. This interpretation of "spend" does not change whether it is in a block or still pending in the mempool. So according to this definition of "spend", it could really be considered a "push" and could be used interchangeably. So in Bitcoin, when we are talking about "double-spending", we really mean "double-pushing", but call it "double-spending" anyway. Lol.
|
I support a decentralized & unregulatable ledger first, with safe scaling over time. Request a signed message if you are associating with anyone claiming to be me.
|
|
|
cjmoles
Legendary
Offline
Activity: 1176
Merit: 1017
|
|
February 27, 2016, 02:08:34 AM Last edit: February 27, 2016, 02:30:32 AM by cjmoles |
|
The way I've always thought of it is that a "spend" is not considered a spend until it is published on the ledger. If it is broadcast but not confirmed then it is only a "promise to pay" and nothing more until it is published. One should never accept a zero confirmation broadcast as a valid payment until it is published as a confirmed transaction in the ledger. Do we have a consensus here?
Lol. I don't know anything anymore, but I think from the prior comments above of double-spending (especially the definition knightdk provided me from the Bitcoin.org Developers glossary), your definition of "spend" would not be correct as well. So I'm guessing there will be no consensus here, lol. Even though in general I agree with your reasoning, I think the counter argument is as follows: A "spend" is not when a tx has at least a single confirmation, but is any tx that is broadcasted. This interpretation of "spend" does not change whether it is in a block or still pending in the mempool. So according to this definition of "spend", it could really be considered a "push" and could be used interchangeably. So in Bitcoin, when we are talking about "double-spending", we really mean "double-pushing", but call it "double-spending" anyway. Lol. Smile...No consensus? But, it's just a minor semantic technicality! I can understand the lack of consensus here because I can imagine a scenario such as this: I participate in a Meetup at a local coffee shop, carry the tab for the group, transmit the transaction with the very minimal transaction fee, wait around for awhile for the delayed transaction, and then leave before it's confirmed. While I'm out, I then somehow rebroadcast that same coin to myself with a much higher transaction fee. I did receive the coffee and donuts for the transaction, so that situation would technically qualify as a "spend" although the transaction I broadcast to myself ended up receiving the first confirmations. Therefore, that would have to qualify as "double spend" by your understanding. Right?
|
|
|
|
|