Post
Topic
Board Development & Technical Discussion
Re: Why do people hate segwit so much?
by
Test User
on 01/12/2017, 21:29:59 UTC
Could you go into a bit more of details, how exactly would it render ASIC boost useless?

ASICboost works by finding partial block header collisions for the transaction list. With colliding block headers, it is possible to test one nonce against multiple block headers, while sharing some of the computations. By sharing computations, the total energy requirement is reduced.

This can easily be done by using certain parts of the block header, such as the version bits, as a nonce. The disadvantage is that it's obvious you are using ASICboost. This would not be affected by segwit.

There is a hidden way of using ASICboost, which instead of using a nonce in the block header, the search is performed by randomizing the order of transactions.

In the absence of segwit, because of the tree structure, it is not necessary to hash every transaction to compute a new Merkle root; it is merely sufficient to swap branches, and recompute only the hashes further up the tree. This is much faster than recomputing the whole tree, as it replaces linear scaling with log scaling.

With Segwit, there are two Merkle trees, with the witness root, located in the first leaf of the main tree. The two trees must have the same order, so must both be shuffled and hashed together, and not only that, but you always have to recompute the hashes for the route to the first leaf of the tree. This vastly increases the computational effort to find the collisions needed to use the ASICboost technique.

An alternative strategy for hidden ASICboost is for the miner to include a transaction to themselves in each block. They then use that transaction as a nonce (e.g. by varying the transaction output values). However, this requires an ECDSA operation and recalculating the path through the Merkle tree to that transaction. Again, for a hash collision search, it is a considerable computational effort.

The short answer is that segwit does NOT render ASICboost useless. Visible ASICboost is not affected. However, hidden ASICboost is made more difficult.