forex.pm forex forum binary options trade - Binance - Сryptocurrency exchanges - How to generate Electrum address with pybitcointools
  • Welcome to forex.pm forex forum binary options trade. Please login or sign up.
 

How to generate Electrum address with pybitcointools

Started by Bitcoin, Apr 02, 2022, 04:44 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bitcoin

How to generate Electrum address with pybitcointools

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: How to generate Electrum address with pybitcointools