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

Fix script::Builder::push_slice() handling of 0x00

Public commit record

What the developer wrote

Authored by Nadav Ivgi

73/100 · Adequate
Fix script::Builder::push_slice() handling of 0x00

A push for `0x00` (a single byte) is different from a push for the
number 0 (an empty byte array), not a different non-minimally-encoded
representation of the same thing.

Prior to this fix, pushing `0x00` would actually push an empty byte
array instead.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a bug in the rust-bitcoin library where calling a function to push the single byte 0x00 onto a Bitcoin script would incorrectly push an empty byte array instead. In Bitcoin scripts, pushing the number 0 (empty) and pushing the byte 0x00 are semantically different operations. The fix ensures 0x00 is pushed as a one-byte data push, while the number 0 remains represented as an empty push (OP_0).

Recommended action

Review downstream code that uses `Builder::push_slice()` with a single 0x00 byte to determine whether the previous empty-push behavior created incorrect scripts, signatures, or transaction hashes. Update the ignored test and add regression tests covering 0x00, OP_0, and other boundary values. Consider whether this bug could have produced invalid or non-standard Bitcoin transactions in production.

Security signals we found

01

Script encoding bug: 0x00 byte pushed as empty array instead of one-byte push

02

Potential for non-standard or invalid transaction scripts depending on use case

03

Could affect protocols relying on exact script bytes (e.g., covenants, contracts, signature hashes)

04

No explicit security disclosure or CVE referenced in commit

Risk score

Why this scored 61/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 10/15
Affected reach 10/15
Confidence 7/10
Evidence quality 4/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.