What is Segregated Witness?

Segregated Witness (Segwit to its friends) was first unveiled at the recent Scaling Bitcoin workshop in Hong Kong in December of last year, where the bitcoin elite gathered to discuss the need for an increase in the block size, as a possible solution to the controversy surrounding the hard fork vs soft fork debate.

Pieter Wuille, the originator of the idea, at the Scaling Bitcoin workshop
Pieter Wuille, the originator of the idea, at the Scaling Bitcoin workshop – image via Coindesk

It was well received (although consensus would be too much to hope for), as it removes the need for a contentious hard fork. How does it do that? Through the rather ingenious idea of removing some of the data in the block to make room for more transactions. The size of the block would not change. Its internal structure would.

How? By replacing the signatures. Each transaction consists of two main components: the data (amount of bitcoin to be transferred, and where to), and the verifying signatures. Since the signatures “only” validate the previous ownership and the owner of the receiving address (although I’m not sure that “only” is the correct term, that sounds pretty important to me), they can be stripped out of the transaction itself. This makes the transactions smaller. That way, more transactions can fit in a block (apparently two or three times as many), without the block needing to increase in size. No hard fork needed.

But how can miners process the transaction block if there are no signatures? Because they’re still there, they’ve just moved position. The “removed” signatures are incorporated into a structure of hashes (compressed encrypted information) called a Merkle tree. This “tree”, now separated from the transaction data, is then further condensed and stuffed into an underused code space in the transaction block (reminder: bitcoin transactions are grouped into blocks which are then processed by the miners – one block contains many transactions, and the problem is that as the number of transactions increases, the block size limit acts as a cap on growth).

The beauty of this idea is that “older” nodes that have not yet upgraded to the newer Segregated Witness version will still be able to process transactions. The transactions won’t make a lot of sense since they’ll be missing some data, but they will comply with the protocol, will be deemed valid and thus can be passed on to the miners. The majority of miners will need to upgrade to the new protocol to be able to understand the new block structure, but the network can keep functioning while the rest catch up. With a hard fork, the whole network needs to upgrade at the same time to avoid the blockchain splitting.

Of course, the proposal is not without controversy. Some worry about the impact on investment-intensive mining that a “rushed” solution would have. Others claim that for it to last, it needs to be implemented with a hard fork – this would make the code cleaner and more efficient, but at the same time does not solve the problem that a hard fork is almost impossible to achieve when there isn’t full consensus. Segregated Witness does not solve transaction bottlenecks that are due to the logistical complications of quickly transmitting 1MB blocks around the network. Nor is it a long-term solution.

Yet it could be a good intermediate step, and it could lead to unexpected technological developments completely unrelated to the block size. The new protocol is currently in the public testing phase. It’ll be interesting to see what turns up.

Segregated Witness apparently opens up all sorts of opportunities to re-think how the structure of the transaction code works, even bringing into play the design of the blocks themselves. A new style of proof, the possibility of including more complicated instructions, even re-purposing lightweight wallets – these and other Segregated Witness-related ideas could end up transforming the organisation of this still young concept, and opening up its potential to even more applications.

Bitcoin Classic – more of the same?

The block size debate takes a new turn, possibly a 360º one, to end up back where it started. Yesterday Bitcoin Classic was launched as a hard fork. Developed by a team that includes the original Bitcoin Core maintainer Gavin Andresen (one of the proponents of the now-irrelevant Bitcoin XT) and Bloq CEO Jeff Garzik (who had also proposed the apparently popular Segregated Witness idea as an alternative to a block size increase), Bitcoin Classic updates the current and standard Bitcoin Core protocol with a 2MB block size limit (vs 1MB).

Since this involves a hard fork (transactions that are accepted in the new version would be rejected by the old version, resulting in two different chains), tension is high and opinions are divided. On the one hand, you have those that believe that a bigger block size is urgently needed, and a hard fork will not be that disruptive. On the other, you have those who fear the uncertainty a hard fork will unleash, who would like to find a less abrupt change or who don’t think the block size should be increased at all.

The public approval has been notable, with many of the large bitcoin companies (such as Coinbase, itBit, Xapo, OKCoin…) expressing support. Just over the past two days, the number of nodes running Classic jumped from under 500 to over 700, while about 4,100 are still on Core.

via coin.dance
via coin.dance

Yet it is worth remembering that Bitcoin XT attracted almost 900 nodes soon after launch in August of last year, before fizzling out. And today a group called The Bitcoin Roundtable published their rejection of the new protocol. This group allegedly represents 90% of bitcoin’s hash power, although that figure has been questioned as some of the signers work for firms who have publicly backed Classic. Confusing.

For the software to officially “activate” and become the main bitcoin protocol, a certain volume requirement has to be met. Of the last 1000 mined blocks, at least 751 (or, to put it another way, just over 75%) of them need to have been processed with Bitcoin Classic.

According to coin.dance, of the last 1000 blocks mined today, none used Bitcoin Classic.

via coin.dance
via coin.dance

So, this may all end with another shrug of the shoulders as the debate continues unresolved. Or, the need for a consensus-based change may become more pressing with the public pressure and scrutiny. It would be great to get this resolved, as it will set the tone for bitcoin development going forward. Not just on the transaction limit issue. On the governance issue, which is almost even more important.