I'm trying to generate unused receiving Bitcoin address from xPub using PyWallet python library . I got the xPub from my BIP32 Electrum wallet.

Here is what I tried

from pywallet import wallet

WALLET_PUBKEY = 'xpub....'

# Generate a random address, based on timestamp
rand_addr = wallet.create_address(network="BTC", xpub=WALLET_PUBKEY)

print("Random Address\n", rand_addr)

I sent a few cents worth of Bitcoin to it's printed address but I didn't receive it. What is wrong here and what is the solution ?

  • 2
    For starters, you should test this on testnet instead of with actual BTC. Nov 2, 2019 at 8:20
  • @PieterWuille How to do that? Nov 2, 2019 at 8:21
  • @PieterWuille Ok. I just figured out how to use testnet wallet but I don’t know how to use testnet network with PyWallet Nov 2, 2019 at 9:41


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.