Bitcoin Forum
May 02, 2024, 03:57:10 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Double spend solution?  (Read 2411 times)
Itskok (OP)
Jr. Member
*
Offline Offline

Activity: 54
Merit: 4


View Profile
October 05, 2016, 05:47:54 AM
Merited by ABCbits (1)
 #1

Hi.
I was wondering what is the most up to date solution for the famous "Double spend" problem?
Is there any solution (commercial company development even..) that reduce the transaction waiting approval time?

I read lot of paper's and suggestions during the years about that but it seems that most of them was just nice academic theories , I think that each industry (Exchanges/Gambling/Miners..) adopt here own and personal solution, the most relevant thing I found for now is the Blockcypher Confidence Factor API:
https://www.blockcypher.com/dev/bitcoin/#confidence-factor

I am working on something of my own for this :
https://riders.io/

Although that as a "personal" Bitcoin user this problem has never bothered me at all, I really trust the network, even with a low fees,
But as a business I believe its a total different story.

Thank you.
Each block is stacked on top of the previous one. Adding another block to the top makes all lower blocks more difficult to remove: there is more "weight" above each block. A transaction in a block 6 blocks deep (6 confirmations) will be very difficult to remove.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714622230
Hero Member
*
Offline Offline

Posts: 1714622230

View Profile Personal Message (Offline)

Ignore
1714622230
Reply with quote  #2

1714622230
Report to moderator
altcoinhosting
Hero Member
*****
Offline Offline

Activity: 896
Merit: 1005


View Profile
October 05, 2016, 05:55:49 AM
 #2

The only real sollution is for the sender to add enough fees, and for the receiver to wait at least for 1 confirmation (preferably more). AFAIK, there are no alternative sollutions, the network allows you to broadcast as many transactions as you want, re-using the same inputs. The miners are free to pick any of those transactions, and once the input is used in a transaction that was included in a block, the other transactions using the same input are cancelled...

achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6571


Just writing some code


View Profile WWW
October 05, 2016, 12:25:47 PM
Merited by ABCbits (3)
 #3

The solution is to analyze the transaction and determine how likely the transaction is going to confirm in the a few blocks. Generally you should look at the size of the transaction (a large transaction may be less likely to get into a block), the transaction fee per byte, the outputs (for dust outputs), whether the inputs are confirmed, and whether it signals Opt-in RBF. By examining these, you should be able to decide whether you think that transaction will confirm and whether you should accept it. If it opts-into RBF or spends unconfirmed inputs, you should wait for at least 1 confirmation as that transaction could be replaced.

X7
Legendary
*
Offline Offline

Activity: 1162
Merit: 1009


Let he who is without sin cast the first stone


View Profile
October 07, 2016, 04:16:01 AM
 #4

Hi.
I was wondering what is the most up to date solution for the famous "Double spend" problem?
Is there any solution (commercial company development even..) that reduce the transaction waiting approval time?

I read lot of paper's and suggestions during the years about that but it seems that most of them was just nice academic theories , I think that each industry (Exchanges/Gambling/Miners..) adopt here own and personal solution, the most relevant thing I found for now is the Blockcypher Confidence Factor API:
https://www.blockcypher.com/dev/bitcoin/#confidence-factor

I am working on something of my own for this :
https://riders.io/

Although that as a "personal" Bitcoin user this problem has never bothered me at all, I really trust the network, even with a low fees,
But as a business I believe its a total different story.

Thank you.

Simple solution would be to wait for confirmations (at least 2)

For what shall it profit a man, if he shall gain the world, and lose his own soul?
skang
Sr. Member
****
Offline Offline

Activity: 452
Merit: 252


from democracy to self-rule.


View Profile
October 07, 2016, 05:58:13 AM
Merited by ABCbits (1)
 #5

Although that as a "personal" Bitcoin user this problem has never bothered me at all, I really trust the network, even with a low fees,
But as a business I believe its a total different story.

You should not do that. Do not trust unconfirmed transactions, the bitcoin network doesn't ask for or promise you, that trust.

"India is the guru of the nations, the physician of the human soul in its profounder maladies; she is destined once more to remould the life of the world and restore the peace of the human spirit.
But Swaraj is the necessary condition of her work and before she can do the work, she must fulfil the condition."
NLNico
Legendary
*
hacker
Offline Offline

Activity: 1876
Merit: 1289


DiceSites.com owner


View Profile WWW
October 07, 2016, 06:08:53 AM
 #6

There is a solution for the double spend problem, it's called the blockchain.

amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
October 07, 2016, 10:48:12 AM
 #7

There is a solution for the double spend problem, it's called the blockchain.
does any blockchain solves it?
or you are talking about bitcoin blockchain?  Grin
NLNico
Legendary
*
hacker
Offline Offline

Activity: 1876
Merit: 1289


DiceSites.com owner


View Profile WWW
October 07, 2016, 04:46:22 PM
 #8

Well the blockchain does refer to the most secure one, so yes, the bitcoin blockchain Tongue

TBH I think theories/techniques of guessing the risk of 0-confirmed transaction are interesting too, so I am sorry to make such an obvious statement Sad

But in reality (one of?) the biggest problem(s) bitcoin organically solved is the double-spend problem and the solution is really the blockchain.




Of course if anyone wants to accept 0-conf TXs based on risk/reward.. that's up to them. For gambling sites I know plenty of sites have been scammed and changed it to 1-conf, so only few sites accept 0-conf (to be fair, for example Luckybit has a pretty good record on that though.)

Itskok (OP)
Jr. Member
*
Offline Offline

Activity: 54
Merit: 4


View Profile
October 07, 2016, 05:09:28 PM
 #9

The solution is to analyze the transaction and determine how likely the transaction is going to confirm in the a few blocks. Generally you should look at the size of the transaction (a large transaction may be less likely to get into a block), the transaction fee per byte, the outputs (for dust outputs), whether the inputs are confirmed, and whether it signals Opt-in RBF. By examining these, you should be able to decide whether you think that transaction will confirm and whether you should accept it. If it opts-into RBF or spends unconfirmed inputs, you should wait for at least 1 confirmation as that transaction could be replaced.

This is exactly what I am trying to do, not just analyzing the Nodes in real time, also analyzing the input's "history",
But it seems that not too much change from this days :
https://bitcointalk.org/index.php?topic=3441.msg48365#msg48365
Maybe its too complicated, or maybe there is not enough double spend transaction out there? what is sure is that the "Double spend" issue is one of the biggest barriers for Bitcoin to be adopted by "regular" payments companies/Financial institutions, Its 10 minutes Bitcoin against 0.08 mil second Visa.. they are really afraid from it as far as I spoke with some of them.
Someone know where I can find "All time" statistics about double spend transactions?




Simple solution would be to wait for confirmations (at least 2)

I afraid this is not enough, we need to wait for 4-5 to be sure, and that's gonna take 5-6 minutes at least, that's a lot of time for a digital money,
Maybe some Block-scale will solve that during the years too.
NLNico
Legendary
*
hacker
Offline Offline

Activity: 1876
Merit: 1289


DiceSites.com owner


View Profile WWW
October 07, 2016, 05:32:13 PM
Merited by ABCbits (2)
 #10

what is sure is that the "Double spend" issue is one of the biggest barriers for Bitcoin to be adopted by "regular" payments companies/Financial institutions, Its 10 minutes Bitcoin against 0.08 mil second Visa..
Technically this isn't correct. Bitcoin transaction can be seen almost instantly, but can be reversed within ~10 minutes after it. Visa transactions can be seen almost instantly, but can be reversed within several months after it.

You could argue that making a double spend is easier than having a stolen/fake visa and I would agree. But then again, it's all about target usage + risk/reward. For an online order with real delivery, knowing 100% sure in 10-20 minutes is probably still better than knowing (let's say) 99% in 0 minutes (but still 99% after a week.) You won't deliver the product in 10 minutes anyway.

For some use-cases, like buying an expensive item in a real-life store (where you don't want to wait 1 min - 2 hours for confirmation), perhaps bitcoin isn't the ideal payment system. That's okay, you don't need to use bitcoin for everything.

they are really afraid from it as far as I spoke with some of them ... Maybe some Block-scale will solve that during the years too.

That is true. Most likely there will be layer 2 solutions like Lightning Network that will allow accepting instant-transactions with much more confidence.

DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4613



View Profile
October 07, 2016, 06:00:41 PM
 #11

This is exactly what I am trying to do, not just analyzing the Nodes in real time, also analyzing the input's "history",

Great.  So, you check to make sure the transaction paid a reasonable transaction fee, that the inputs are all already confirmed, that there are no excessively small output or unusual output scripts, and that there are no competing transactions being broadcast by other nodes on the network. Once you've verified all that the transaction is safer to accept than cash, check, or credit card (all of which can be used fraudulently).  What's the problem?

But it seems that not too much change from this days :
https://bitcointalk.org/index.php?topic=3441.msg48365#msg48365

Actually several things have changed.  For example, back then transactions would make it into the next block even if they didn't include a transaction fee.  Now confirmations take a LOT longer if you don't include a transaction fee.  Also, some miners are now reluctant to confirm transactions that have excessively small value outputs.

Maybe its too complicated,

Nope.  Pretty simple.  Check inputs, check outputs, check for fees and competing transactions.  That's it.

or maybe there is not enough double spend transaction out there?

They are difficult to do, so they aren't common.  Credit card fraud, check fraud, and counterfeit cash are all probably more common than Bitcoin double spends. Perhaps businesses should think about not accepting credit cards and cash since there is such a risk?  Bitcoin would be much safer.

what is sure is that the "Double spend" issue is one of the biggest barriers for Bitcoin to be adopted by "regular" payments companies/Financial institutions,

Only among those businesses that are too uneducated or unknowledgable to understand risk management and are incapable of comparing the bitcoin risks to the risks associated with the other payment systems that they accept.

Its 10 minutes Bitcoin against 0.08 mil second Visa..

Nope.  Visa transactions can be double-spent for more than 3 months easier than bitcoin can be double-spent in 1 second.
 
they are really afraid from it as far as I spoke with some of them.

Then they don't understand it, and you've done a poor job of educating them.

Someone know where I can find "All time" statistics about double spend transactions?

There is no "Bitcoin Company" in charge of bitcoin.  Who would you ask for the information?  I'm not aware of anyone making any attempts to record all the fraudulent double-spend attempts or how many of them were successful.  You'll probably need to hire a polling company to do a scientific poll for you.  You could try contacting Coinbase or BitPay and see if they have any internal records they'd be willing to share with you.

we need to wait for 4-5 to be sure

What?  Why would you be any more sure with 4 confirmations than 2?  What's so magical about the number 4?

that's gonna take 5-6 minutes at least, that's a lot of time for a digital money,

You aren't very good at maths, are you?  If the average time between blocks is 10 minutes, and you want to wait for 4 blocks, it's going to take a LOT more than 6 minutes (on average).  Fortunately, you don't need to wait that long in most cases.

Maybe some Block-scale will solve that during the years too.

Not sure what you're trying to say there.
Itskok (OP)
Jr. Member
*
Offline Offline

Activity: 54
Merit: 4


View Profile
October 07, 2016, 07:30:27 PM
 #12



Then they don't understand it, and you've done a poor job of educating them.

As you say,they didn't estimated yet the risks well enough because lack of knowledge, for big organizations adopting new "open source" technology that no one is responsible for Its a process of years.



There is no "Bitcoin Company" in charge of bitcoin.  Who would you ask for the information?  I'm not aware of anyone making any attempts to record all the fraudulent double-spend attempts or how many of them were successful.  You'll probably need to hire a polling company to do a scientific poll for you.  You could try contacting Coinbase or BitPay and see if they have any internal records they'd be willing to share with you.

There are a lot of analysis tool around the web , like :
https://blockchain.info/double-spends
So maybe there are more specific ones that I am not aware of.



What?  Why would you be any more sure with 4 confirmations than 2?  What's so magical about the number 4?

Maybe I am wrong, but there is a (small) probability that a possible attacker would "hire" couple of miners to "mine" the double spent transaction before the "real" transaction will broadcast to all the network , having 4+ miners who collect that transaction is less likely.(its not must be 4..)
Its a theory, very hard to apply it.
https://eprint.iacr.org/2012/248.pdf



You aren't very good at maths, are you?  If the average time between blocks is 10 minutes, and you want to wait for 4 blocks, it's going to take a LOT more than 6 minutes (on average).  Fortunately, you don't need to wait that long in most cases.

From the 100+ transactions I did,  I never wait more then 10-15 minutes for 4+ confirmations, only when I add very low fee, or even without fee at all..
(I was wrong, its maybe not 5-6 minutes..)



Not sure what you're trying to say there.

That having a bigger block will reduce the wait time because there is more "space" for new transactions,
Its also depends on how the new block size will be synchronized with the miners interactions.   


Thank you.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4613



View Profile
October 07, 2016, 08:16:48 PM
Merited by ABCbits (4)
 #13

There are a lot of analysis tool around the web , like :
https://blockchain.info/double-spends
So maybe there are more specific ones that I am not aware of.


There is nothing at blockchain.info that differentiates between "double-spends" that are an attempt at fraud, and "double-spends" that are simply unconfirmed transactions that get re-sent.

I'm not aware of anyone that has put any effort to carefully determine how many fraudulent double-spend attempts there are. I suppose someone could question all the large businesses that handle many transactions (such as Coinbase and BitPay) and attempt to report some actual statistics, but I haven't seen anything like that published.

Maybe I am wrong, but there is a (small) probability that a possible attacker would "hire" couple of miners to "mine" the double spent transaction before the "real" transaction will broadcast to all the network, having 4+ miners who collect that transaction is less likely.

Confirmations have nothing to do with the number of miners.  It is the number of blocks.  1 miner (with enough hash power) can mine 10 blocks in a row, and 10,000 miners could work for years and not mine a single block (if they don't have enough hash power).

If they paid a small amount of money to miner that only has a small amount of hashpower, then the block will almost certainly be solved by someone else.  If they want to pay someone that has a LOT of hashpower, then they will need to pay a LOT of money (potentially more money than they are trying to steal).  Furthermore, as soon as the first block is solved with 1 of the two double-spend transactions, then victim will immediately know about the fraud.  There is no need to wait for additional confirmations.  Convincing a miner to throw away their chance at a 12.5 BTC block reward to try and mine a competing block would require the attacker to pay MORE THAN 12.5 BTC for every block that is solved while the attacking miner continues to try.  So, if the attacker wants the miner to stop trying to mine legitimate blocks and instead try to replace a block until 4 blocks have been solved, then the attacker is going to need to replace the 50 BTC worth of revenue that the miner is potentially foregoing.  All without a guarantee that the miner will even succeed.

This doesn't make any sense.  Why would an attacker pay a miner 50 BTC to try and steal 0.1 BTC from a merchant?

From the 100+ transactions I did,  I never wait more then 10-15 minutes for 4+ confirmations, only when I add very low fee, or even without fee at all..
(I was wrong, its maybe not 5-6 minutes..)


You weren't paying very good attention to the time.

On average, it will take 40 minutes to get 4 confirmations.  If you only did a few transactions, then you might get lucky and get 4 confirmations faster than usual.  In that case you might see that your transactions get 4 confirmations in less than 20 minutes.  However, you claim to have 100+ transactions, and in that case you either weren't paying attention or are lying.

That having a bigger block will reduce the wait time because there is more "space" for new transactions,
Its also depends on how the new block size will be synchronized with the miners interactions.


Bigger blocks don't result in faster blocks.  It will still take an average of 10 minutes for each block to be solved.  This means that, on average, transactions will remain unconfirmed for 10 minutes (or more if they pay an insufficient fee), and that once a transaction gets its first confirmation, it will take an average of 10 minutes more for each additional confirmation.
gatra
Hero Member
*****
Offline Offline

Activity: 583
Merit: 505


CTO @ Flixxo, Riecoin dev


View Profile WWW
October 08, 2016, 03:50:01 AM
 #14

you may want to read about replace by fee

http://bitcoin.stackexchange.com/questions/10733/what-is-replace-by-fee



Also, the average time per block is not 10 minutes. It would be if difficulty were constant. But difficulty is growing because the average is less than 10. Somewhere between 8 and 9 minutes (which is still far from what Itskok suggested)


           ▄▄▄██████████▄▄▄
       ▄▄██
██████████████████▄▄
     ▄█
█████▀████████████▀██████▄
   ▄█
█████████████████████████████▄
  ▄█
█████████▄█▀▀██████████████████▄
 ▄█
███████████▀██████▄▄█████▄███████▄
▄█
██████████▀██▄▄▄▄██▀▀▀▀▀███████████▄
█████████████▀▀██▀████████▀▀████████
█████████████▄█▀████████████████████
████████▀▀▀▀██▀▀▀▀██████████████████
▀█
██████▀▀▀▀██▀▀▀▀███████████████████▀
 ▀█
███████▄████▄▄███████████████████▀
  ▀█
███████████████████████████████▀
   ▀█
█████████████████████████████▀
     ▀█
█████▄████████████▄██████▀
       ▀▀██
██████████████████▀▀
           ▀▀▀██████████▀▀▀
riecoin       ▄▄█████████▄▄
    ▄██▀▀         ▀▀██▄
  ▄██▀              ▀██▄
 ▄██     ██▄▄          ██▄
▄██      █████▄▄        ██▄
██       ████████▄▄      ██
██       ███████████▄    ██
██       ██████████▀     ██
▀██      ███████▀       ██▀
 ▀██     ████▀         ██▀
  ▀██▄   █▀          ▄██▀
    ▀██▄▄         ▄▄██▀
       ▀▀█████████▀▀
.flixxo   
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4165


View Profile
October 08, 2016, 04:54:59 AM
 #15

you may want to read about replace by fee

http://bitcoin.stackexchange.com/questions/10733/what-is-replace-by-fee



Also, the average time per block is not 10 minutes. It would be if difficulty were constant. But difficulty is growing because the average is less than 10. Somewhere between 8 and 9 minutes (which is still far from what Itskok suggested)
If the difficulty is constant, the blocks would be a lot faster since the hash rate gets higher and the block generation time gets smaller and smaller.

Bitpay does offer an option for an instant approval as long as the transaction meets several criterions. It is by no means foolproof since an malicious user can broadcast another conflicting transaction and a miner can choose to accept the replaced transaction.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
October 10, 2016, 05:38:05 AM
 #16

Great.  So, you check to make sure the transaction paid a reasonable transaction fee, that the inputs are all already confirmed, that there are no excessively small output or unusual output scripts, and that there are no competing transactions being broadcast by other nodes on the network. Once you've verified all that the transaction is safer to accept than cash, check, or credit card (all of which can be used fraudulently).  What's the problem?
The problem is the risk of doublespending.  Grin
Here is one possible scenario: https://bitcointalk.org/index.php?topic=327767.0

Anduck
Legendary
*
Offline Offline

Activity: 1511
Merit: 1072


quack


View Profile
October 10, 2016, 12:37:38 PM
 #17

Hi.
I was wondering what is the most up to date solution for the famous "Double spend" problem?
Is there any solution (commercial company development even..) that reduce the transaction waiting approval time?

The solution is Bitcoin. Double spending is not possible because of the blockchain that seals the transactions and the order of them.

However, those sealed transactions can be leveraged in the form of smart contracts, to support layers like Lightning Network. Lightning Network can be used to send money instantly and 100% confirmed, without the possibility to double spend. But you need to have certain transactions (transactions which enable you to leverage them on layers), sealed in the blockchain.

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!