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

primitives: handle zero-input transactions

Public commit record

What the developer wrote

Authored by Nick Johnson

68/100 · Adequate
primitives: handle zero-input transactions

rust-bitcoin always uses the Segwit witness encoding for zero input
transactions, described in detail in the Serialization notes of the
transaction docs. When decoding such case, there are no witnesses
so the decoder should skip to decoding the locktime.
✓ 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 how the rust-bitcoin library decodes Bitcoin transactions that have no inputs. Normally, the library uses a special encoding for zero-input transactions. The decoder was incorrectly trying to read witness data even when there were no inputs, which would cause decoding to fail. The fix skips witness decoding when there are no inputs, and a new test verifies that an empty transaction can be encoded and decoded correctly.

Recommended action

Review whether any other decoder paths assume witness presence after the Segwit marker, and consider adding fuzz tests for zero-input and single-input Segwit transaction round-trips. Downstream users should update to include this fix if they deserialize untrusted transaction bytes.

Security signals we found

01

Denial-of-service vector: malformed or edge-case transaction encoding could cause decoding failures in downstream consumers

02

Consensus-adjacent parsing bug in transaction deserialization

03

Fix is narrowly scoped to zero-input Segwit transaction decoding

Risk score

Why this scored 34/100

Our methodology →
Potential impact 8/30
Exploitability 6/25
Stealth signal 4/15
Affected reach 5/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.