Skip to content

JIP-5: Secret key derivation - #2

Merged
zdave-parity merged 5 commits into
mainfrom
dave/jip-5
Sep 2, 2025
Merged

JIP-5: Secret key derivation#2
zdave-parity merged 5 commits into
mainfrom
dave/jip-5

Conversation

@zdave-parity

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread JIP-5.md Outdated
Comment thread JIP-5.md Outdated
Comment thread JIP-5.md Outdated
Comment thread JIP-5.md Outdated
Comment thread JIP-5.md Outdated
This is not universally supported by BLAKE2 libraries.
Comment thread JIP-5.md Outdated
ggwpez added a commit to JamBrains/jam-docs that referenced this pull request May 25, 2025
Add changes from
[JIP-5](polkadot-fellows/JIPs#2). Preview is
[here](https://jam-docs-pr-47.onrender.com/basics/dev-accounts):
- Fix Dev Accounts
- Re-create Genesis Header and hashes

---------

Signed-off-by: Oliver Tale-Yazdi <oliver@tasty.limo>
Also, tweak naming again.

@ggwpez ggwpez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming is clear now, thanks!

sourabhniyogi added a commit to jam-duna/coreplay that referenced this pull request May 27, 2025
sourabhniyogi added a commit to jam-duna/coreplay that referenced this pull request May 27, 2025
@Sajjon

Sajjon commented May 28, 2025

Copy link
Copy Markdown

Just for the sake of discussion - it is my understanding that this is a "custom" HD derivation implementation supporting Curve25519 (Ed25519), right?

Has using "industry standard" SLIP10 instead been discussed / considered?

The advantage of using that is to be compatible with e.g. hardware wallets such as Ledger and Trezor.

However, @zdave-parity has on Elements explain a bit more and maybe SLIP10 is not suitable here.

@zdave-parity

Copy link
Copy Markdown
Collaborator Author

Just for the sake of discussion - it is my understanding that this is a "custom" HD derivation implementation supporting Curve25519 (Ed25519), right?

Has using "industry standard" SLIP10 instead been discussed / considered?

The advantage of using that is to be compatible with e.g. hardware wallets such as Ledger and Trezor.

However, @zdave-parity has on Elements explain a bit more and maybe SLIP10 is not suitable here.

SLIP10 appears to be pretty similar to this, but does not support Bandersnatch AFAICT, so is not directly usable.

FWIW this key derivation method will never be required; the derived public keys are completely unrelated so it could not be. The point of a standard derivation method is just to make it easy to switch validator impls while keeping the same secret keys. This is particularly useful for testing, but could potentially be useful in a production setting. In the case where the secrets are stored in a hardware "wallet", and there is some flexibility in how the public keys are derived, it may be useful to standardise that. But it seems to me that is likely to be device-specific. In any case I think it's out-of-scope for this particular JIP.

@danicuki

Copy link
Copy Markdown
Contributor

BLS keys won't be part of JIP-5?

I also suggest to explicitly explain that we can generate scalar secret by applying sha512 to the hashed key:
Seed -> hashed -> scalar

Bandersnatch library can directly take the scalar seed and return the key pair.

In case of ed25519 the secret key is the hashed seed. In bandersnatch no, which causes a bit confusion.

@zdave-parity

Copy link
Copy Markdown
Collaborator Author

BLS key derivation will be specified, I just haven't looked into the details yet. The BLS key will only be used for BEEFY AFAIK, and the network protocols for that have not yet been defined.

I also suggest to explicitly explain that we can generate scalar secret by applying sha512 to the hashed key

This is covered in https://ed25519.cr.yp.to/ed25519-20110926.pdf for Ed25519 and appendix A.1 of https://github.com/davxy/bandersnatch-vrf-spec/blob/main/specification.pdf for Bandersnatch. Both of these are explicitly referenced, with the terms defined in this JIP linked to the terms defined in the docs. If you think this can be clearer, please suggest a concrete change. I don't particularly want to repeat the contents of either doc in this JIP though.

In case of ed25519 the secret key is the hashed seed. In bandersnatch no, which causes a bit confusion.

Please note that ed25519_secret_seed is also passed through SHA-512 to produce a secret scalar, as documented in https://ed25519.cr.yp.to/ed25519-20110926.pdf. The difference is really just that the Ed25519 document refers to ed25519_secret_seed as a "secret key" while the Bandersnatch document refers to bandersnatch_secret_seed as a "seed". There's not much I can do about that.

@ggwpez

ggwpez commented Sep 2, 2025

Copy link
Copy Markdown
Member

I would vouch for this getting merged, as there was enough time to voice concerns.

@zdave-parity
zdave-parity merged commit d012f60 into main Sep 2, 2025
@zdave-parity
zdave-parity deleted the dave/jip-5 branch September 2, 2025 15:22
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

Successfully merging this pull request may close these issues.

5 participants