diff --git a/lightningd/anchorspend.c b/lightningd/anchorspend.c index a194702ec..89cf224a4 100644 --- a/lightningd/anchorspend.c +++ b/lightningd/anchorspend.c @@ -276,7 +276,12 @@ static struct wally_psbt *anchor_psbt(const tal_t *ctx, change = chainparams->dust_limit; } - bip32_pubkey(ld, &final_key, channel->final_key_idx); + /* Use BIP86 derivation for P2TR if available, otherwise BIP32 */ + if (ld->bip86_base) { + bip86_pubkey(ld, &final_key, channel->final_key_idx); + } else { + bip32_pubkey(ld, &final_key, channel->final_key_idx); + } psbt_append_output(psbt, scriptpubkey_p2tr(tmpctx, &final_key), change);