The Math: Why litecoin is more secure than bitcoin
###Background:
This came out of some research I put into finding out the probability of a 51% attack for bitcoin. You'd think that mining 6 blocks in a row would be hard to do, even with 50% hashing power, because most people would probably think about a coin flip and how likely it is to flip 6 heads in a row. Intuitively it seems like a hard thing to do but in reality, if you do it enough times, it becomes not only possible, but downright likely, even with a mere 100 coin flips (warning:pdf).
With bitcoin mining 144 blocks per day a 51% attack with 50% hashing power is just as likely. Even with 35% hashing power it's relatively trivial to pull off. The reason most people probably haven't thought about this before is because the math itself isn't very straitforward. According to askamathematician.com, it is a tough question to answer with a simple formula. Thankfully there are computer programs which can do this. This site has a javascript "streak" calculator that will calculate the odds of a doing a 51% attack. Just put in 1008 trials for a 1 week period (6*24*7), your streak length of 6 blocks, and a probability of .35 for 35% hashing power. The result is about a 70% probability over a 1 week period and a 99.2% chance over a 1 month period.
Sense all the legwork had been done solving this problem for bitcoin I thought I'd run the math again for litecoin and what I found is actually quite surprising. Litecoin isn't just more secure than bitcoin, it is orders of magnitude more secure than bitcoin.
###Gambler's Ruin / why litecoin is more secure than bitcoin:
I figure the reason is in both cases you're trying to "beat the odds" and mine every single block for a 1 hour period but with more "roles of the dice" occuring during that same period of time it's a lot harder to keep up your winning streak with litecoin than it is for bitcoin.
While a bitcoin pool with 35% hashing power can reasonably expect to be able to pull off a 51% attack within one week, that same hashing power for litecoin makes it almost impossible, not just for a 1 week period, but for an entire year, even for 100 years!
The numbers here are 4,032 trials per week and 24 blocks in a row. The result is 0.0000029760539%. The same problem over a month and a year is about the same and over 100 years the probability is a mere 0.0155609472527%. At 50% hashing power and 100 years an attacker has a 46.46% chance (6.06% for a 10 year period) but bitcoin hits both those thresholds in under 1 day. At 100 years bitcoin is vulnerable to a miner holding just 8% hashing power, while litecoin remains secure all the way up to 50%. No matter how you run the numbers litecoin remains significantly more secure -- entire worlds more secure -- than bitcoin.
###How many litecoin blocks give you similar security to bitcoin?
With the numbers so dramatically in litecoin's favor one would assume you'd need overall less time to verify a transaction with litecoin than you would with bitcoin. Generally we have assumed it takes 4 litecoin blocks to equal the security of 1 bitcoin block but this has always been a guess. Even the people who run the litecoin-project on github know this isn't true (see bullet #3 on Faster transaction time). The problem again is the math not being a simple equation that you can easily solve for but using that same calculator at the 50% threshold I've found that 8 litecoin blocks give you about the same security as 6 bitcoin blocks.
The nature of this problem is that it's not a linear relationship -- at 30%, 8 litecoin blocks are about twice as secure as 6 bitcoin blocks, but droping to 7 litecoin blocks and then to 6 very quickly tips things in bitcoin's favor. The only scenareo where litecoin is less secure than bitcoin is when you compare the two networks block to block. As a function of time litecoin is significantly more secure, so much so litecoin offers similar security at 20 minutes as bitcoin does at 60 minutes.
Posted Apr 21, 2013, 2:11 PM UTC
stocking up on the lites before they hit Gox/libertybit
Stocking up on Litecoins even after they wind up on other exchanges will be a great investment. Litecoin's technicals make it the best cryptocurrency for the major applications which will cause the first real waves in the currency markets in favor of technocurrencies.
Regarding the post: While the general message here is correct, using a streak calculator will not give you accurate odds. The math is actually a bit more complex (see killerstorm's and my reply) and leans even more in Litecoin's favor.
The simplest intuition you can have about the value of a confirmation is this though: Basically, every confirmation adds an exponential factor AGAINST whoever has a minority share of computational power. This is huge and means that ALL computational attacks involving less than half of the compute power of the Litecoin network are 4X exponentially less effective in Litecoin than they are in Bitcoin.
Why, then, isn't the block target even shorter than 2.5 minutes? Well, you have to allow for the time it takes for new transactions and block discoveries to be broadcast across the P2P network. This involves a bit of processing time at each node plus normal network latencies. On average for most nodes it's probably just a couple of seconds. With high transaction volume it could take maybe half a minute for transactions and discoveries to broadcast across the network, which for Litecoin would mean that miners at the tail end of that are wasting 1/5th of their processing power.
That's tolerable as an extreme case, but imagine if the block target were 1 minute... then there would be miners spending most of their time BEHIND the network, mining old blocks. By setting a block target you're aiming to estimate a level at which you never encounter this situation. With Bitcoin, it was set at the extremely conservative value of 10 minutes because there was no data to work off of to set a block target scientifically.
Litecoin took advantage of years of Bitcoin network data in establishing that 2.5 minutes was a better compromise between expediency and cycle waste.
Bitcoin may still turn out to be a great means of transacting between Earth and Mars in 50 years when we actually care about having a transaction network that can handle network latencies of a few minutes.