<p>There's no way, at the moment, to issue a stake pool operational certificate using <code>cardano-serialization-lib</code>.</p>
<p>I suggest using using <a href="https://github.com/shareslake/cardanocli-js" rel="nofollow noreferrer"><code>cardanocli-js</code></a> instead.</p>
<p>Like this:</p>
<pre><code>const CardanocliJs = require(&quot;cardanocli-js&quot;);

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

const cardanocliJs = new CardanocliJs(options);

const nodeOperationalCert = cardanocliJs.nodeIssueOpCert(stakePoolName);
</code></pre>

CC BY-SA 4.0
2022-06-01T00:14:49.477Z
2022-06-01T02:50:14.587Z
2022-06-01T02:50:14.587Z
Falcon Stakepool
<p>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).</p>
<p>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.</p>
<p>Update: <a href="https://gitlab.com/viperscience/libcardano/-/blob/main/include/cardano/stake_pool.hpp?ref_type=heads#L375" rel="nofollow noreferrer">libcardano</a> 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.</p>

CC BY-SA 4.0
2023-11-30T03:02:11.800Z
2024-02-24T20:42:03.597Z
2024-02-24T20:42:03.597Z
nalyd88
<p>Cardano Serialization Lib has this class:</p>
<pre><code>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;
}
</code></pre>
<p>How can I generate the <code>KESVKey</code> and the <code>Ed25519Signature</code> required for issuing an <code>OperationalCert</code> using this library?</p>

<stake-pool><cardano-serialization-lib><types>
How can I issue an operational certificate using cardano-serialization-lib?
# How can I issue an operational certificate using cardano-serialization-lib?

(Asked by: username_0 on 2022-04-20)

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?

**Tags:** stake-pool, cardano-serialization-lib, types

---

## 2 answers

### Answer by username_0 on 2022-06-01. Score: 0 | Accepted answer

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);


---

### Answer by username_1 on 2023-11-30. Score: 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](https://gitlab.com/viperscience/libcardano/-/blob/main/include/cardano/stake_pool.hpp?ref_type=heads#L375) 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.


---

