cardano::stake_pool::ExtendedColdSigningKey class

A CIP-1853 stake pool signing key (extended Ed25519 signing key).

Public static functions

static auto fromMnemonic(const cardano::Mnemonic& mn) →  ExtendedColdSigningKey
Derive the stake pool key from a seed phrase. Derive the stake pool signing key from a BIP-39 complient mnemonic seed phrase following the algorithms outlined in CIP-3, CIP-1852, and CIP-1853.
static auto fromRootKey(const bip32_ed25519::PrivateKey& root) →  ExtendedColdSigningKey
Derive the stake pool key from a root key. Derive the stake pool signing key from a root HD wallet key following the derivation outlined in CIP-1852 and CIP-1853.
static auto generate() →  ExtendedColdSigningKey

Public functions

auto asBech32() const →  std::string
Serialize the key bytes as a Bech32 string.
auto bytes() const →  const bip32_ed25519::KeyByteArray& constexpr
Return the key as a byte vector.
auto poolId() →  std::array< uint8_t, STAKE_POOL_ID_SIZE > -> auto
Generate the pool ID as an array of bytes.
void saveToFile(std::string_view fpath) const
Export the key to a file in the cardano node JSON format.
auto sign(std::span<const uint8_t> msg) const →  std::array< uint8_t, ed25519::SIGNATURE_SIZE > -> auto
auto verificationKey() const →  ColdVerificationKey
Derive the corresponding verification (public) key.

Function documentation

static ExtendedColdSigningKey cardano::stake_pool::ExtendedColdSigningKey::fromMnemonic(const cardano::Mnemonic& mn)

Derive the stake pool key from a seed phrase. Derive the stake pool signing key from a BIP-39 complient mnemonic seed phrase following the algorithms outlined in CIP-3, CIP-1852, and CIP-1853.

Parameters
mn A valid mnemonic seed phrase.
Returns A valid stake pool signing key object.

static ExtendedColdSigningKey cardano::stake_pool::ExtendedColdSigningKey::fromRootKey(const bip32_ed25519::PrivateKey& root)

Derive the stake pool key from a root key. Derive the stake pool signing key from a root HD wallet key following the derivation outlined in CIP-1852 and CIP-1853.

Parameters
root The root signing key.

static ExtendedColdSigningKey cardano::stake_pool::ExtendedColdSigningKey::generate()

Factory method to create a new Ed25519 private key from a cryptographically secure random number generator.

std::string cardano::stake_pool::ExtendedColdSigningKey::asBech32() const

Serialize the key bytes as a Bech32 string.

Returns String representing the formatted key.

auto cardano::stake_pool::ExtendedColdSigningKey::poolId() →  std::array< uint8_t, STAKE_POOL_ID_SIZE >

Generate the pool ID as an array of bytes.

Returns Pool ID as an array of bytes.

void cardano::stake_pool::ExtendedColdSigningKey::saveToFile(std::string_view fpath) const

Export the key to a file in the cardano node JSON format.

Parameters
fpath Path to the file to be (over)written.

auto cardano::stake_pool::ExtendedColdSigningKey::sign(std::span<const uint8_t> msg) const →  std::array< uint8_t, ed25519::SIGNATURE_SIZE >

Parameters
msg A span of bytes (uint8_t) representing the message to sign.

ColdVerificationKey cardano::stake_pool::ExtendedColdSigningKey::verificationKey() const

Derive the corresponding verification (public) key.

Returns The verification key object.