smite: add is_standard_shutdown_script helper - #186
Open
ekzyis wants to merge 1 commit into
Open
Conversation
BOLT-02 specifies sender requirements for shutdown scripts. They must be witness v0 (P2WPKH, P2WSH) or following features must be negotiated: * `option_shutdown_anysegwit`: witness v1-v16 with a 2..=40 byte program * `option_simple_close`: `OP_RETURN` with a single data push of 6..=80 bytes Legacy scripts (P2PKH, P2SH) may be accepted for backward compatibility. This applies to the `shutdown` and `closing_complete` messages, and the `upfront_shutdown_script` TLV in the `open_channel`, `open_channel2`, `accept_channel` and `accept_channel2` messages. This commit adds a helper to catch targets that don't comply with the spec.
ekzyis
force-pushed
the
is-standard-shutdown-script
branch
from
August 4, 2026 11:07
f33051b to
22217d9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the commit message:
As per the note I added to the code, I'm not sure if the fuzzer should also reject legacy scripts, since a target must not send them.
I haven't wired this into existing code or #163 yet, but I thought the introduction of the helper might be worthwile to review itself, especially considering the question wrt legacy scripts.