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

Merge rust-bitcoin/rust-bitcoin#6440: base58: Introduce `decode_check_to_array` for alloc-less decoding

Public commit record

What the developer wrote

Authored by Andrew Poelstra

100/100 · Strong
Merge rust-bitcoin/rust-bitcoin#6440: base58: Introduce `decode_check_to_array` for alloc-less decoding

b0eba4c097ca68da53abbbaf8603a5facd7c82bd Rename Error to DecodeCheckError (Mitchell Bagot)
7e6ab80baf795c9985d63c35d54b622ec59daa0a Add tests for decode_check_to_array (Mitchell Bagot)
ae6ea3616fd6de3fb8cd976346d0b5d9a537abc7 base58: Add decode_check_to_array (Mitchell Bagot)
0a70c578514c3ecfedac508045397b627071e265 Split decode into build_base256 (Mitchell Bagot)

Pull request description:

At present, base58 has only encoding functionality in no-alloc builds. In order to allow decoding of known size data from base58 without an allocator, the base58 crate needs a decoder function like hex's decode_to_array. Such a function has more failure modes than the alloc decode_check function, so new error types are required also.

- Patch 1 splits the existing decode function into a private build_base256 function that writes to a provided scratch buffer.
- Patch 1 introduces decode_check_to_array function for decoding short (<128 char) base58 strings to byte arrays, and associated error types.
- Patch 2 adds tests to cover the new function.
- Patch 3 renames Error to DecodeCheckError, retaining a deprecated type alias.


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


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

What changed, and why it matters

This commit is a routine feature addition to the rust-bitcoin base58 crate. It adds a new no-allocator function to decode short base58-check strings into fixed-size byte arrays, and renames the existing error type while keeping a deprecated alias for backward compatibility. The changes are mostly refactoring and API expansion; there is no direct evidence of a security vulnerability being fixed.

Recommended action

No immediate security action required. Reviewers may want to verify that the new `decode_check_to_array` length checks and checksum logic match the existing `decode_check` behavior, and that the deprecated `base58::Error` alias remains source-compatible for downstream users.

Security signals we found

01

No security-relevant bug fix is described in the commit message or diff.

02

New decoding path uses a fixed 128-byte scratch buffer (`ArrayVec`) and rejects oversized inputs.

03

Checksum verification and invalid-character handling are preserved from the existing alloc implementation.

04

The change removes several `#[cfg(feature = "alloc")]` guards on error types, making error types available in no-alloc builds.

05

No unsafe code, no cryptographic changes, no secret-handling changes observed.

Risk score

Why this scored 21/100

Our methodology →
Potential impact 2/30
Exploitability 2/25
Stealth signal 2/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.