Bitcoin Forum

Other => Beginners & Help => Topic started by: lolx on December 31, 2014, 04:35:05 PM



Title: Double spent
Post by: lolx on December 31, 2014, 04:35:05 PM
i want to know that double spent is actually is ????

 ??? ???


Title: Re: Double spent
Post by: LOBSTER on December 31, 2014, 04:36:17 PM
See here:

https://en.bitcoin.it/wiki/Double-spending


Title: Re: Double spent
Post by: lolx on December 31, 2014, 04:41:22 PM
i did`nt get it !!

for e.g :: if i have 1btc can i double spend ?? means i can use it two times in two trx`s?

but i think if i send 1 btc to someone And the someone send the 1 btc to any one then 1btc will be double spended ??? ??? ??? >:(


Title: Re: Double spent
Post by: LOBSTER on December 31, 2014, 04:54:32 PM
i did`nt get it !!

for e.g :: if i have 1btc can i double spend ?? means i can use it two times in two trx`s?

but i think if i send 1 btc to someone And the someone send the 1 btc to any one then 1btc will be double spended ??? ??? ??? >:(

Theoretically yes, but only one transaction gets a confirmation and the other one will be detected as a double-spend.


Title: Re: Double spent
Post by: lolx on December 31, 2014, 05:04:48 PM
lol then its mean that spend its only once when the other ones send its then it would be recorded as double spend we got nothing :P

i mean if double spend from a same person from same wallet then he get 1btc in prfoit  ??? ???


Title: Re: Double spent
Post by: Amph on December 31, 2014, 06:30:48 PM
you need a 51% attack to do it with a 100% rate

this mean you need to create your own blockchain, mining in in solo mode with a stronger hashrate than the total net, so above 50%


Title: Re: Double spent
Post by: DannyHamilton on December 31, 2014, 07:00:08 PM
A true double spend has never happened and cannot happen.  It is not possible for two different transactions to both include as inputs the same unspent outputs, and for both of those transactions to be permanently recorded in the blockchain.

However, people that don't understand the technical details of how bitcoin works like to use the words "double spend" to describe a variety of scams that allow an attacker to fool their target into believing that they've received bitcoins that they never actually received.

So, if you are asking about a true double spend, then no, it hasn't ever happened.  It never will.

If you are asking about a scam where someone is tricked into believing that they've received bitcoins that they haven't due to the target's own misunderstanding about how bitcoin works, then yes.  That has happened many times.


Title: Re: Double spent
Post by: twister on January 01, 2015, 01:43:28 AM
A true double spend has never happened and cannot happen.  It is not possible for two different transactions to both include as inputs the same unspent outputs, and for both of those transactions to be permanently recorded in the blockchain.

However, people that don't understand the technical details of how bitcoin works like to use the words "double spend" to describe a variety of scams that allow an attacker to fool their target into believing that they've received bitcoins that they never actually received.

So, if you are asking about a true double spend, then no, it hasn't ever happened.  It never will.

If you are asking about a scam where someone is tricked into believing that they've received bitcoins that they haven't due to the target's own misunderstanding about how bitcoin works, then yes.  That has happened many times.

It is really confusing, what are the double spends they show at blockchain?
https://blockchain.info/double-spends


Title: Re: Double spent
Post by: DannyHamilton on January 01, 2015, 01:52:01 AM
It is really confusing, what are the double spends they show at blockchain?
https://blockchain.info/double-spends

These are not true double spends.  In every one of the cases listed at that link, there was never more than one transaction of the transactions that actually made it permanently into the blockchain.

Those are all situations where a previously unspent output was used as an input to one transaction, and then that exact same output was used as an input into the other transaction.  In some cases, both the transactions were seen on the network with zero confirmations at the same time, in other cases the second transaction wasn't transmitted until after the first transaction failed to get confirmed as was already dropped from the memory pool of most peers.

There are legitimate reasons to re-use an unspent output, and as I already mentioned in my previous post in this thread there are fraudulent reasons to do so.  Unless you were either the sender or the receiver of one of the transactions, it is impossible to know which (if any) of these are attempted scams and which occurred for legitimate reasons.



Title: Re: Double spent
Post by: snarlpill on January 01, 2015, 01:54:50 AM

It is really confusing, what are the double spends they show at blockchain?
https://blockchain.info/double-spends

Oh wow, I don't know what to say about those. There's many of them, and all happened recently which means in theory there should be many more.

I know double-spending is not actually possible with Bitcoin, but this may be beyond my level of understanding. DannyHamilton, could you please break this down and explain to me and the beginners that are present? I feel like I'm probably just misunderstanding something here.


EDIT: DannyHamilton's response beat my post asking him for clarification. Well done sir, you are on it and thank you for the detailed explanation!


Title: Re: Double spent
Post by: DannyHamilton on January 01, 2015, 02:05:35 AM

It is really confusing, what are the double spends they show at blockchain?
https://blockchain.info/double-spends

Oh wow, I don't know what to say about those. There's many of them, and all happened recently which means in theory there should be many more.

I know double-spending is not actually possible with Bitcoin, but this may be beyond my level of understanding. DannyHamilton, could you please break this down and explain to me and the beginners that are present? I feel like I'm probably just misunderstanding something here.

Understanding what you are seeing at that link requires a pretty good technical knowledge about exactly how bitcoin transactions work.  These are technical situations involving transaction inputs and outputs.

As a simple example though...

If you create a transaction that sends a very small amount of bitcoins (for example 0.00001 BTC) and you don't include a transaction fee with your transaction...
Or if you create a very large (in bytes, not in bitcoins) transaction (such as 5000 bytes) and you don't include a transaction fee with your transaction...

You might discover after several days that no miners have bothered to confirm your transaction yet.  Therefore, your transaction is still "unconfirmed" several days after you sent it.

Transactions that do not get confirmed take up space in the memory pool of peers.  Those peers want to use that space in their memory pool for transactions that actually have a chance of getting confirmed eventually.  Therefore, peers will start dropping unconfirmed transactions that are a few days old from their memory pool.  Eventually most of the network forgets that the transaction ever existed, and the bitcoins are once again available for you to send from your wallet (since they never actually got where they were going).  Some wallets will simply re-transmit the original transaction repeatedly forever waiting for it to confirm.  However, some wallets (such as blockchain.info/wallet) will return the bitcoins to your balance and allow you to create a new transaction with the bitcoins.

If you create a new transaction (perhaps sending the exact same amount to the exact same person as before, only this time with a transaction fee), then blockchain.info will see that a new (different) transaction is re-using the same bitcoins that they saw in the earlier transaction that never confirmed.  Blockchain.into will label this as a "double spend" since it saw the same bitcoins in two slightly different transactions, and they will add it to that linked web page.

There are more complex situations where this can occur, and it relies on exactly which outputs are being spent in the transactions, but as a user level explanation that's a pretty good example.


Title: Re: Double spent
Post by: twister on January 01, 2015, 04:39:48 AM
It is really confusing, what are the double spends they show at blockchain?
https://blockchain.info/double-spends

These are not true double spends.  In every one of the cases listed at that link, there was never more than one transaction of the transactions that actually made it permanently into the blockchain.

Those are all situations where a previously unspent output was used as an input to one transaction, and then that exact same output was used as an input into the other transaction.  In some cases, both the transactions were seen on the network with zero confirmations at the same time, in other cases the second transaction wasn't transmitted until after the first transaction failed to get confirmed as was already dropped from the memory pool of most peers.

There are legitimate reasons to re-use an unspent output, and as I already mentioned in my previous post in this thread there are fraudulent reasons to do so.  Unless you were either the sender or the receiver of one of the transactions, it is impossible to know which (if any) of these are attempted scams and which occurred for legitimate reasons.



So these were merely an attempt at double spends but only 1 of those Tx was confirmed, right? And other one was rejected.

But Blockchain saw 2 tx from same unspent outputs and called it double spends but they weren't actually any double spends?


Title: Re: Double spent
Post by: Somekindabitcoin on January 01, 2015, 04:42:33 AM
How about Altcoin double spends (ex: Rubycoin).


Title: Re: Double spent
Post by: CIYAM on January 01, 2015, 04:46:00 AM
So these were merely an attempt at double spends but only 1 of those Tx was confirmed, right? And other one was rejected.

Yes - it would be better if they (blockchain.info) used the term "double spend attempt" (as that is far more technically correct).

Note that even that description is perhaps a little "emotionally loaded" as in fact it may just be someone who made a genuine *mistake* by omitting a fee trying to resend with an appropriate fee (currently a "replace with proper fee" is not supported).

Thus the existence of two such txs doesn't imply that someone is actually trying to cheat someone else at all (but if you have received funds in such a manner of course it would be better to be aware of the situation than not - although as has been pointed out accepting 0 confirmations is never a very good idea).

As far as alt coins go - any blockchain that doesn't prevent double spends is *useless* so even if they don't use the same consensus method as Bitcoin one would assume they don't allow "actual double spends".


Title: Re: Double spent
Post by: twister on January 01, 2015, 04:57:40 AM
So these were merely an attempt at double spends but only 1 of those Tx was confirmed, right? And other one was rejected.

Yes - it would be better if they (blockchain.info) used the term "double spend attempt" (as that is far more technically correct).

Note that even that description is perhaps a little "emotionally loaded" as in fact it may just be someone who made a genuine *mistake* by omitting a fee trying to resend with an appropriate fee (currently a "replace with proper fee" is not supported).

Thus the existence of two such txs doesn't imply that someone is actually trying to cheat someone else at all (but if you have received funds in such a manner of course it would be better to be aware of the situation than not - although as has been pointed out accepting 0 confirmations is never a very good idea).

As far as alt coins go - any blockchain that doesn't prevent double spends is *useless* so even if they don't use the same consensus method as Bitcoin one would assume they don't allow "actual double spends".


Yeah, it portrays to the general audience that there are so many double spends happening with bitcoin and gives the impression that maybe it's unsafe. When it's not actually true.



Title: Re: Double spent
Post by: Domino on January 01, 2015, 11:51:45 AM

It is really confusing, what are the double spends they show at blockchain?
https://blockchain.info/double-spends

Oh wow, I don't know what to say about those. There's many of them, and all happened recently which means in theory there should be many more.

I know double-spending is not actually possible with Bitcoin, but this may be beyond my level of understanding. DannyHamilton, could you please break this down and explain to me and the beginners that are present? I feel like I'm probably just misunderstanding something here.

Understanding what you are seeing at that link requires a pretty good technical knowledge about exactly how bitcoin transactions work.  These are technical situations involving transaction inputs and outputs.

As a simple example though...

If you create a transaction that sends a very small amount of bitcoins (for example 0.00001 BTC) and you don't include a transaction fee with your transaction...
Or if you create a very large (in bytes, not in bitcoins) transaction (such as 5000 bytes) and you don't include a transaction fee with your transaction...

You might discover after several days that no miners have bothered to confirm your transaction yet.  Therefore, your transaction is still "unconfirmed" several days after you sent it.

Transactions that do not get confirmed take up space in the memory pool of peers.  Those peers want to use that space in their memory pool for transactions that actually have a chance of getting confirmed eventually.  Therefore, peers will start dropping unconfirmed transactions that are a few days old from their memory pool.  Eventually most of the network forgets that the transaction ever existed, and the bitcoins are once again available for you to send from your wallet (since they never actually got where they were going).  Some wallets will simply re-transmit the original transaction repeatedly forever waiting for it to confirm.  However, some wallets (such as blockchain.info/wallet) will return the bitcoins to your balance and allow you to create a new transaction with the bitcoins.

If you create a new transaction (perhaps sending the exact same amount to the exact same person as before, only this time with a transaction fee), then blockchain.info will see that a new (different) transaction is re-using the same bitcoins that they saw in the earlier transaction that never confirmed.  Blockchain.into will label this as a "double spend" since it saw the same bitcoins in two slightly different transactions, and they will add it to that linked web page.

There are more complex situations where this can occur, and it relies on exactly which outputs are being spent in the transactions, but as a user level explanation that's a pretty good example.

Before the unconfirmed transaction is dropped, how will the peers handle the new double-spent-attempt transaction? Will they replace the old one with the new one? Or will they reject the new one?

Is there any way to "speed up" the process of peers dropping an unconfirmed transaction with 0 fee? Or we can just wait patiently for a few days?


Title: Re: Double spent
Post by: redsn0w on January 01, 2015, 11:55:28 AM
A double spend implies that one of the two  transactions will be "refused"  or maybe I don't understand how it works (maybe I'm wrong).


Title: Re: Double spent
Post by: LOBSTER on January 01, 2015, 12:18:07 PM
A double spend implies that one of the two  transactions will be "refused"  or maybe I don't understand how it works (maybe I'm wrong).

No you are quite right. If you have 1BTC in your wallet and you send it ~2 times (2x1BTC), only one transaction gets confirmed.


Title: Re: Double spent
Post by: CIYAM on January 01, 2015, 12:21:53 PM
A double spend implies that one of the two  transactions will be "refused"  or maybe I don't understand how it works (maybe I'm wrong).

Yes - you are not wrong - this is why it is really more correctly described as a "double spend attempt" as blockchains do not allow "double spends" (if they did then they would be absolutely useless in performing the very job they were created for).

@Domino - There is no way to "speed up the process" currently. If a method to "replace a tx that has insufficient fees with one that has sufficient fees" is worked out and adopted by the majority of nodes then this would be the solution (for now you just have to wait).


Title: Re: Double spent
Post by: LOBSTER on January 01, 2015, 12:22:49 PM
A double spend implies that one of the two  transactions will be "refused"  or maybe I don't understand how it works (maybe I'm wrong).

Correct - this is why it is really more correctly a "double spend attempt" as blockchains do not allow "double spends" (if they did then they would be absolutely useless in performing the very job they were created for).

@Domino - There is no way to "speed up the process" currently. If a method to "replace a tx that has insufficient fees with one that has sufficient fees" is worked out and adopted by the majority of nodes then this would be the solution (for now you just have to wait).


Speed up which process? You can send a transaction with a higher fee to get a faster confirmation.


Title: Re: Double spent
Post by: CIYAM on January 01, 2015, 12:24:19 PM
Speed up which process? You can send a transaction with a higher fee to get a faster confirmation.

No you can't (maybe some certain nodes running non-standard software might do this but just try it yourself using say blockchain.info to see that you can't do what you suggest).

(note that we are talking about using the "same UTXOs as part of a different tx" not just creating a completely different tx using different UTXOs)

All nodes running the standard Satoshi software will simply reject any attempt to "double spend" so any "replacement tx" would have to wait until the first tx has been dropped from the memory pool of each node.


Title: Re: Double spent
Post by: LOBSTER on January 01, 2015, 12:26:18 PM
Speed up which process? You can send a transaction with a higher fee to get a faster confirmation.

No you can't (maybe some certain nodes running non-standard software might do this but just try it yourself using say blockchain.info to see that you can't do what you suggest).


Example: if I send a transaction with zero fees to another address and I get no confirmation, I can repeat the transaction by sending it's again with a fee. This is what I meant ;)  Am I right?  ???


Title: Re: Double spent
Post by: redsn0w on January 01, 2015, 12:27:33 PM
....
No you are quite right. If you have 1BTC in your wallet and you send it ~2 times (2x1BTC), only one transaction gets confirmed.

....
Yes - you are not wrong - this is why it is really more correctly described as a "double spend attempt" as blockchains do not allow "double spends" (if they did then they would be absolutely useless in performing the very job they were created for).
...

Ok ,  I understand. Maybe they "should" change the page name  in "double spend attempt"  as you told in your post.


Title: Re: Double spent
Post by: CIYAM on January 01, 2015, 12:28:57 PM
Example: if I send a transaction with zero fees to another address and I get no confirmation, I can repeat the transaction by sending it's again with a fee. This is what I meant ;)  Am I right?  ???

Okay - it depends upon the actual tx. If you have insufficient fees for the tx to be "valid" then sure you can repeat with a "valid tx". But if your tx is "valid" (but just has no or a very low fee) then it will be propagated but may not get included in a block before it is removed from each node's memory pool.


Title: Re: Double spent
Post by: sgk on January 01, 2015, 12:30:03 PM
This was a known case of a successful double-spend:
https://bitcointalk.org/index.php?topic=152348.0

The event took place during a planned hard fork of the protocol.  If we feel it necessary to fork the code again (and we likely will), I think it would be wise for exchanges to require a full day of confirmations for large deposits.  Once it is clear that the fork was handled properly, services can reduce the confirmation requirements back to normal.


Title: Re: Double spent
Post by: CIYAM on January 01, 2015, 12:34:07 PM
This was a known case of a successful double-spend:
https://bitcointalk.org/index.php?topic=152348.0

Again - the word "double-spend" is not technically correct as far as the blockchain goes.

There has never been (and never will be) an actual "double spend" in any blockchain worth using.

If an exchange decides to give you say USD after X commits then they are taking the risk that X commits is "safe enough" but in reality Bitcoin can actually re-org all the way back to the last checkpoint (which could be hundreds or even thousands of blocks).

If I was selling a house for BTC I certainly would not be using 6 confirmations (more likely I would require hundreds if not thousands).


Title: Re: Double spent
Post by: LOBSTER on January 01, 2015, 12:40:06 PM
This was a known case of a successful double-spend:
https://bitcointalk.org/index.php?topic=152348.0

Again - the word "double-spend" is not technically correct as far as the blockchain goes.

There has never been (and never will be) an actual "double spend" in any blockchain worth using.

If an exchange decides to give you say USD after X commits then they are taking the risk that X commits is "safe enough" but in reality Bitcoin can actually re-org all the way back to the last checkpoint (which could be hundreds or even thousands of blocks).

If I was selling a house for BTC I certainly would not be using 6 confirmations (more likely I would require hundreds if not thousands).


https://blockchain.info/de/double-spends :-\ :-X


Title: Re: Double spent
Post by: CIYAM on January 01, 2015, 12:44:47 PM
https://blockchain.info/de/double-spends :-\ :-X

I don't grok German - and again - just because bitcoin.info insists upon using the incorrect term "double spend" doesn't somehow make it correct.

Unfortunately Ben (the guy who *is* blockchain.info) doesn't listen to other people and therefore doesn't fix up fundamental things like that (and even worse doesn't get proper reviewing done of the wallet code which led to people nearly losing around 1000 BTC recently).


Title: Re: Double spent
Post by: LOBSTER on January 01, 2015, 12:45:51 PM
https://blockchain.info/de/double-spends :-\ :-X

I don't grok German - and again - just because bitcoin.info insists upon using the incorrect term "double spend" doesn't somehow make it correct.

Unfortunately Ben (the guy who *is* blockchain.info) doesn't listen to other people and therefore doesn't fix up fundamental mistakes like that (and even worse mistakes that led to people losing a lot of BTC with their wallet implementation).


Then here: https://blockchain.info/en/double-spends



Title: Re: Double spent
Post by: CIYAM on January 01, 2015, 12:48:05 PM
Then here: https://blockchain.info/en/double-spends

So he adds a "disclaimer" but sticks to the "alarmist double-spend" term. Unfortunately most users are going to be alarmed rather than click further to be informed.


Title: Re: Double spent
Post by: LOBSTER on January 01, 2015, 12:49:50 PM
Then here: https://blockchain.info/en/double-spends

So he adds a "disclaimer" but sticks to the "alarmist double-spend" term. Unfortunately most users are going to be alarmed rather than click further to be informed.


Double spends on this page may be unintentional. In the event that a double spend is maliciously crafted being listed on this page is no indication that it was successful or any merchant or user lost money as a result.

(Quote from Blockchain)


Title: Re: Double spent
Post by: CIYAM on January 01, 2015, 12:50:29 PM
Double spends on this page may be unintentional. In the event that a double spend is maliciously crafted being listed on this page is no indication that it was successful or any merchant or user lost money as a result.

Yes - I read that - did you read my reply?

So he adds a "disclaimer" but sticks to the "alarmist double-spend" term. Unfortunately most users are going to be alarmed rather than click further to be informed.

I am not sure whether there is a "perfect term" but "double-spend attempt" would at least be far more technically accurate.

When it comes down to it explaining the details is something that most people unfortunately are going to pay about as much attention to as they do all the fine print in their credit card contract or the like.

So if they use the term "double spend" then that will sink in just like the term "charge back" does.


Title: Re: Double spent
Post by: twister on January 02, 2015, 03:45:37 AM
This was a known case of a successful double-spend:
https://bitcointalk.org/index.php?topic=152348.0

The event took place during a planned hard fork of the protocol.  If we feel it necessary to fork the code again (and we likely will), I think it would be wise for exchanges to require a full day of confirmations for large deposits.  Once it is clear that the fork was handled properly, services can reduce the confirmation requirements back to normal.

Again, I don't think this was a double spend, someone got scammed maybe because they didn't wait for confirmations on a Tx and the sender made another Tx with the same unspent output as Danny already explained before. I think this is what happened here.


Title: Re: Double spent
Post by: CIYAM on January 02, 2015, 03:54:30 AM
Again, I don't think this was a double spend

You can be a *lot more confident* than that.

There *was no double spend* as *you simply cannot double spend* because otherwise Bitcoin would have *no point to exist*.


Title: Re: Double spent
Post by: Somekindabitcoin on January 02, 2015, 08:48:44 PM
Basically, it's a major flaw when it comes to 0 confirm systems.


Title: Re: Double spent
Post by: lolx on January 03, 2015, 05:43:00 AM
there`s no way to double spend btc


Title: Re: Double spent
Post by: Ingatqhvq on January 03, 2015, 08:46:34 AM
i want to know that double spent is actually is ????

 ??? ???
It means you can spent your money twice.


Title: Re: Double spent
Post by: Buziss on January 03, 2015, 10:39:54 AM
This was a known case of a successful double-spend:
https://bitcointalk.org/index.php?topic=152348.0

The event took place during a planned hard fork of the protocol.  If we feel it necessary to fork the code again (and we likely will), I think it would be wise for exchanges to require a full day of confirmations for large deposits.  Once it is clear that the fork was handled properly, services can reduce the confirmation requirements back to normal.

Again, I don't think this was a double spend, someone got scammed maybe because they didn't wait for confirmations on a Tx and the sender made another Tx with the same unspent output as Danny already explained before. I think this is what happened here.

CMIIW, that incident has nothing to do with 0-confirmation transaction but caused by the hard fork. It happened because the merchant was on the "wrong" fork, and the transaction was confirmed only on the "wrong" fork.


Title: Re: Double spent
Post by: lolx on January 16, 2015, 10:48:13 AM
i want to know that double spent is actually is ????

 ??? ???
It means you can spent your money twice.

ahan !! tell me how i can spent my money twice tell me :) :P :D getting naughty :P?