Hard fork confusion and unexpected twists

So, the Ethereum hard fork happened. And then things got confusing. So I rolled up my sleeves, opened something like 24 tabs on Google Chrome, and furrowed my brow in concentration. Almost a week later, I’m still confused. So much so that I almost decided to not write about this. But then I figured that I’m probably not the only one, and my confusion is itself pretty telling. I’m not a total beginner when it comes to cryptocurrencies. And if I’m confused, then this whole scenario not good for mainstream adoption. So, here is an account of what I understand, and what I don’t, and I share it with you in the assumption that I will continue to learn more about this as the situation unfolds. Things sure ain’t boring in cryptoland.

ethereum-homestead-with-forks

First of all, for those who don’t know what the fork is or why it happened (if you do, skip the next two paragraphs): Ethereum is a powerful blockchain platform that aims to be “the world’s computer” by making it easy to program smart contracts in a decentralized, token-based network. It has attracted a lot of attention from cryptocurrency enthusiasts and businesses alike, and is well on its way to being a solid sibling for bitcoin, only focussed more on utility than currency. Ether, its virtual currency, is the second largest cryptocurrency by market capitalization, although still only 1/10th that of bitcoin. Just over a couple of months ago, a ton of hype exploded around theDAO, a complex smart contract coded on Ethereum, which wanted to decentralize project investment by collecting investable funds from the “community” and then letting the “community” vote on which projects would get those funds. The novelty was that no management was necessary, the community would run things, everything was democratic, and the code was the law. The appeal of the idea exceeded all expectations, and ended up raising over $150 million from over 16,000 investors. It was called “the end of business as we know it”, “the organization that will kill corporations” and a whole lot of other hype-fuelled declarations. And then all hell broke loose.

A hacker spotted a flaw in the code and siphoned off about $50 million worth of ether. This was obviously not good for the investors, some of whom were Ethereum developers. While to some it seemed like a fair hack (if “the code is law” and the code allowed it, was it a crime?), to many it was unfair, and they wanted their money back. So the Ethereum community decided to change the code, and to turn back code-time to before the hack, so everyone could pretend it didn’t happen. Because this was a pretty fundamental change (and the proposed soft-fork code had flaws), it would have to be done via a hard fork, which means that everyone who uses or works with Ethereum would have to move over to the new system, or we would end up with two different Ethereums. The possibility that some participants would not move over was deemed so unlikely as to not be a problem, and the hard fork went through on July 20th.

Only it turned out to be not quite so unlikely. Some holdouts did refuse to move over, citing philosophical differences with the idea that a cryptocurrency, based on immutability and resistance to censorship, could be changed to suit the convenience of a few. So what if the DAO hacker gets to keep his (or her) ill-gotten gains? Much more than money is at stake: cryptocurrency code can’t be manipulated for profit, period.

But cryptocurrencies can make mistakes, right? There could be an error in the code, and that should be fixed, shouldn’t it? Yes. But that’s not what happened here. I’m not saying that Ethereum’s coding is perfect. But the DAO hack was because of faulty coding on the part of the DAO team, not the Ethereum team. It was not Ethereum’s fault, and Ethereum was not therefore under a moral obligation to restitute losses. So why did it?

It’s about more than just getting their money back. Without the fork, $50 million that was destined for project investment would be removed from the market. That would have a significant impact on the Ethereum ecosystem. And, with a loss of that size, the SEC and other regulatory bodies would take an interest and most likely clamp down on cryptocurrency crowdsales, other DAO projects, etc. The negative effect on experimentation and creativity would set the evolution of the sector back. Pro-fork advocates insist that the DAO was an experiment, just that, and it went wrong. There’s no point in deeply hurting the development of Ethereum because of an experiment gone wrong.

It turns out that the group of holdouts is nowhere near as small as Ethereum expected, and seems to be growing by the day. It is now about 15% of the total Ethereum market, measured by market capitalization, and is now the 6th largest cryptocurrency. Several “big names” in the cryptocurrency world have expressed support. Barry Silbert (early bitcoin adopter, founder of the Digital Currency Group), Charles Hoskinson (former CEO of Ethereum, co-founder of Bitshares, current adviser to Lisk), the Stampery team… The pre-fork Ethereum chain, instead of dwindling away as everyone switches over to the post-fork chain, is growing, and more and more exchanges, miners and wallets are adding functionality. Ethereum Classic is even having its first meetup in London in August. And while most Ethereum-friendly businesses did upgrade their software for the fork, many exchanges, mining pools and wallets are choosing to incorporate trading/storage/mining/support for the old pre-fork Ethereum into their offering: Poloniex, Kraken, Shapeshift, Bitfinex, Yunbi, F2Pool, Ledger, MyEtherWallet to name just a few.

Here’s how it works, technically (and this is the part I understand least, so please correct me if I get any details wrong): anyone who owned ether (Ethereum’s cryptocurrency) right before the fork, now owns that amount in both the new Ethereum (ETH) and the old Ethereum, now called Ethereum Classic (ETC). So, all pre-fork ether holders have, in effect, been given free ether. This didn’t seem like a bad idea at the time because no-one expected the old ether (ETC) to have any value. But it does, not as much as the new ether, but at $1.78 at time of writing (vs price of $12.70 for the new), not insignificant, either.

The problem is that both ETH and ETC accounts have the same public and private keys. So, if someone broadcasts a transaction on one network, it could also be reflected in the other network (this is known as a replay attack). In effect, this would be like spending more than you need to. You only meant to transfer ETH, but you ended up also transferring an equivalent number of ETCs, even though that wasn’t your intention. Or, you could get an unexpected result if you go to withdraw ether. This shouldn’t happen if the networks have taken proper precautions. But it has happened, and it can be (is being?) used by some to profit at the expense of others. Vitalik Buterin, the founder of Ethereum, has urged the Ethereum Classic developers to update their code (yes, to do another hard fork) to close off this possibility. The Ethereum Classic developers have responded that it’s not their responsibility, that Ethereum should have coded this intotheir hard fork. Until this is solved, confidence in the network will be understandably low.

“For transactions to be final and unmodifiable, blockchains need to be immune to third party interference. This promise was completely broken by Ethereum. Hard forks should only happen when a catastrophic bug puts in danger the core values of the technology. In this case the consensus mechanism worked just fine. The blockchain was modified simply because a group of people lost too much money and they decided to bail themselves out.” – Stampery, in an article on Medium

Medium-term things are going to get even more interesting. Will ETC survive as a separate cryptocurrency? Will it eclipse the new ETH? Or will it enjoy a brief spurt of enthusiasm before participants realise that the resulting confusion doesn’t benefit anyone?

I think it will survive. I see a philosophical enthusiasm for the Classic chain that reminds me of bitcoin. It goes beyond the practical and cherishes the original ideals. It seems willing to accept sacrifices to maintain those ideals. Among those sacrifices are a divided community, and the fact that the DAO hacker has a stash of over 3.6m of the currency, which he (or she) will presumably want to offload at some stage. That threat should keep the price low for a while.

But the trading volume of ETC is almost 1.5x that of the new ETH. And the hash rate (a function of how many miners are participating) has been steadily increasing from 2% a few days ago to over 12% at time of writing. The ETC price at time of writing is 135% higher than the price immediately post-fork. New ether’s price (ETH) has fallen by 15% over the same period.

“We believe in decentralized, censorship-resistant, permissionless blockchains. We believe in the original vision of Ethereum as a world computer you can’t shut down, running irreversible smart contracts. We believe in a strong separation of concerns, where system forks are only possible in order to correct actual platform bugs, not to bail out failed contracts and special interests. We believe in censorship-resistant platform that can be actually trusted – by anyone.” – from the Ethereum Classic manifesto

So, the “successful hard fork” that everyone was celebrating a couple of days ago? Not looking so successful now. Ethereum has been plunged into a whirl of confusion which, given that it’s pretty confusing anyway, is not going to help its image. Emotions are high, with each side accusing the other of greed and complicity. Insults are flying, reputations are called into question, and motives are doubted. Conspiracy theorists are pointing fingers at the bitcoin community, accusing them of deliberately trying to destroy the competition. We all know that people behave strangely when money is at stake. And that the very idea of a decentralized, censorship-resistant form of value transfer incites passions. But Twitter and Reddit clearly show how extensive and deep the lack of information combined with strong opinions go. And we thought the bitcoin bickering was silly…

Meanwhile, the core Ethereum team is maintaining its cool and staying above the fray, while getting down to the tricky business of managing the new chain and the communication around it. Other key crypto participants and ETH supporters are scratching their heads and elegantly saying “whoa, didn’t see that coming”. Vitalik himself has said that he welcomes any Ethereum spin-off. So whether you agree with the hard fork or not, it does seem that the sector heavyweights are handling the situation with poise and good intentions.

What we are all getting from this situation is an insight into hard forks. We’ve never had the chance to witness one up close before, and this is relevant to the battle going on in bitcoin over the block size. We also get – and this is potentially even more useful – the opportunity to reflect on what we think cryptocurrencies should stand for, the inevitability of human error, and the dignity of owning your mistakes.

(Note: I do not own any ether, old or new, and did not subscribe to theDAO. A similar version of this post was first published on LinkedIn, and I twitter away at @NoelleInMadrid. Come and say hi!)

Hard fork vs soft fork

The most interesting thing going on in the Bitcoin world this week hasn’t been the alleged unmasking of Satoshi Nakamoto (and I stress “alleged” because, no, I don’t think so). It’s the gathering of the Bitcoin influencers at the Scaling Bitcoin conference in Hong Kong. As the second part to the Scaling Bitcoin conference in Montreal earlier this year, the objective was to get miners and developers together to discuss a possible solution to the block size debate.

image via Coindesk
image via Coindesk

Up until now, everyone has been assuming that the choice is between leave things as they are, or launch a hard fork that will increase the block size and give Bitcoin more scalability. There are pros and cons for each version, and firm, uncompromising beliefs on both sides. Yet some interesting ideas have emerged.

To appreciate what’s at stake here, it is important to understand what a “hard fork” is. A hard fork is a change to the current Bitcoin Core protocol that renders older versions invalid. The Bitcoin Core protocol defines how Bitcoin works. It is the core program that nodes use to validate blocks, and dictates such parameters as the block size, the difficulty of the cryptographic puzzle that needs to be solved, limits to additional information that can be added, etc. A change to any of these rules that would cause blocks to be accepted by the new protocol but rejected by older versions, would lead to serious problems on the blockchain.

Let’s say that the protocol is changed in a relatively fundamental way that relaxes the rules or broadens the code’s scope. If this happens, mining nodes running new versions would produce validated blocks that will not be accepted by nodes running an older version. For instance, if the block size limit is increased from 1MB to 4MB, a 2MB block will be accepted by nodes running the new version, but rejected by nodes running the older version. Let’s say that this 2MB block is validated by an updated node, and added on to the blockchain. But what if the next block is validated by a node running an older version of the protocol? It will try to add its block to the blockchain, but it will detect that the latest block is not valid. So, it will ignore that block and attach its new validation to the previous one. Suddenly you have two blockchains, one with both older and newer version blocks, and another with only older version blocks. Which chain grows faster will depend on which nodes get the next blocks validated, and there could end up being additional splits. It is feasible that the two (or more) chains could grow in parallel indefinitely.

fork

This is a hard fork, and it’s messy. It’s also risky, as it’s possible that bitcoins spent in a new block could then be spent again on an old block (since merchants, wallets and users running the previous code would not detect the spending on the new code, which they deem invalid). The only solution is for one branch to be abandoned in favour of the other, which involves some miners losing out (the transactions themselves would not be lost, they’d just be re-allocated). Or, all nodes switch to the newer version at the same time, which unfortunately is almost impossible to achieve in a decentralized, widely spread system. Or, Bitcoin splits, which would damage its usefulness and scalability. With a hard fork, since new version blocks are only accepted by upgraded nodes, it is essential that all nodes upgrade as soon as possible. This is very hard to achieve.

In March 2013, an accidental hard fork – brought on by an update which led to a database glitch – split the blockchain. The chain mined by updated nodes was longer than the chain containing only older nodes, so it would have been more efficient for the shorter chain transactions to pass to the longer chain. But that would have required a massive forced upgrade, which would have been logistically complicated, so the community decided to abandon the update and go back to the previous version.

For examples of changes that would require a hard fork, see the “hardfork wishlist”.

If, however, the protocol is changed in a way that tightens the rules, that implements a cosmetic change or that adds a function that does not affect the structure in any way, then new version blocks will be accepted by old version nodes. Not the other way around, though: the newer, “tighter” version would reject old version blocks. Old-version miners would realize that their blocks were being pushed off (“orphaned”), and would upgrade. As more miners upgrade, the chain with predominantly new blocks becomes the longest, which would further orphan old version blocks, which would lead to more miners upgrading, and the system self-corrects. Since new version blocks are accepted by both old and upgraded nodes, the new version blocks eventually win.

For instance, say the community decided to reduce the block size to 0.5MB from the current limit of 1MB. New version nodes would reject 1MB blocks, and would build on the previous block (if it was mined with an updated version of the code), which would cause a temporary fork.

This is a soft fork, and it’s already happened several times. Initially, Bitcoin didn’t have a block size limit. Introducing the limit of 1MB was done through a soft fork, since the new rule was “stricter” than the old one. The pay-to-script-hash function, which enhances the code without changing the structure (more on this later), was successfully added through a soft fork. This type of amendment requires only the majority of miners to upgrade, which makes it more feasible and less disruptive.

Soft forks do not carry the double-spend risk that plagues hard forks, since merchants and users running old nodes will read both new and old version blocks.

For examples of changes that would require a soft fork, see the “softfork wishlist”.

One interesting development to come out of the Hong Kong talks is Pieter Wiulle’s “segregated witness” proposal, which would enable Bitcoin to increase the number of possible transactions in a block without a hard fork (more details later). This has the Bitcoin community quite excited, as it would enable a greater level of growth, while avoiding the risks and the controversy. The drama is far from over, though. And the next time you find yourself setting the dinner table, think about using spoons instead.