Created
January 25, 2019 14:38
-
-
Save SomberNight/c860106fb91027f3f0d0a3fd63dde44c to your computer and use it in GitHub Desktop.
electrum derive_address example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from electrum import bitcoin | |
from electrum import keystore | |
ks = keystore.from_xpub("zpub6nsHdRuY92FsMKdbn9BfjBCG6X8pyhCibNP6uDvpnw2cyrVhecvHRMa3Ne8kdJZxjxgwnpbHLkcR4bfnhHy6auHPJyDTQ3kianeuVLdkCYQ") | |
pubkey = ks.derive_pubkey(for_change=False, n=0) | |
addr = bitcoin.pubkey_to_address('p2wpkh', pubkey) | |
print(addr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment