-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple push statement for OP_RETURN #2305
Comments
Seems ok at a glance. Are you guys using https://github.com/btcsuite/btcd/blob/09ba026580f4041bae30d732f26fa1a2036af003/txscript/script.go#L103-L10? |
Hi @kcalvinalvin , thx for the quick reply We are, but IIUC, this test should pass
but it in fact fails when reaching here Line 523 in 09ba026
Next of the ScriptTokenizer , op.length of OP_13 is 1, so t.offset is set to 1 Line 79 in 09ba026
which ends up returning false on tokenizer.Done here
as a side note, it also contains this check please lmk if I missunderstood something? |
@dkatzan if you want to fix this, then you'll need to add a new loop to continue parsing the pushes to validate that they're all minimal, etc. The final statement in that function has |
Hi @Roasbeef and @kcalvinalvin , I made an attempt at fixing the issue |
Currently, when checking if a script is
isNullDataScript
, it is expliciclty checks for OP_RETURN or OP_RETURN followed by a single push which happens here https://github.com/btcsuite/btcd/blame/master/txscript/standard.go#L498how ever since bitcoin v.12.0, the restriction of having only a single push was lifted, and there can now be multiple push data, and the limit on the output size is now enforced on the entire script
Would it be possible to add support for this?
The text was updated successfully, but these errors were encountered: