AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 15 Bitcoin

primitives: rename Script{Buf,} to GenericScript{Buf,}

Public commit record

What the developer wrote

Authored by Andrew Poelstra

95/100 · Strong
primitives: rename Script{Buf,} to GenericScript{Buf,}

...and add type aliases to the old names so that the change is invisible
outside of primitives.

Done by search-and-replace on the three files in the script/ tree, and then
reversing the search-and-replace on the tests module and the stuff related
to scripthashes. (In the next commit we will add generics to these types,
and we will want our tests and API test to continue using specific types.
Changing them to be generic would be a lot of noise, and premature. For
the script hashes, there are specific types these should be implemented
on; we don't want them to be generic even if it were possible in a nice
way.)

At the end of this PR we will undo this rename. But we want to be sure that
every single instance of `Script` and `ScriptBuf` are replaced by a more
specific type, and by using these names for `GenericScript<Whatever>`, a
"specific type" that we'll delete at the end of the PR, we can identify
all of them.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit is a purely internal rename in the rust-bitcoin library. It renames the low-level `Script` and `ScriptBuf` types to `GenericScript` and `GenericScriptBuf`, then adds public type aliases so existing code using the old names continues to work unchanged. It is part of a planned refactoring series and does not change any behavior, logic, or security properties.

Recommended action

No security action required. This is a benign internal refactoring commit with no security relevance.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.