Closed AdvaitPote closed 4 months ago
Hi @AdvaitPote,
Unfortunately this is not that simple. That opcode is only valid for taproot. There are other differences as well. They all need to be group appropriately and checked only for tapscripts.
Yes, you did mention in the TODO that some other tapscript changes would need to be made. So would these opcodes need to be added elsewhere along with some tapscript functionalities? Unfortunately, in all of the courses we took and our assignment, Taproot was out of scope so I am not much aware of the same. I was thinking we would add these opcodes to script.py
and then add those same tapscript reading features in the Script
class itself.
I believe it would be cleaner if completely new dicitionaries should be used for tapscript (if the changes are many it could be a new file tapscript.py, otherwise it could go into script). Then if the specific tx's output is segwit v1 consult the new dictionary for the opcodes, otherwise use the current dictionaries.
Makes sense! Making a new Tapscript
class or a tapscript.py
would be helpful too because as more updates will be made, managing them in a separate file would be more convenient.
I am closing this for. Re-open if you want to work on it.
As per the newly added TODO, I have added
OP_CHECKSIGADD
toop_codes
.