Skip to content

[bug]: Questions about LND's derivation path of watch only wallet #9613

@hanxianlong

Description

@hanxianlong

Background

I'd like to import several watch only account to LND, and these accounts are generated from different mnemonics. However, the [account]' of LND's p2tr address derivation path seems not seperated these watch only accounts from each other. But the account of them are 0、1、2...etc.
LND wallet: m/86'/0'/0'/0/0
watch only wallet A: m/86'/0'/1'/0/0
watch only wallet B: m/86'/0'/2'/0/0

`"account_with_addresses": [
{
"name": "default",
"address_type": "TAPROOT_PUBKEY",
"derivation_path": "m/86'/0'/0'",
"addresses": [
{
"address": "bcrt1p4r5unsafwxl5xx88v6556vnyclzsr9zaxqs9tq8ln0ed2hynxq4snglrzc",
"is_internal": false,
"balance": "0",
"derivation_path": "m/86'/0'/0'/0/0",
"public_key": "035f2cc3ff54cb55c71e5f86229ed9170231185c22686b03fb43fc5b9ac285ebb8"
}
]},
{
"name": "A",
"address_type": "TAPROOT_PUBKEY",
"derivation_path": "m/86'/0'/0'",
"addresses": [
{
"address": "bcrt1p08xkyq5uwfgcelxp6nngdlcph6qugsqq7g8z99djn6n98plz8vsqgqfn5g",
"is_internal": false,
"balance": "0",
"derivation_path": "m/86'/0'/1'/0/0",
"public_key": "027a5f85279682a055145c0b0bf86b30c37e67d46e88f0129fa55c978a87975f6a"
}]
},
{
"name": "B",
"address_type": "TAPROOT_PUBKEY",
"derivation_path": "m/86'/0'/0'",
"addresses": [
{
"address": "bcrt1p4crj4ccaa884pcgqztg3uxkxkxauewq4mklvn3hmy4pqsntruekqnzr7qm",
"is_internal": false,
"balance": "0",
"derivation_path": "m/86'/0'/2'/0/0",
"public_key": "0398c2060721128c534ba4c3c8425ea509dbcab8a4c7be691b30f2fa109ff81783"
}]
}
]

`

Your environment

  • lnd 0.18.5-beta
  • MacOS
  • bitcoind

Steps to reproduce

Step1. Create a LND wallet (let's call it wallet A), and then create a new P2TR address with the command: lncli newaddress p2tr , and it derives a new p2tr address with the drivation path:m/86'/0'/0'/0/0

Step2. Import a watchonly wallet(let's call it wallet B, which is generated by another mnemonic) into LND with the following command: lncli wallet accounts import EXTENDED_PUBLIC_KEY B
, then create a new P2TR address with the following command:lncli newaddress --account B p2tr and then it derives a new p2tr address with the derivation path m/86'/0'/1'/0/0

Expected behaviour

Since wallet B is a completed new watchonly wallet, it has nothing to do with the wallet A, so I think wallet B's p2tr address derivation path's account index should not be related with wallet A.
That means, the watch only wallet's address derivation path's [account index]' should be 0, which is m/86'/0'/0'/0/0

Actual behaviour

account B p2tr and then it derives a new p2tr address with the derivation path m/86'/0'/1'/0/0
account B p2tr and then it derives a new p2tr address with the derivation path m/86'/0'/2'/0/0

Could anybody help me whether this is an issue/bug, or is it by design?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions