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

Merge rust-bitcoin/rust-bitcoin#7112: units: remove `Amount::MAX_MONEY`

Public commit record

What the developer wrote

Authored by Andrew Poelstra

100/100 · Strong
Merge rust-bitcoin/rust-bitcoin#7112: units: remove `Amount::MAX_MONEY`

71641e87aa0d7d9604d8ec920ba2aa3e3d5e2b93 units: remove Amount::MAX_MONEY (satsfy (Renato Britto))

Pull request description:

Now is the last call to judge the matter before units 1.0: In [#3693](https://github.com/rust-bitcoin/rust-bitcoin/pull/3693) we decided to keep both `MAX` and `MAX_MONEY` as synonyms. In [#4164](https://github.com/rust-bitcoin/rust-bitcoin/pull/4164#discussion_r1979441438) it was argued that `MAX` is the proper rusty name for it, something I agree. All these discussions ended at March 2025.

It seems like we are hedging between looking like core and looking rustonic on the `Amount::MAX` and `Amount::MAX_MONEY` issue.

I think we should just kill `MAX_MONEY` because:
1. DRY principle
2. Why are we afraid of looking different from core?
3. We can remove now and add later, but not easily later past 1.0.
4. We have `Weight::MAX`, `Sequence::MAX`, `SignedAmount::MAX`, `FeeRate::MAX`...
5. It just looks bad.


ACKs for top commit:
Kixunil:
ACK 71641e87aa0d7d9604d8ec920ba2aa3e3d5e2b93
apoelstra:
ACK 71641e87aa0d7d9604d8ec920ba2aa3e3d5e2b93; successfully ran local tests


Tree-SHA512: cdb3185b727392d72beb3201fac3d738800414458be41884a487bb7d293871f6643f1e716913354cda4e32aa7d6ef194f6d0ea9de90ad1cc4210953a85946d6c
✓ 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 API cleanup: it removes the duplicate constant name `Amount::MAX_MONEY` and keeps `Amount::MAX` as the single name for the maximum Bitcoin amount. The numeric value (21 million BTC) and all safety checks stay exactly the same. It is not a security fix and does not change how the library protects against invalid amounts.

Recommended action

No security action required. Treat as a normal breaking API change for the upcoming 1.0 release; downstream users should migrate from `Amount::MAX_MONEY` to `Amount::MAX`.

Security signals we found

01

No security signal: pure public API renaming with identical semantics

02

All boundary checks preserved, only identifier changed

03

No new logic, no relaxed validation, no cryptographic change

Risk score

Why this scored 20/100

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