Movatterモバイル変換


[0]ホーム

URL:


#16
ActiveTools

Cryptographic Key Serialisation Formats

Created on  by Luke Nadur

Abstract

This CIP defines serialisation formats for the following types ofcryptographic keys across the Cardano eco-system:

  • Regular Ed25519 keys

  • BIP32-Ed25519 extended keys(Ed25519 extended keys with BIP32-style derivation)

Motivation

Throughout the Cardano eco-system, different projects have used differentserialisation formats for cryptographic keys.

For example, for BIP32-Ed25519 extended signing keys, thecardano-cryptoimplementation supports a 128-byte binary serialization format, whilejcliandcardano-addressessupports a 96-byte binary serialization format.

Another example would becardano-cli whichsupports a custom JSON format, referred to as "text envelope", (which can beused for serialising keys) that isn't supported by other projects in theeco-system.

This has introduced compatibility problems for both users and developers:

  • Users cannot easily utilize their keys across different tools and softwarein the Cardano eco-system as they may be serialized in different ways.

  • Developers wanting to support the different serialisation formats may needto write potentially error-prone (de)serialisation and conversionoperations.

Therefore, this CIP aims to define standard cryptographic key serialisationformats to be used by projects throughout the Cardano eco-system.

Specification

Verification Keys

For the verification (public) key binary format, we simply use the raw 32-byteEd25519 public key data.

This structure should be Bech32 encoded, using one of the appropriate*_vkprefixes defined in CIP-0005.

Extended Verification Keys

For extended verification (public) keys, we define the following 64-bytebinary format:

+-----------------------+-----------------------+| Public Key (32 bytes) | Chain Code (32 bytes) |+-----------------------+-----------------------+

That is, a 32-byte Ed25519 public key followed by a 32-byte chain code.

This structure should be Bech32 encoded, using one of the appropriate*_xvkprefixes defined in CIP-0005.

Signing Keys

For the signing (private) key binary format, we simply use the raw 32-byteEd25519 private key data.

This structure should be Bech32 encoded, using one of the appropriate*_skprefixes defined in CIP-0005.

Extended Signing Keys

For extended signing (private) keys, we define the following 96-byte binaryformat:

+---------------------------------+-----------------------+| Extended Private Key (64 bytes) | Chain Code (32 bytes) |+---------------------------------+-----------------------+

That is, a 64-byte Ed25519 extended private key followed by a 32-byte chaincode.

This structure should be Bech32 encoded, using one of the appropriate*_xskprefixes defined in CIP-0005.

Rationale

Extended Signing Key Format

As mentioned in theAbstract, the originalcardano-cryptoimplementation defined a 128-byte binary serialization format forBIP32-Ed25519 extended signing keys:

+---------------------------------+-----------------------+-----------------------+| Extended Private Key (64 bytes) | Public Key (32 bytes) | Chain Code (32 bytes) |+---------------------------------+-----------------------+-----------------------+

However, as it turns out, keeping around the 32-byte Ed25519 public key isredundant as it can easily be derived from the Ed25519 private key (the first32 bytes of the 64-byte extended private key).

Therefore, because other projects such asjcliandcardano-addressesalready utilize the more compact 96-byte format, we opt to define that as thestandard.

Path to Active

Acceptance Criteria

Implementation Plan

N/A

Copyright

This CIP is licensed underApache-2.0.


[8]ページ先頭

©2009-2025 Movatter.jp