diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index ebc8cfa74..1e9dfa0d9 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -203,7 +203,12 @@ u8 *p2wpkh_for_keyidx(const tal_t *ctx, struct lightningd *ld, u64 keyidx) { struct pubkey shutdownkey; - bip32_pubkey(ld, &shutdownkey, keyidx); + /* Use BIP86 derivation if wallet has BIP86 base, otherwise use BIP32 */ + if (ld->bip86_base) { + bip86_pubkey(ld, &shutdownkey, keyidx); + } else { + bip32_pubkey(ld, &shutdownkey, keyidx); + } return scriptpubkey_p2wpkh(ctx, &shutdownkey); }