Serious Flaws Found In SegWit by Sergio Demian Lerner

in #bitcoin7 years ago (edited)

Sergio Demian Lerner finds serious flaws in SegWit that will hinder on-chain scaling after implementation.

Last week I began a research on Segwit scaling. I was particularly interested in the maximum resources that Segwit-enabled node requires for verifying a Segwit block. So I went again to review the code, and more specifically, the EvalScript() function. A few seconds later…voila! I came across two more quadratic complexity loops in Bitcoin Core. By exploiting edge cases for each of these two sub-optimal algorithms, I manage to simulate a Segwit block that takes up to 5.6 seconds to verify on a Ubuntu VM running on a single Core i5 processor.

The simulation is based on a single thread executing EvalScript(), the Bitcoin script execution function. The tests were not performed processing actual blocks. These results should not make anyone worry, because there are worse problems in Bitcoin block verification, and because Bitcoin employs several worker threads for verifying scripts in parallel. For example, a Segwit block can request 80000 signature verifications when all transactions are P2WSH.

https://bitslog.wordpress.com/2017/04/17/new-quadratic-delays-in-bitcoin-scripts/

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63271.81
ETH 2568.70
USDT 1.00
SBD 2.80