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.
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.