utxo: remove UTXO_P2TR_BIP86 enum and consolidate to UTXO_P2TR
What changed, and why it matters
This commit is a small internal cleanup in Core Lightning's wallet code. It removes a separate category ('BIP86') for one kind of Taproot (P2TR) address and treats all P2TR addresses the same way. There is no obvious security bug being fixed; it appears to be a simplification/refactoring change.
No immediate security action required. Reviewers may want to confirm that the unified derivation logic correctly distinguishes BIP86 vs non-BIP86 key paths elsewhere, since this enum no longer carries that distinction.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change removes the UTXO_P2TR_BIP86 enum value and maps ADDR_P2TR_MNEMONIC outputs to UTXO_P2TR instead. It also removes the corresponding case in bitcoin_tx_input_witness_weight() and the string conversion. The commit message frames this as simplification using ‘unified derivation logic based on the wallet’s HSM secret type’. No vulnerability, bounds issue, or cryptographic flaw is evident in the diff.
Changed components
bitcoin/tx.cbitcoin/tx.hcommon/utxo.cwallet/wallet.cInspect captured patch +1 / −6
diff --git a/bitcoin/tx.c b/bitcoin/tx.c
index e03b98b3..4c1a63de 100644
--- a/bitcoin/tx.c
+++ b/bitcoin/tx.c
@@ -940,7 +940,6 @@ size_t bitcoin_tx_input_witness_weight(enum utxotype utxotype)
/* In practice, these predate anchors, so: */
return 1 + 1 + bitcoin_tx_input_sig_weight();
case UTXO_P2TR:
- case UTXO_P2TR_BIP86:
return 1 + 64;
}
abort();
diff --git a/bitcoin/tx.h b/bitcoin/tx.h
index 4690b6fb..4b7134e0 100644
--- a/bitcoin/tx.h
+++ b/bitcoin/tx.h
@@ -53,8 +53,6 @@ enum utxotype {
UTXO_P2WSH_FROM_CLOSE = 3,
/* "p2tr" addresses. */
UTXO_P2TR = 4,
- /* "bip86" addresses (P2TR with BIP86 derivation). */
- UTXO_P2TR_BIP86 = 5,
};
struct bitcoin_tx_output *new_tx_output(const tal_t *ctx,
diff --git a/common/utxo.c b/common/utxo.c
index f94c85ae..ca978c50 100644
--- a/common/utxo.c
+++ b/common/utxo.c
@@ -46,8 +46,6 @@ const char *utxotype_to_str(enum utxotype utxotype)
return "p2wsh_from_close";
case UTXO_P2TR:
return "p2tr";
- case UTXO_P2TR_BIP86:
- return "p2tr_bip86";
}
abort();
}
diff --git a/wallet/wallet.c b/wallet/wallet.c
index 0e0d5a03..5061798a 100644
--- a/wallet/wallet.c
+++ b/wallet/wallet.c
@@ -3260,7 +3260,7 @@ static void got_utxo(struct wallet *w,
utxo->utxotype = UTXO_P2TR;
goto type_ok;
case ADDR_P2TR_MNEMONIC:
- utxo->utxotype = UTXO_P2TR_BIP86;
+ utxo->utxotype = UTXO_P2TR;
goto type_ok;
case ADDR_ALL:
break;
Why this scored 16/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.