lndbut still be able to manage them within
lnd. As of
lndis able to import BIP-0049 and BIP-0084 extended public keys either at the account path (
m/purpose'/coin_type'/account') or at the address index path (
m/purpose'/coin_type'/account'/change/address_index) as watch-only through the
WalletKitAPIs, users will need to obtain a
lndbuild compiled with the
walletrpctag. Our release builds already include this tag by default, so this would only be necessary when compiling from source.
lnd, a wallet is created with four default accounts:
v0.13.0-beta, these accounts were abstracted away from users. As part of the key import feature, they are now exposed through the new
ImportPublicKey) and the
lncli wallet accountscommand.
lncli wallet accounts listcommand can be used to retrieve the details of accounts.
name: Each account has a name it can be identified by.
extended_public_key: The BIP-0044 extended public key for the account. Any
lndsupports the following versions:
xpub/tpub: The commonly used version prefix originally intended for
lnddoes not support
ypub/upub: The version prefix for BIP-0049 mainnet/testnet extended keys.
zpub/vpub: The version prefix for BIP-0084 mainnet/testnet extended keys.
address_type: The type of addresses the account can derive. There are three
WITNESS_PUBKEY_HASH: The standard derivation scheme for BIP-0084 with
NESTED_WITNESS_PUBKEY_HASH: The standard derivation scheme for BIP-0049
HYBRID_NESTED_WITNESS_PUBKEY_HASHA custom derivation scheme for BIP-0049
lndwhere NP2WKH is used for external addresses and P2WKH for
master_key_fingerprint: The 4 byte fingerprint of the master key
derivation_path: The BIP-0044 derivation path used on the master key to
external_key_count: The number of external addresses generated.
internal_key_count: The number of change addresses generated.
watch_only: Whether the wallet has private key information for the account.
lnd's default wallet accounts.
lncli wallet accounts importcommand can be used to import an account. At the time of writing, importing an account has the following request parameters:
name(required): A name to identify the imported account with.
extended_public_key(required): A public key that corresponds to a wallet account
master_key_fingerprint(optional): The fingerprint of the root key (also
address_type(optional): An address type is only required when the extended
dry_run(optional): Whether a dry run should be attempted when importing the
lndnodes Alice and Bob, where Alice acts as a signer only, and Bob manages Alice's on-chain BIP-0084 account by crafting transactions and watching/spending addresses. Since Alice will only act as a signer, we'll want to import her BIP-0084 account into Bob's node, which will require knowledge of Alice's extended public key.
lncli newaddresscommand, as they now take an additional optional parameter to specify which account the address should be derived from.
bcrt1q8zdjz2q92eh7jw9ah3upf2u9553226gq79el5l), Bob should be able to craft a transaction spending their new UTXO. Since Bob is unable to sign the transaction themselves, they'll use PSBTs to craft the transaction, and provide it to Alice to sign.