0

Cardano Serialization Lib has this class:

export class OperationalCert {
  free(): void;
/**
* @returns {Uint8Array}
*/
  to_bytes(): Uint8Array;
/**
* @param {Uint8Array} bytes
* @returns {OperationalCert}
*/
  static from_bytes(bytes: Uint8Array): OperationalCert;
/**
* @returns {KESVKey}
*/
  hot_vkey(): KESVKey;
/**
* @returns {number}
*/
  sequence_number(): number;
/**
* @returns {number}
*/
  kes_period(): number;
/**
* @returns {Ed25519Signature}
*/
  sigma(): Ed25519Signature;
/**
* @param {KESVKey} hot_vkey
* @param {number} sequence_number
* @param {number} kes_period
* @param {Ed25519Signature} sigma
* @returns {OperationalCert}
*/
  static new(hot_vkey: KESVKey, sequence_number: number, kes_period: number, sigma: Ed25519Signature): OperationalCert;
}

How can I generate the KESVKey and the Ed25519Signature required for issuing an OperationalCert using this library?

2 Answers 2

1

I do not think that Cardano-Serialization-Lib has KES key generation functionality. However, to create an OpCert, you only need the byte string of the KES verification key. If you've already generated the key, then you have the byte string (probably either in bech32 or CBOR format).

The op cert signature is an Ed25519 signature of the KES VKey, the sequence number, and the kes period all concatenated together (in that order) as a string of bytes. The integers are packed as 8-byte BigEndian vectors. The Cardano-Serialization-Lib does have an Ed25519 capability so generating the signature programmatically should be possible.

Update: libcardano is a C++ library that implements this capability. It is possible to pull C++ code into a Rust project if that is needed. Disclaimer: I am the author of libcardano.

0

There's no way, at the moment, to issue a stake pool operational certificate using cardano-serialization-lib.

I suggest using using cardanocli-js instead.

Like this:

const CardanocliJs = require("cardanocli-js");

const shelleyGenesisPath = "/path/to/your/testnet-shelley-genesis.json";
const options = {
  shelleyGenesisPath,
  network: "testnet-magic 1097911063"
};

const cardanocliJs = new CardanocliJs(options);

const nodeOperationalCert = cardanocliJs.nodeIssueOpCert(stakePoolName);
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.