Author: Aymeric Vitte 2019-05-26 16:18:46
Published on: 2019-05-26T16:18:46+00:00
The discussion on the bitcoin-dev mailing list highlights some misconceptions regarding the implementation of segwit. In response to a query about the use of OP_0 in witness data, developer Johnson Lau clarifies that witness is not script and explains that the "00" element signifies zero size and creates an empty element on the stack. Lau emphasizes that the witness is a stack and provides a detailed explanation of how it works for each input. Regarding the second question on why non-segwit inputs have a "00" length in segwit data, Lau explains that this indicates that the input has no witness stack element. This information is necessary because it is difficult to determine whether an input is segwit-enabled or not until you look up the UTXO, which may not always be available. Lau adds that if all inputs have no stack element, the non-segwit serialization must be used. In conclusion, the discussion sheds light on the nuances of implementing segwit.
Updated on: 2023-06-13T19:08:59.553880+00:00