Author

Topic: Receiving address generated by `bitmerchant` doesn't show in Electrum. (Read 109 times)

legendary
Activity: 3710
Merit: 1586
1. m/0/2 is the derivation path. see  bip32:

https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki

You can derive an entire hierarchy of key pairs and addresses from a seed and the derivation path denotes where in the tree your particular key pair/address are.

2. No you can't since I've only shown you how to derive the one private key. You better use electrum in watch only mode and use the electrum command line interface to derive addresses. on linux `electrum help` should show you the command line options.

3. Electrum gets slow when you have a lot of addresses and you have to be mindful of the gap limit as well.  The gap limit is the number of unused addressses that electrum keeps track of. By default it is just 20. So if you need thousands of adddresses you may be better of using bitcoin core
newbie
Activity: 2
Merit: 3
Hey everybody.

I generated receiving address using `bitmerchant`
Here is how I did it using the example from official website:

Code:
root# python
Python 3.9.9 (main, Dec 21 2021, 10:03:34)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from bitmerchant.wallet import Wallet
>>> w=Wallet.deserialize('xpub661MyMwAqRbcFciEbeqHfsrGpXYWCL1NPNjop7W5XQR79ZHJqLCPVn9BcJDJeFzkTuDNPGZ5zg5Qhp1X4WLDUpRsFro86KTqPR9pYY6sfzm')
>>> w.create_new_address_for_user(2).to_address()
'17cKY31xCa9gzmEF8Fn82HpA1YtAn56kCp'

After it, I sent from my Electrum wallet to the `17cKY31xCa9gzmEF8Fn82HpA1YtAn56kCp` 0.0001BTC.
here is the transaction that confirm that transfer was success.

But on my Electrum I didn't find the income on the History tab (only exchange income) and there is no address `17cKY31xCa9gzmEF8Fn82HpA1YtAn56kCp` in the Address tab.

Is there a way to receive these generated addresses automatically and notification/information directly in Electrum? I would like to generate these addresses on my website side and manage BTC on my laptop through Electrum.
The derived address you posted is the third address at m/ whereas Electrum standard wallet (P2PKH addresses) are derived at m/0.
You have to find a way to feed the derivation path to your code so that you get correct keys.
Code:
m/2 -> 17cKY31xCa9gzmEF8Fn82HpA1YtAn56kCp
m/0/2 -> 1KoyfEmjmmuhGLeMPJe2XmZx5UzNcMk2uh

P.S. The better idea is to use Electrum itself instead of a third party library.

First of all, I would like to say thank you all for your replies.

I have additional questions:
1) What is `m/0/2` and `/m/2` what is the different and how did you get it?
2) That way, could I use `bitmetchant` pythonic library and receive bitcoins generated by the library in my "second" bitcoin wallet created by `Abdussamad` suggestions?
3) How many addresses I could generate and see in the wallet? 1000 ?
Thanks in advance!
legendary
Activity: 3710
Merit: 1586
You can derive the corresponding private key by going to the console tab (view menu > show console if it isn't visible) and typing in this code:

Code:
from electrum import bip32 as bip32
from electrum import bitcoin as bitcoin
mk=bip32.BIP32Node.from_xkey(getmasterprivate())
mkderived=mk.subkey_at_private_derivation("m/2")
bitcoin.serialize_privkey(mkderived.eckey.get_secret_bytes(), True, "p2pkh")

You may be asked to enter your password at some point in this process.

Then you copy what it spits out to the clipboard (p2pkh:...) and either sweep the private key (will cost you fees) or create an imported private key wallet with it:

https://bitcoinelectrum.com/sweeping-your-private-keys-into-electrum/
https://bitcoinelectrum.com/importing-your-private-keys-into-electrum/
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
Is there a way to receive these generated addresses automatically and notification/information directly in Electrum? I would like to generate these addresses on my website side and manage BTC on my laptop through Electrum.
Try Electrum's merchant wallet: https://electrum.readthedocs.io/en/latest/merchant.html
Basically, you'll have to run a watching-only Electrum daemon on your website's server and from there, you can create payment requests containing addresses.

bitmerchant is a bad idea since the project is long abandoned as the warnings in their repo state.
legendary
Activity: 3472
Merit: 10611
The derived address you posted is the third address at m/ whereas Electrum standard wallet (P2PKH addresses) are derived at m/0.
You have to find a way to feed the derivation path to your code so that you get correct keys.
Code:
m/2 -> 17cKY31xCa9gzmEF8Fn82HpA1YtAn56kCp
m/0/2 -> 1KoyfEmjmmuhGLeMPJe2XmZx5UzNcMk2uh

P.S. The better idea is to use Electrum itself instead of a third party library.
newbie
Activity: 2
Merit: 3
Hey everybody.

I generated receiving address using `bitmerchant`
Here is how I did it using the example from official website:

Code:
root# python
Python 3.9.9 (main, Dec 21 2021, 10:03:34)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from bitmerchant.wallet import Wallet
>>> w=Wallet.deserialize('xpub661MyMwAqRbcFciEbeqHfsrGpXYWCL1NPNjop7W5XQR79ZHJqLCPVn9BcJDJeFzkTuDNPGZ5zg5Qhp1X4WLDUpRsFro86KTqPR9pYY6sfzm')
>>> w.create_new_address_for_user(2).to_address()
'17cKY31xCa9gzmEF8Fn82HpA1YtAn56kCp'

After it, I sent from my Electrum wallet to the `17cKY31xCa9gzmEF8Fn82HpA1YtAn56kCp` 0.0001BTC.
here is the transaction that confirm that transfer was success.

But on my Electrum I didn't find the income on the History tab (only exchange income) and there is no address `17cKY31xCa9gzmEF8Fn82HpA1YtAn56kCp` in the Address tab.

Is there a way to receive these generated addresses automatically and notification/information directly in Electrum? I would like to generate these addresses on my website side and manage BTC on my laptop through Electrum.
Jump to: