Bitcoin Forum

Bitcoin => Electrum => Topic started by: dude1234321 on January 31, 2022, 11:31:21 AM



Title: old electrum software
Post by: dude1234321 on January 31, 2022, 11:31:21 AM
hi,

the old version of electrum (before 12 word seed phrase circa 2012 / 2013), if you had a private key and generated a new address, it would also generate another key for that address. was this new key related to the previous key in any way? i.e. was it deterministic or was it randomly generated?

thanks in advance for any answers


Title: Re: old electrum software
Post by: nc50lc on January 31, 2022, 11:40:21 AM
According to the initial release, it is deterministic: github.com/spesmilo/electrum/tree/6db1a31e58ee15c448448139e7d3a9e72b14268f (http://github.com/spesmilo/electrum/tree/6db1a31e58ee15c448448139e7d3a9e72b14268f)
But there's no description that it accepts private key, only "passphrase" that will be used as seed.

note: I haven't used the initial release so it's all based from the available data in the repository, some old-timers might have better answers.


Title: Re: old electrum software
Post by: dude1234321 on January 31, 2022, 11:45:30 AM
yeah im not convinced by the term 'passphrase' - that might be in relation to bep38 keys rather than WIF keys that were imported


Title: Re: old electrum software
Post by: BlackHatCoiner on January 31, 2022, 11:48:04 AM
if you had a private key and generated a new address, it would also generate another key for that address
This doesn't seem right. If it had given you an address it could be matched with only one private key from your wallet. You're saying that one address could be resulted from two different private keys, aren't you?

was this new key related to the previous key in any way? i.e. was it deterministic or was it randomly generated?
Electrum always generated keys in a deterministic way.


Title: Re: old electrum software
Post by: dude1234321 on January 31, 2022, 11:57:19 AM
if you had a private key and generated a new address, it would also generate another key for that address
This doesn't seem right. If it had given you an address it could be matched with only one private key from your wallet. You're saying that one address could be resulted from two different private keys, aren't you?

was this new key related to the previous key in any way? i.e. was it deterministic or was it randomly generated?
Electrum always generated keys in a deterministic way.

well im just wondering if the import key was used to generate the next key / address?

so import key 5xxx - which gives address 1xxx
generate new address - 1yyyy - underneath this also generates key 5yyyy.


so will 5yyy always be generated if you import 5xxx first?


thinking about it, im guessing its not deterministic in that way. i guess i can just test it out.


Title: Re: old electrum software
Post by: BlackHatCoiner on January 31, 2022, 12:03:56 PM
so will 5yyy always be generated if you import 5xxx first?

Note sure that I understand what you're saying. 1yyy would always be generated if you had the private key which was used to calculate it; in this case, 5yyyy. The order doesn't matter if you're just pasting them as WIF.


Title: Re: old electrum software
Post by: dude1234321 on January 31, 2022, 12:06:47 PM
yes so importing the first key has no bearing on the second key being generated. thanks for confirming what i thought.

deterministic in this sense is one key will always the same single address. but importing a key will have no impact on the next generated key.


Title: Re: old electrum software
Post by: Charles-Tim on January 31, 2022, 01:45:10 PM
yes so importing the first key has no bearing on the second key being generated. thanks for confirming what i thought.

deterministic in this sense is one key will always the same single address. but importing a key will have no impact on the next generated key.
Probably you are confusing yourself as a result of not knowing much about HD wallet, keys and addresses.

There are two types of wallet in this regard:

  • the old wallet which only generates single keys paired with an address, called non-deterministic wallet
  • later, deterministic wallet was created, with this, seed phrase, the seed or the master private key can generate as many as possible child keys and addresses in hierarchical deterministic manner

The child keys and addresses in hierarchical deterministic wallet corresponds to the keys generated on non-deterministic wallet. And if you backup a single private key paired to an address (or child private key in HD wallet), it can only generate the corresponding public key and address, it can never generate another public key or address.


Title: Re: old electrum software
Post by: nc50lc on February 01, 2022, 05:55:02 AM
@dude1234321 May I ask, what's the goal in asking about the old version's key derivation? This might be an "XY problem" (wiki XY problem (https://en.wikipedia.org/wiki/XY_problem)).

BTW, you can find Electrum's commits in the link below and browse the repository's state at that point by clicking "<>" at the right side of the commits.
The link is at the initial release, click "newer" for the later versions.
here: github.com/spesmilo/electrum/commits/master?after=baff4fa6259372b667042dae808123bfcb0f0964+13980&branch=master (http://github.com/spesmilo/electrum/commits/master?after=baff4fa6259372b667042dae808123bfcb0f0964+13980&branch=master)

There are too many versions before the seed phrase implementation, so you might be needing the link for your research.