Published on: 2023-08-11T13:45:35+00:00
The email discusses the naming and functionality of the `is_segwit()` function in relation to different types of Bitcoin transactions. The sender suggests that `is_segwit()` should apply to all segwit versions, including p2tr outputs. They propose a clean API design that includes functions like `segwit_version()`, `is_p2wpkh()`, `is_p2tr()`, and `is_p2wsh()` to differentiate between script types. Another suggestion is to refer to version 0 segwit as "v0". The sender also mentions Murch's BIP as a potential source for better naming conventions. The context emphasizes the need to consider witness programs nested inside P2SH and clarifies that these should be considered segwit as they have segregated witness data. It is suggested that documentation explicitly explains how these functions behave for different program types. Finally, the sender asks for input from OG bitcoin API designers on whether `is_segwit()` should return true or false for p2tr transactions and if there is an official or widely used name for segwit v0.
Updated on: 2023-08-12T01:48:03.298921+00:00