Two questions about segwit implementation



Summary:

The author of the context has recently discovered that their segwit implementation was incorrect due to a misunderstanding of the specifications. They had wrongly assumed that scriptsig would go into witness data as-is, but have now realized that op_pushdata is replaced by varlen. However, upon reading the specs correctly, they have found that they are not entirely correct. The author questions why OP_0 is represented as 00 in witness data instead of 0100 and whether this applies to other op_codes, as it seems illogical. The author then raises another question regarding non-segwit inputs and why there is a 00 length in segwit data. They argue that it should be nothing since it is not necessary for reconciling things.


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