Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electrum 2.0+ inconsistency between zpub derivation and mnemonic derivation. #52

Open
FreePower opened this issue Sep 13, 2023 · 0 comments

Comments

@FreePower
Copy link

Hello everybody.

Let me expose to you this topic ; this is probably not an issue, but a parameter missing.

Notice : the given example is a not funded wallet :)

Directly from Electrum, is can catch both zpub key and associated mnemonic from the creation :

zpub : zpub6myh1oJc7E2KJVAdMfSPcPYpp4ZMaCWczoY1JPbrQ5PvkN43kpYEyjhmzcGd3GAdyVYNLVWXwF8ft14mWb9f7VskRXYKHxcgqrVVRnMR7E4

mnemonic : achieve blanket access middle box lady gain era office depth joy rival

Using the key directly give good addresses derivation, compliant with Electrum :

./hd-wallet-derive.php -g --key=zpub6myh1oJc7E2KJVAdMfSPcPYpp4ZMaCWczoY1JPbrQ5PvkN43kpYEyjhmzcGd3GAdyVYNLVWXwF8ft14mWb9f7VskRXYKHxcgqrVVRnMR7E4 --numderive=3 --path="m/0" --cols=path,address --loglevel=debug
2023-09-13T05:52:33+00:00 [pid: 20549] [info] -- Deriving keys
2023-09-13T05:52:33+00:00 [lastlog: 0.040738 secs] [pid: 20549] [info] -- Derived 3 keys

+-------+--------------------------------------------+
| path | address |
+-------+--------------------------------------------+
| m/0/0 | bc1qmmmal9gs3sy7k30deyrgqwjhv4pwvhqw44t6s0 |
| m/0/1 | bc1qc7x9g660t4yg6t9c7eftdunpfxu53uw2rarvfv |
| m/0/2 | bc1qw4u3svtu6ut44xus6gc4lu5glx8tluf3kc6qtp |
+-------+--------------------------------------------+

However, using the mnemonic give NOT compliant results :

./hd-wallet-derive.php -g --mnemonic="achieve blanket access middle box lady gain era office depth joy rival" --numderive=3 --path="m/0" --cols=path,address --loglevel=debug
2023-09-13T05:55:00+00:00 [pid: 20555] [info] -- Deriving keys
2023-09-13T05:55:00+00:00 [lastlog: 0.053811 secs] [pid: 20555] [info] -- Derived 3 keys

+-------+------------------------------------+
| path | address |
+-------+------------------------------------+
| m/0/0 | 169RK1Gjv93RGiucptUhF2xzMBv4SuMSfV |
| m/0/1 | 1Dry68xmoLTZcXNLveA6EavLYEYutFZfZt |
| m/0/2 | 1GznvpYFSMXpPnCVqcfKh4V9asptRmPada |
+-------+------------------------------------+

I guess I have to add the --mnemonic-pw parameter ; I was doing dozen of tries and even look inside the electrum source software, it is unclear to me (sometimes it is related to hard coded 'Bitcoin seed', 'Electrum seed', a version number, a version tag...)

Someone have an idea ?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant