wallet: make `p2tr` the default address for newaddr.
What changed, and why it matters
This change makes the Bitcoin Taproot address format (p2tr) the new default when users call the `newaddr` command, instead of the older bech32 format. The old bech32 default is kept as a deprecated option for one release cycle so existing integrations don't break immediately. This is a routine modernization, not a security fix.
No security action required. Operators and integrators should review whether their tooling depends on the implicit bech32 default and, if so, explicitly request `addresstype=bech32` or update to handle `p2tr` before the deprecation is removed in v26.12.
Security signals we found
No vulnerability patch present
No memory safety, authentication, authorization, or cryptographic changes
Deprecation guard uses existing project deprecation framework
Change is a default-value policy update for address generation
Evidence from the diff
The commit updates the newaddr JSON-RPC command so that, when no addresstype is specified, it defaults to ADDR_P2TR instead of ADDR_BECH32. During a deprecation window (v25.12 to v26.12), callers that opt into deprecated behavior receive ADDR_ALL, which still includes bech32. Documentation and generated schema are updated to reflect the new default. There is no patch for a vulnerability; it is a behavioral default change.
Changed components
wallet/walletrpc.cdoc/schemas/newaddr.jsoncontrib/msggen/msggen/schema.jsondoc/developers-guide/deprecated-features.mdInspect captured patch +14 / −4
diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json
index 9a0c0266..26b41277 100644
--- a/contrib/msggen/msggen/schema.json
+++ b/contrib/msggen/msggen/schema.json
@@ -27137,7 +27137,7 @@
"description": [
"It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key."
],
- "default": "*bech32* address",
+ "default": "*p2tr* address",
"enum": [
"bech32",
"p2tr",
diff --git a/doc/developers-guide/deprecated-features.md b/doc/developers-guide/deprecated-features.md
index 08673879..4acd298f 100644
--- a/doc/developers-guide/deprecated-features.md
+++ b/doc/developers-guide/deprecated-features.md
@@ -21,7 +21,8 @@ hidden: false
| channel_state_changed.null_scid | Notification Field | v25.09 | v26.09 | In channel_state_changed notification, `short_channel_id` will be missing instead of `null` |
| notification.payload | Notification Field | v25.09 | v26.09 | Notifications from plugins used to have fields in `payload` sub-object, now they are not (just like normal notifications) |
| pay_notifications.raw_fields | Field | v25.09 | v26.09 | `channel_hint_update`, `pay_failure` and `pay_success` notifications now wrap members in an object of the same name |
-| encrypted_hsm | Config | v25.12 | v26.12 | `hsm-passphrase` is a name which also makes sense for modern hsm_secrets which use BIP 39 |
+| encrypted_hsm | Config | v25.12 | v26.12 | `hsm-passphrase` is a name which also makes sense for modern hsm_secrets which use BIP 39 |
+| newaddr.addresstype.defaultbech32 | Parameter | v25.12 | v26.12 | Use `p2tr` in the response (present since v23.08 if `addresstype` is `p2tr`, and always present since v24.12). |
Inevitably there are features which need to change: either to be generalized, or removed when they can no longer be supported.
diff --git a/doc/schemas/newaddr.json b/doc/schemas/newaddr.json
index 098a338c..dc9c94c2 100644
--- a/doc/schemas/newaddr.json
+++ b/doc/schemas/newaddr.json
@@ -19,7 +19,7 @@
"description": [
"It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key."
],
- "default": "*bech32* address",
+ "default": "*p2tr* address",
"enum": [
"bech32",
"p2tr",
diff --git a/wallet/walletrpc.c b/wallet/walletrpc.c
index a91b2aa0..41832096 100644
--- a/wallet/walletrpc.c
+++ b/wallet/walletrpc.c
@@ -149,10 +149,19 @@ static struct command_result *json_newaddr(struct command *cmd,
char *bech32, *p2tr;
if (!param(cmd, buffer, params,
- p_opt_def("addresstype", param_newaddr, &addrtype, ADDR_BECH32),
+ p_opt("addresstype", param_newaddr, &addrtype),
NULL))
return command_param_failed();
+ if (!addrtype) {
+ addrtype = tal(cmd, enum addrtype);
+ if (command_deprecated_in_ok(cmd, "addresstype.defaultbech32",
+ "v25.12", "v26.12"))
+ *addrtype = ADDR_ALL;
+ else
+ *addrtype = ADDR_P2TR;
+ }
+
if (!newaddr_inner(cmd, &pubkey, *addrtype)) {
return command_fail(cmd, LIGHTNINGD, "Keys exhausted ");
};
Why this scored 22/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.