242 points · by tlrobinson · 13y ago · 200 comments
A block was mined (by the Slush mining pool) which is accepted as valid by 0.8 clients, but rejected by 0.7 clients. More than half of the mining power was on 0.8, so the longest chain includes this block - but the 0.7 clients reject it, and have built a side-chain. The developers have asked all miners and mining pools to switch from 0.8 to 0.7, so that the 0.7 chain will grow to be longer than the 0.8 chain; once this happens, all Bitcoin clients will agree that it is the real one. In the meantime, however, merchants running Bitcoin 0.8 may be targeted by double-spend attacks: if they receive money in a transaction that exists only in the 0.8 blockchain, the same money is spent in a different way on the 0.7 blockchain so the transaction can't just be copied over, and they act on the receipt of money by sending goods before the situation is resolved, then they could lose money. This is why MtGox has suspended Bitcoin deposits. (This can only happen if the coins were sent by someone who is using malicious, nonstandard software; transactions made by honest users will be copied to the 0.7 fork and mined without any issue.)
The height of the two chains can be monitored at https://coinbase.com/network/blocks . Currently the 0.7 chain is 13 blocks behind, which (since the normal mining rate is 6 blocks per hour) sets a lower bound of about two hours on resolution - assuming everyone switches their mining power immediately - but realistically it will probably be more like 6-12 hours.
Since most people mine as part of pools these days, it probably doesn't matter too much. The average rate for the pool won't be affected too much (though I suppose pools which have been on the 0.8 block chain will hurt a little bit). There may be a one or two individuals who have mined a block and lose out by this, but if so, they were rolling the dice anyhow by mining outside of a pool; you can't expect a consistent income by mining over a span of 13 blocks.
In the grand scheme of things, how much control over bitcoin do the developers have? My understanding of bitcoin is that there is no central authority controlling it like a central bank, but this statement almost implies that the developers have some kind of control, or influence at least, over bitcoin.
If the majority of people decided they didnt like the current rules (eg all the people complaining about bitcoin deflation) they could very well change them by simple agreement.
The collective "authority" decides how the bugs are to be addressed. Bitcoin is not fully autonomous and without social guidance.
As far as I can tell this sort of centralisation of influence is a common emergent property in most anarchic human systems.
Luckily if something particularly egregious occurs in this case, the community can easily fork the codebase and start a rival blockchain.
Even once that happens, if there are more 0.7 clients than 0.8 clients, they will keep mining, eventually generating a longer chain, and the 0.8 clients will start accepting that longer chain. It's only once 0.8 has more mining power behind it that you get a split; now the 0.8 clients will keep forming a longer chain, and the 0.7 clients will be left behind, as they still see that chain as invalid (due to the invalid block), so they only see the 0.7 chain.
So, while the 0.8 clients were not "wrong" in accepting the bad block, it's pretty hard to fix the problem by convincing everyone to update to 0.8; some people may just not be able to or want to update. But it is easier to fix the problem by getting just enough people to downgrade to 0.7; as long as more than 50% of the mining power is on 0.7, that block chain will be the longest and both 0.7 and 0.8 will work fine with it.
Another way to look at it is to ignore the spec, and just look at the reality of implementation. According to the reality, 0.8 introduced a non-backwards-compatible feature allowing it to accept new kinds o blocks. In terms of protocols, this is sometimes known as "embrace and extend"; support the open protocol that everyone else supports, but add extra incompatible features. While this probably wasn't intended, the effect was that 0.8 miners got an advantage on mining new blocks; they would accept block mined by 0.7 miners, thus keeping ahead of the chain, but once they managed to mine an incompatible block, they would now be a block ahead of the 0.7 miners.
Now, what does this mean in terms of transaction security? Most likely nothing, unless there were any double spends, where the same coins were spent in one way on one chain and another way on the other. If there were double spends, you could look at both block chains and find them; given how quickly this was caught, it's pretty likely you could track down where the double spends went, and it's unlikely that the double spends have changed hands more than once given how short this split is. But there are other factors that make the double spends unlikely. Most transactions will propagate throughout the network pretty quickly, to miners on both sides of the block chain split, meaning that both block chains are likely to record the same transactions. You would have to notice this split, and target transactions at each side of the split so that miners on each side would pick up separate transactions, without the person that you are sending the coins to (and who is presumably sending you something else in return) noticing, all within the span of a few hours.
Now, given that this has happened once, I would be surprised if someone doesn't write a bot that noticed this kind of split and do just that, to see if they can get any double transactions accepted. To defend against this, anyone who cares that much (such as any large Bitcoin merchants or payment processors) can do the converse, monitoring for any chain splits and following both sides to watch for double payments, treating those as fraud and returning (or keeping) them without actually delivering the goods in question.
Unfortunately the limit that was hit (which isn't quite as simple as 'size') was implicit in BDB and how Bitcoin prior to 0.8 used BDB. So no one was aware of it.
Extensive testing during 0.8 turned up several consensus breaking issues that were created during the database switch out, and very large blocks were tested... but the particular kind of very large block required to reveal this difference in behavior was not.
Everyone followed proper behaviors, it's just a compatibility problem. So miners should resort to 0.7 until 0.8 can prevent a fork like this from happening again.
They do not need everyone to stop using 0.8, just a majority (so that the 0.7 chain becomes the strongest).
You would need to get everyone to stop using 0.7 (or much more than a majority, or as soon as another block of this kind resurfaces the clients would be useless again).
0.8 accepts blocks that 0.7 rejects, 0.8 does not reject any blocks that 0.7 accepts. So 0.7 is more compatible going forward until the problem is solved with 0.9 etc.
This is a quick fix to get the system back on its feet while they figure out the longer term strategic answer.
A second thing that I don't understand is why 0.8 people are vulnerable to double-spending attacks. It wasn't said that 0.7 was safe, but it was said that 0.8 was vulnerable. But with two separate blockchains, wouldn't both be vulnerable? Or at least 0.7 because they don't accept 0.8's blockchain?
> .7 and older nodes use BDB for storing the blockchain databases. It seems this database has a limit on the size of the modification it can make atomically to the database. With the larger blocks of the past days, it seems to have triggered the limit. The result is that 0.7 (by default, it can be tweaked manually) will not accept "too large" blocks (we don't yet know what exactly causes it, but it is very likely caused by many transactions in the block). Specifically, block 000000000000015c50b165fcdd33556f8b44800c5298943ac70b112df480c023 (height=225430) with >1700 transactions.
> However. 0.8 (which uses a different database system) has no such limit, and happily accepts the block. As the majority of the hash power was on 0.8, the longest chain ended up using this block, which is not accepted by older nodes.
[1] https://bitcointalk.org/index.php?topic=152030.msg1613200#ms...
Each modified database page needs an allocated lock that is held during the database transaction until it is committed.
If this were an unlucky edge case, I could understand. But it seems like they allowed larger block sizes without testing them on pre v0.8 miners - which might be 25% of miners and the upgrade to v0.8 was less than 1 month ago. It's nice to think that 100% of people will upgrade within a few weeks, but that's just not how some people work.
That is not entirely correct. Multiple large blocks were tested on v0.7 (and older clients). Blocks up to the 1MB hard limits were validated and relayed by older clients.
The "problem block" in particular wasn't rejected due to simply being too large. It was somewhat rare in that it exceeded the number of low level locks available to v0.7 clients. It had a large number of transactions with a large number of inputs and outputs and those happened to have a large number of compressed keys. Without using a high number of compressed keys it wouldn't be possible to have a block with this number of inputs and outputs in the 1MB limit.
Granted in hindsight more testing should have been done but it wasn't like nobody said "hey we should test large blocks, nah I am sure it will be fine".
That would be one great hack. But my imagination is probably just getting the best of me.
Widespread use of the currency is troublesome if it's possible for anyone to have reasonable odds of forking the chain. If it's possible for a mass panic to reverse transactions, it's not as reliable.
If Asia (4 billion people), banking institution (US federal debt = ~23% of world GDP), or a social group (Catholicism: 63% of the Americas) buys a bunch of stuff then decides, en masse, to revert to an earlier blockchain, it could drive instability. Large groups of people sometimes do unpredictable things (Gangnam Style: 1.4 billion views).
They will not merge, but transactions will homogeneize.
I have simulated this scenario, forking the Bitcoin chain on a private network 2 years ago. What happens is that if the chain is forked, and if a client unexpectedly sees that another chain (say chain B) suddenly replaces the chain it was following (say chain A), thereby reverting a bunch of transactions, then the client will automatically retransmits its transactions that it had saved in chain A, to have them saved again in chain B.
That is how a non-malicious client operates.
Of course, if you are a malicious person, you can actually kill the client and manually wipe out its cache of transactions before it has time to retransmit transactions for chain B (therefore recovering coins that you had spent on chain A).
The transactions are on both chains. While they may be in v0.8 blocks and still unconfirmed in the v0.7 fork they do exist in the v0.7 fork. The only transactions which couldn't exist in the v0.7 fork are those generated in "v0.8 only blocks" and those are hard locked by the protocol for 100 blocks.
Had both halves of the fork existed for more than 100 blocks that would have presented a more serious problem. This is why the stakeholders (exchanges, merchants, miners, and developers) moved quickly to halt transactions, warn users, and move to the v0.7 version of the chain BEFORE one chain got more than 100 blocks from the fork point.
Unless...
Perhaps an enduring, permanent split, under the right conditions, with people motivated to keep both chains alive indefinitely, could be a good thing. Among other things, it might solve the deflation problem, or allow a runt network to continue if the mother network were compromised by technical or legal attacks. (Or depending on your perspective, allow the mother network to continue if a runt network is created by certain attacks.)
No, but the "transaction graph" which underlies both chains can (and will) be merged, in some sense.
> If [lots of people conspire] to revert to an earlier blockchain, it could drive instability.
The blockchain will only ever split inadvertently, or due to probability (the unlikelihood of multiple blocks being orphaned). A majority of miners would have to conspire to begin mining on a chain with less than 50% of the hashrate, which would be a waste of resources if the chain fails (which it will).
There's not just an incentive but a probabilistic force preventing forks from occurring.
If only the global finance institutions had a fraction of bitcoins capacity to resolve crises with the same unconditional transparency and full cooperation with all agents in the ecosystem.
It does the opposite for me, because it demonstrates that Bitcoin is extremely vulnerable to double spending. Either everyone uses the same version of the software, or you have to deal with the possibility that this event will happen again. Worse still, an attacker might use some kind of malware to modify Bitcoin clients, until they are able to fork the network and double spend.
Yes, making cryptosystems that are secure against malicious majorities is difficult, and experts have published tons of papers and several books on the subject. If Bitcoin's developers want people to trust their system for anything non-trivial, they really need to fix this problem. To break David Chaum's digital cash systems, an attacker would have required exponential computing power in a security parameter that could be scaled arbitrarily, while the users only require polynomial computing power in that same parameter; to break Bitcoin, an attacker only requires a little more than half the sum of all the computing power in the Bitcoin network. The Germans learned the hard way that just because an attack seems too pricey for anyone to bother with does not mean that the attack actually is too pricey for anyone to bother with.
If you compare the way the Bitcoin community responded to this with the response you might have expected from even a very well run company, I think the Bitcoin community comes out ahead.
It would be useful and or interesting to compare the Bitcoin community response with a specific failure and response of a for-profit closed-technology company, but I'm not sure what case to use for comparison.
Maybe the recent cloudflare outage?
That is not true. Cryptographers have published many thousands of papers on securing multiparty computation against malicious participants over the past twenty years. Here is a very brief introduction:
https://en.wikipedia.org/wiki/Secure_multi-party_computation
The relevant citations in this field, like the relevant citations about digital cash protocols, are conspicuously absent from Satoshi's writeup about Bitcoin. This is one of the things that bugs me the most about the Bitcoin community: nobody seems to have done any background research at all. There is a huge volume of work that has been done in this field, but little mention of it among Bitcoin's developers. The Bitcoin developers do not even seem to be worried about the fact that the work required to attack Bitcoin scales linearly with the work required to run the Bitcoin system:
https://en.bitcoin.it/wiki/Weaknesses#Attacker_has_a_lot_of_...
"If you compare the way the Bitcoin community responded to this with the response you might have expected from even a very well run company, I think the Bitcoin community comes out ahead."
OK, the community is great at admitting that there are bugs and finding workarounds. That does not count for much in a secure multiparty system, where subtle problems in a protocol can undermine the security of the entire system. Security in a system like Bitcoin is about more than just "avoid X, remember to do Y, and patch bugs quickly!" Malicious clients are going to have to be dealt with in Bitcoin, and they are going to have to be dealt with better than what we saw today.
The maintainers of the biggest pools are all very active in the community; it would just take 2-3 of the big mining pools to say "hey, let's go back to 0.7" for this to be resolved automatically.
I sincerely hope that the aftermath of said explosion will leave Bitcoin as the strong contender to established monetary systems that it always was - just "proven by reality" now. That would certainly be all I need to finally jump on board.
The attack would be essentially to create the current situation artificially by crafting a block that is only valid by one version of bitcoind, therefore splitting the block chain. Then one needs to include two different transactions into the two blockchains. ( In the theoretical scenario, by mining another block for one of the chains. ) For this I do not need to have 51% of the hashing power, but the branch of the blockchain needs to be supported by 50% of the hashing power.
EDIT: Thinking a bit more about this, it seems that the probability to suceed with such an attack seems to rely on the attackers abbility to craft a 'splitting block', which should be proportional to the share of the attacker controlled hashing power and the ability of the 'incompatible' clients to outgrow the standard block chain. ( So that a merchant with an 'incompatible' client accepts a payment based on the fork of the blockchain.) This means that the attack is probably impossible, if the one CPU one vote approach is not only used for valid transactions, but also for valid clients.
Assume that mining reward is approximately equal to investment. This will tend to be the case, though it fluctuates.
Right now we're rewarding 25 bitcoins, at a price of $45, every ten minutes, or $6,750 per hour. Let's say half the required investment is hardware, half electricity at the national average of 11 cents per kWh. Divide 3375/.11 for 30,681 kW power devoted to bitcoin at this moment.
With similar calculations, I recently figured out that if bitcoin were to reach the size of the U.S. dollar in about 20 years, it would be consuming about a gigawatt. It was less than I expected, because the number of new coins per block keeps decreasing, and you only pay electricity for the new ones. This doesn't account for transaction fees, which increase the mining investment that can be sustained. At the moment I think they're a small percentage of the mining award. I'm also neglecting miners' profit margins, which decrease our energy investment.
Coal is 22% of U.S. power production, and generates 2,460 kWh/ton. (30,681 * .22) / 2460 happens to equal almost exactly one ton of coal burned per hour to support bitcoin.
The U.S. generates 227 GW from coal, so our 6.7 MW is about one part in 33,000 of total U.S. coal consumption.
Sources: just type questions into google and all the numbers come right up. I assumed, perhaps incorrectly, that U.S. numbers were more typical of the bitcoin population than global numbers.
Take, for example, reddit karma - people pay to power their computers and purchase hardware/software to create memes and original content that will reap positive karma. What notion or idea will be "valuable" to the reddit hive mind next is anyone's guess, so your best bet is to keep plugging away at it and generating as much original content as possible. While there's no direct translation of earned karma to a national currency (yet), it can carry a social/fame value.
These people paying their internet, hardware, software, and electricity bills provide a basis for an exchange rate of <national currency> to <reddit karma>.
The only differences between this and bitcoin are that people can give bitcoin to one another and that there are bitcoin to <national currency> exchanges.
I stretched the analogy a bit thin with reddit karma, but I'm sure people can think of other similar electricity->money "pure technology" wealth/value generation methods (high frequency trading hardware/software, for instance).
In other words its purposely designed to be excessively taxing on resources.
The other activities you mention have resource consumption as a side effect and not necessarily exhaustive.
Therefore the total electricity usage per ten minutes cannot sustainably be worth more than the value of the new coins generated in that ten minutes. Meanwhile the number of coins awarded each time is cut in half every four years. If, in 20 years, bitcoins are worth 32 times as much as they are right now, the total electricity usage will be the same as it is now.
The amount of electricity used is surprisingly low; for details see my comment above.
Edit: with further thought, I wonder whether this is a long-term security flaw. Previously I calculated that if bitcoin were to reach the market cap of the dollar in 20 years, it would consume a gigawatt of power. An attacker with a nuclear reactor could conceivably control a blockchain with over a trillion dollars of market value.
Transaction fees would make it more expensive (by increasing the power usage sustainable by honest miners) but the hope is to keep fees fairly low.
However, a 51% attack still doesn't allow the attacker to steal all the money, only to double spend. So the attack may not be worthwhile, unless you already have very large bitcoin holdings...in which case, you may be more interested in maintaining the soundness of the currency.
That can only be true if there are not conflicting transactions in the two chains. That might be the lucky outcome, but it's certainly not guaranteed to be the case.
Any transactions that were confirmed on the faulty chain will have to be re-confirmed in the correct chain. How long that will take would depend on just how many transactions need to be processed, and how big their payload is. Until that is completed, the state of the bitcoins involved in those transactions is ambiguous.
For those not watching, BTC is currently trading at ~$45.
The sane price is the total amount of such wealth that individuals are storing or will store in the future, discounted for time, divided by the number of such assets.
Now good luck figuring that out.
http://bitcoincharts.com/charts/mtgoxUSD#rg180ztgSzm1g10zm2g...
I'm actually not sure which side I stand on that issue, to be honest.
Bitcoin seems subject to a vast array of DOS and other attack that could be seriously problematic if it became an important currency.
>If this is a widespread problem, it is an emergency. We risk having (several) forked chains with smaller blocks, which are accepted by 0.7 nodes. Can people contact pool operators to see which fork they are on? Blockexplorer and blockchain.info seem to be stuck as well.
So, what would happen to the coins used in those forked transactions? If the chain does fork what would the best strategy be for performing the merger?
And more interestingly: since bitcoin transactions are considered to not be reversible bitcoins are easily converted to and from other currencies with non-reversible transactions. If one were to convert his or her bitcoins to, e.g., Liberty Reserve right now and the chain got reversed that would result in pretty much a perfect scam, wouldn't it?
[1] http://sourceforge.net/mailarchive/message.php?msg_id=305878...
A fork this big (dozens of blocks covering multiple hours of transaction history) already happened in August 15, 2010, due to an unrelated bug: https://en.bitcoin.it/wiki/Common_Vulnerabilities_and_Exposu...
That's not so different from the U.S. dollar. You can buy and sell stuff using U.S. dollars, but unless you foresee the value of USD going up (a kind of deflation), you don't want a pile of USD under your mattress. (Also, it's uncomfortable.) Depending on your economic outlook, you want the money in something else: metals, some sort of investment vehicle, or a basket of [foreign] currencies.
The advice for users is wait until we have a definite dominate blockchain and continue on as normal. Users do not need to downgrade, upgrade or do anything else. This is a miner issue.
There was a fork in the blockchain, and the community will have to decide how to resolve it. Some transactions which were "confirmed" could be reverted.
IF YOU ARE A MINER READ THIS: http://sourceforge.net/mailarchive/message.php?msg_id=305879...
We'll see how it actually shakes out, but that's good news for bitcoin if it holds up.
How does one know who to believe when determining what the "correct" blockchain to forward would be?
> Last price:$45.00000
> High:$48.46900
> Low:$36.65000
Edit: It could go back down a lot. We'll see what happens.This will be another... interesting couple of weeks for bitcoin.
Weird.
This should be a wakeup call for anyone that thinks that Bitcoins are totally secure. What if next time the bug in the client is more exploitable? Someone malicious could potentially take out the entire Bitcoin economy in one day by exploiting it.
The answer to the question I was trying to ask is https://coinbase.com/network/blocks which enables me to check in on how far behind the future legitimate blockchain is (7 blocks at time of writing).
http://blockchain.info/ is updated live.
As you can see, the 0.7 chain has already overtaken the 0.8 chain, and clients are now resubmitting transactions into the 0.7 chain.