Two questions about segwit implementation



Summary:

Aymeric Vitte posted a question on the bitcoin-dev mailing list regarding his incorrect implementation of segwit. He had misunderstood that scriptsig would go into witness data as it was, but realized that op_pushdata is replaced by varlen. After reading the specs correctly, he found that they were not totally correct and had two questions. First, why is OP_0 represented as 00 in witness data instead of 0100? Second, for non-segwit inputs, why is there a 00 length in segwit data and what is the rationale for that? Pieter Wuille suggested that this question should be asked on the Bitcoin Stack Exchange website instead of the mailing list.


Updated on: 2023-05-20T20:34:45.926733+00:00