Understanding the new (0.21.x) .key format

Previous to the 0.21.x release I understood that a secret string in the keystore file was a joint value of the public key (first 32 bytes) and the private key (latter 32 bytes).
However; since the new release the string has been reduced to 44 bytes where im a bit lost in the new format.

Is there any documentation / change notes about this?

Many thanks in advance!

6 Likes

After checking the repo it seems that the format is;

(byte) Scheme
(byte[32]) Private Key

where as the Scheme byte is:

            SignatureScheme::ED25519 => 0x00,
            SignatureScheme::Secp256k1 => 0x01,
            SignatureScheme::Secp256r1 => 0x02,
            SignatureScheme::BLS12381 => 0xff,

would still be happy if someone could confirm this :slight_smile:

4 Likes

This post was flagged by the community and is temporarily hidden.

3 Likes

Wallet keystore now only stores flag || privkey instead of flag || privkey || pubkey.
More docs on this in here https://github.com/MystenLabs/sui/pull/6989.

5 Likes

appreciate the swift response. Thanks!