Test cases for Taproot signature message



Summary:

On September 16th, 2021, Giacomo Caironi posted on bitcoin-dev forum regarding the documentation of Taproot signature message. He found that Segwit signature messaging had better documentation than Taproot. According to Caironi, Segwit signature message has its own BIP with test cases while Taproot's signature message function is defined in BIP 341 and the test vectors are in a different BIP (also 341). Caironi suggested creating a separate BIP for Taproot signature message like Segwit. Pieter Wuille responded by mentioning that there is no separate BIP for the signature message function as the message function is different for BIP341 and BIP342. Wuille suggested that the existing documentation/vectors can be improved in the existing documents instead of creating a separate BIP. Caironi also brought up the issue of test vectors for Taproot having no documentation and not being atomic, which can make it difficult to debug why a signature message doesn't pass validation. Caironi stated that the existing tests are intended for verifying an implementation against and have much higher coverage than the segwit tests had but they aren't useful as documentation. Caironi proposed writing test cases for Taproot if the idea is accepted. Wuille encouraged Caironi to write test vectors that are more aimed at helping debugging issues, such as for certain P2TR scriptPubKeys, derived from certain internal keys and script trees. Wuille stated that he is happy to help integrate such vectors in Bitcoin Core and the BIP(s).


Updated on: 2023-05-22T15:45:44.334114+00:00