What changed, and why it matters
This commit adds a small, public helper function to create a new type of Bitcoin address called 'pay-to-anchor' (P2A). It is a pure feature addition with no visible bug fix or security-related change. There is no indication of a vulnerability being patched.
No security action needed; review as a normal feature addition.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds Address::p2a(hrp) in bitcoin/src/address/mod.rs, which delegates to WitnessProgram::p2a() and Address::from_witness_program(). It is a 5-line feature addition exposing the existing P2A witness-program constructor as an address constructor. No existing logic is modified, no bounds checks are changed, and no security-sensitive code paths are touched.
Changed components
bitcoin/src/address/mod.rsInspect captured patch +5 / −0
diff --git a/bitcoin/src/address/mod.rs b/bitcoin/src/address/mod.rs
index 8197df2f..91b218ad 100644
--- a/bitcoin/src/address/mod.rs
+++ b/bitcoin/src/address/mod.rs
@@ -590,6 +590,11 @@ impl Address {
Self::from_witness_program(program, hrp)
}
+ /// Constructs a new pay-to-anchor (P2A) [`Address`].
+ pub fn p2a(hrp: impl Into<KnownHrp>) -> Self {
+ Self::from_witness_program(WitnessProgram::p2a(), hrp)
+ }
+
/// Constructs a new [`Address`] from an arbitrary [`WitnessProgram`].
///
/// This only exists to support future witness versions. If you are doing normal mainnet things
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.