Made a wallet with Bitcoinlib set the key
parameter to my Master Public Key. However, when trying to print a list of all my addresses using their depth=-1
flag which should show all the addresses associated with my key, however it only returns a list of 3 addresses.
Code
# Creation of the wallet was done before like so:
# Wallet.create("Ledger", keys=xpub)
# However after creating a wallet Bitcoinlib stores it locally so you don't make one everytime.
from bitcoinlib.wallets import Wallet
import base64, secrets
def base64_encode(string: str):
b64 = base64.b64encode(string.encode('ascii'))
return b64.decode('ascii')
def base64_decode(string: str):
b64 = base64.b64decode(string.encode('ascii'))
return b64.decode('ascii')
xpub = base64_decode(secrets.xpub)
wallet = Wallet("Ledger")
print(wallet.addresslist(depth=-1))
Output: ['bc1qg2rl6fjutq4knttna2cqlssjp3vlmr9g0wxvk5', 'bc1qw84m5u94tt8xujesl78yq5tnswm58r309nrmus', 'bc1qlu5yuz0vsm7r867mslgkf2v89976y8qtfflvps']
edit: I know that the master public key has a lot more addresses associated as on Electrum it already shows 30+ addresses tied to this master public key