Manage private keys

Overview

The Credit Smart Chain has two types of private keys that it directly manages:

  • Private key used for the consensus mechanism

  • Private key used for networking by libp2p

Currently, the Credit Smart Chain doesn't offer support for direct account management.

Based on the directory structure outlined in the Backup & Restore guide, the Credit Smart Chain stores these mentioned key files in two distinct directories - consensus and keystore.

Key format

The private keys are stored in simple Base64 format, so they can be human-readable and portable.

# Example private key
0802122068a1bdb1c8af5333e58fe586bc0e9fc7aff882da82affb678aef5d9a2b9100c0

Consensus Private Key

The private key file mentioned as the consensus private key is also referred to as the validator private key. This private key is used when the node is acting as a validator in the network and needs to sign new data.

The private key file is located in consensus/validator.key, and adheres to the key format mentioned.

Networking Private Key

The private key file mentioned for networking is used by libp2p to generate the corresponding PeerID, and allow the node to participate in the network.

It is located in keystore/libp2p.key, and adheres to the key format mentioned.

Import / Export

As the key files are stored in simple Base64 on disk, they can be easily backed up or imported.

Last updated