smoldot icon indicating copy to clipboard operation
smoldot copied to clipboard

Add a keystore

Open tomaka opened this issue 5 years ago • 2 comments

I'm opening this issue mostly to keep notes.

As it took me a while to figure this out, the cryptographic code of Substrate that creates //Alice is found mostly here:

  • https://github.com/paritytech/substrate/blob/9455912f309afef4e01d23bb114ec66fb0c567bb/primitives/core/src/sr25519.rs
  • https://github.com/paritytech/substrate/blob/b4cdef239d1de7a9b93b906b6c860f6246b0d887/primitives/core/src/crypto.rs

The derive function takes as parameter the path (e.g. Alice) and a seed. The seed is hardcoded for the publicly-known keys such as //Alice.

The sr25519 secret key of //Alice as obtained by calling schnorrkel::SecretKey::to_bytes() is:

[51, 166, 243, 9, 63, 21, 138, 113, 9, 246, 121, 65, 11, 239, 26, 12, 84, 22, 129, 69, 224, 206, 203, 77, 240, 6, 193, 194, 255, 251, 31, 9, 146, 90, 34, 93, 151, 170, 0, 104, 45, 106, 89, 185, 91, 24, 120, 12, 16, 215, 3, 35, 54, 232, 143, 52, 66, 180, 35, 97, 244, 166, 96, 17]

The ed25519 private key of //Alice is:

[136, 220, 52, 23, 213, 5, 142, 196, 180, 80, 62, 12, 18, 234, 26, 10, 137, 190, 32, 15, 233, 137, 34, 66, 61, 67, 52, 1, 79, 166, 176, 238]

tomaka avatar Nov 03 '20 19:11 tomaka

Linking here for reference. Encrypted memory: https://docs.sequoia-pgp.org/sequoia_openpgp/crypto/mem/struct.Encrypted.html https://docs.sequoia-pgp.org/src/sequoia_openpgp/crypto/mem.rs.html#217-220

tomaka avatar Dec 17 '20 11:12 tomaka

A keystore is now available but it is just a draft.

tomaka avatar Oct 31 '21 17:10 tomaka

Closing after https://github.com/paritytech/smoldot/pull/2881

tomaka avatar Oct 25 '22 07:10 tomaka