Skip to main content
added 293 characters in body
Source Link

I am having trouble creating SegWit address from mnemonic. I can't find any useful code to do that. I tried using BitcoinLib but I don't know how to disable saving wallets to disk.

EDIT: I found solution that I was looking for. It now shows correct wallet on TrustWallet and on my PC. I used cryptotools libary. Here is the code:

from cryptotools.BTC import Xprv
m = Xprv.from_mnemonic('... mnemonic ...')
print((m/84./0./0./0/0).address('P2WPKH'))

I am having trouble creating SegWit address from mnemonic. I can't find any useful code to do that. I tried using BitcoinLib but I don't know how to disable saving wallets to disk.

I am having trouble creating SegWit address from mnemonic. I can't find any useful code to do that. I tried using BitcoinLib but I don't know how to disable saving wallets to disk.

EDIT: I found solution that I was looking for. It now shows correct wallet on TrustWallet and on my PC. I used cryptotools libary. Here is the code:

from cryptotools.BTC import Xprv
m = Xprv.from_mnemonic('... mnemonic ...')
print((m/84./0./0./0/0).address('P2WPKH'))
Source Link

How to create SegWit address from mnemonic in Python 3.8.10

I am having trouble creating SegWit address from mnemonic. I can't find any useful code to do that. I tried using BitcoinLib but I don't know how to disable saving wallets to disk.