polkadot-js / common

Utilities and base libraries for use across polkadot-js for Polkadot and Substrate. Includes base libraries, crypto helpers and cross-environment helpers.
Apache License 2.0
254 stars 147 forks source link

Can the seed be recovered from the secret key? #1899

Closed AurevoirXavier closed 10 months ago

AurevoirXavier commented 11 months ago

Based on our previous discussion at https://github.com/polkadot-js/common/issues/1759#issuecomment-1468172499, I discovered that obtaining the seed in this manner is incorrect. The initial 32 bytes do not correspond to the seed. After conducting further research, I learned that certain secret keys are derived from the seed, making it impossible to retrieve the seed from the key. Therefore, is it possible to obtain the seed in this context?

AurevoirXavier commented 11 months ago

After reviewing the implementation at https://github.com/w3f/schnorrkel, I believe this is not feasible. The term "Seed" refers to what they call a MiniSecretKey, while the SecretKey is derived from the MiniSecretKey using certain hash functions.

jacogr commented 10 months ago

Indeed. It is a one-way hashing to get to the other side.

polkadot-js-bot commented 10 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.