Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
Decoding scripts fails for large scripts with lengths greater than 0xFFFF. See this inscription transaction for an example which bitcoin core cannot decode.
Expected behaviour
Any script that can be included in a taproot witness should be decodable by bitcoin core.
Steps to reproduce
$ bitcoin-cli decodescript $(bitcoin-cli getrawtransaction 36ef4b89daa22096575c08844823375753dc8be4e4890a30ac8defde1c1a9e7a 1 | jq -r '.vin[0].txinwitness[1]')
-bash: /usr/local/bin/bitcoin-cli: Argument list too long
$ bitcoin-cli getrawtransaction 36ef4b89daa22096575c08844823375753dc8be4e4890a30ac8defde1c1a9e7a 1 | jq -r '.vin[0].txinwitness[1]' | xxd -r -p | wc -c
196052
I narrowed down the exact size limit.
$ bitcoin-cli decodescript $(bitcoin-cli getrawtransaction 36ef4b89daa22096575c08844823375753dc8be4e4890a30ac8defde1c1a9e7a 1 | jq -r '.vin[0].txinwitness[1]' | head -c 131072
-bash: /usr/local/bin/bitcoin-cli: Argument list too long
$ bitcoin-cli decodescript $(bitcoin-cli getrawtransaction 36ef4b89daa22096575c08844823375753dc8be4e4890a30ac8defde1c1a9e7a 1 | jq -r '.vin[0].txinwitness[1]' | head -c 131070 )
{
"asm": "...",
"desc": "...",
"type": "nonstandard"
}
Relevant log output
No response
How did you obtain Bitcoin Core
Pre-built binaries
What version of Bitcoin Core are you using?
v26.0.0
Operating system and version
Linux
Machine specifications
N/A