Post
Topic
Board Bitcoin Technical Support
Merits 1 from 1 user
Re: Which Wallet support multi seed phrase import?
by
ETFbitcoin
on 09/08/2022, 12:31:08 UTC
⭐ Merited by FatFork (1)
I have this lib setup and imported to my project. but don't know how to call and give seed as input and get public key of my desired coin as my desired derivation path.

Could you be more specific? The documentation of library you mentioned give several code examples.

Code:
# Source: https://hdwallet.readthedocs.io/en/v2.1.1/hdwallet.html#hdwallet.hdwallet.HDWallet.p2wpkh_address
>>> from hdwallet import HDWallet
>>> from hdwallet.symbols import BTC
>>> hdwallet = HDWallet(symbol=BTC)
>>> hdwallet.from_mnemonic(mnemonic="venture fitness paper little blush april rigid where find volcano fetch crack label polar dash", passphrase="meherett")
>>> hdwallet.from_path(path="m/44'/0'/0'/0/0")
>>> hdwallet.p2wpkh_address()
"bc1qfky82ek5pr07t65qjretw9hevw2j8j5fdrn5hc"

If you need to get public key, just use hdwallet.public_key() after specify correct derivation path.

Code:
>>> hdwallet.from_path(path="m/44'/0'/0'/0/1")
>>> hdwallet.p2wpkh_address()
'bc1qllytr4ftxqgpg2he8uafcgcj9gzxcv7xmuyjw6'
>>> hdwallet.public_key()
'02fed55ac2909f56c9a2f933113893fdc18a24b7a12c9530c771e47e991da0401b'