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

Merge rust-bitcoin/rust-bitcoin#7105: Remove derived serde impls for types in stabilising crates

Public commit record

What the developer wrote

Authored by Andrew Poelstra

91/100 · Strong
Merge rust-bitcoin/rust-bitcoin#7105: Remove derived serde impls for types in stabilising crates

98d482b05589eb6a07268da594d751e538c525c9 primitives: Remove serde derives from all types (Mitchell Bagot)
904eedc38427c12ad4339edf7633700f2d0af2b1 units: Remove serde derives from all types (Mitchell Bagot)
16bffa0cb3e31da963b2288a955404f509d22ea5 consensus_encoding: Remove derive feature outside tests (Mitchell Bagot)

Pull request description:

The serde derive feature introduces various additional dependencies to the dependency graph. Since derives are harder to reason about, and slow down the compilation with extra deps, it's better to simply provide explicit serde impls for all types and drop the feature.

Remove serde derive feature from consensus_encoding, units and primitives. Replace all serde derives with explicit impls for all remaining types in units and primitives.

Contributes to #4823


ACKs for top commit:
tcharding:
ACK 98d482b05589eb6a07268da594d751e538c525c9
apoelstra:
ACK 98d482b05589eb6a07268da594d751e538c525c9; successfully ran local tests


Tree-SHA512: 7dc603f26f25b38adcb92062f90c16f87fcf5599555f3d547a1526a85c8621d929dd1563ecd217bee849b41ce821789fdbd188976c9b0e005b5f551ee7fc878b
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit removes automatic serde (serialization/deserialization) code generation from several Rust Bitcoin library crates and replaces it with hand-written implementations. The stated goal is to reduce dependencies and make the code easier to reason about. The change is a refactoring/cleanup; it does not fix a known security bug, but any mistake in the new hand-written serde code could subtly change how data is serialized or parsed.

Recommended action

Treat as a routine refactoring commit. Reviewers should verify that the new explicit serde implementations preserve the exact same wire/format behavior as the previous derived implementations, especially for Version, OutPoint, Work, Target, CompactTarget, and Sequence, to avoid accidental consensus-relevant format changes.

Security signals we found

01

Manual serde implementations replace derived ones, increasing the surface area for serialization-format bugs

02

No validation logic changes are visible in the diff

03

No mention of security fixes, CVEs, or vulnerability reports in commit message or PR description

04

Change is framed as code-quality/dependency reduction work

Risk score

Why this scored 19/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 3/15
Confidence 8/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.