in

How to generate Electrum address with pybitcointools

Have I understood the concept of address, account and wallet correctly and how the wallet balance is calculated?


I want to create a payment service where I want to be able to charge each client according to its invoice. I picked Electrum as my underlying wallet and pybitcontools as my Python interface.

I would like to assign for each invoice a separate address. However, using wallet GUI it requires a person doing so and would like to automate that. Sadly, I am unable to replicate the Electrum addresses and am a bit lost at what is going wrong

My current test code:

import bitcoin as btc

electrum_master_public_key = 'xpub67xegn2C1yS...'

for i in xrange( 5 ):
    print btc.pubkey_to_address( btc.bip32_descend( electrum_master_public_key, [0,i] ) )

All my generated addresses start with a 1 whereas Electrum’s star with 3. Would appreciate if somebody would help me to link the two.



Source link

What do you think?

Written by BTC Artist

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

Bitcoin

Bitcoin Mining Hashrate Registers Third Largest 3-Month Spike In Last 5 Years

Polygon (MATIC) Launches New zkEVM Mainnet Beta With $1,000,000 Bug Bounty Program

Polygon (MATIC) Launches New zkEVM Mainnet Beta With $1,000,000 Bug Bounty Program