python-bitcoin-utils icon indicating copy to clipboard operation
python-bitcoin-utils copied to clipboard

TODO : Add Tapscript differentiation and validation

Open JAGADISHSUNILPEDNEKAR opened this issue 10 months ago • 3 comments

This PR adds script type differentiation to improve Tapscript support:

  • Added script type constants: SCRIPT_TYPE_LEGACY, SCRIPT_TYPE_SEGWIT_V0, SCRIPT_TYPE_TAPSCRIPT
  • Implemented validation to ensure OP_CHECKSIGADD is only used in Tapscript contexts
  • Added TapscriptFactory helper to create valid Tapscripts

Test Updates:

  • Updated test_checksigadd.py to properly test OP_CHECKSIGADD in Tapscript

All the tests pass Screenshot 2025-03-30 at 3 16 08 PM

JAGADISHSUNILPEDNEKAR avatar Mar 30 '25 10:03 JAGADISHSUNILPEDNEKAR

can you provide an example on how spend a OP_CHECKSIGADD script like the one you use as reference script by script path

defconradio avatar May 02 '25 07:05 defconradio

Hi @defconradio Surely I can do that, for this I would need to construct a tapscript input But currently, I am working on something else, and it is best if I implement this example after this PR is approved

Let me know if you have something in mind related to this, I would be happy to hear from you and collaborate

JAGADISHSUNILPEDNEKAR avatar May 02 '25 09:05 JAGADISHSUNILPEDNEKAR

just trying to figure out how perform the signatures for 2-2 tr scripts using this library, couldn't find any example as all tr scripts used in this library use only 1 signature. a simple example Script : <key_1> OP_CHECKSIGVERIFY <key_2> OP_CHECKSIG , or using OP_CHECKSIGADD using TxWitnessInput or raw tx digest would be amazing.

defconradio avatar May 02 '25 10:05 defconradio