Stake Pool Commands

The torsten-cli stake-pool subcommands manage stake pool key generation, pool registration, and operational certificate issuance.

key-gen

Generate pool cold keys and an operational certificate counter:

torsten-cli stake-pool key-gen \
  --cold-verification-key-file cold.vkey \
  --cold-signing-key-file cold.skey \
  --operational-certificate-counter-file opcert.counter
FlagRequiredDescription
--cold-verification-key-fileYesOutput path for the cold verification key
--cold-signing-key-fileYesOutput path for the cold signing key
--operational-certificate-counter-fileYesOutput path for the opcert issue counter

id

Get the pool ID (Blake2b-224 hash of the cold verification key):

torsten-cli stake-pool id \
  --cold-verification-key-file cold.vkey
FlagRequiredDescription
--cold-verification-key-fileYesPath to the cold verification key

vrf-key-gen

Generate a VRF key pair:

torsten-cli stake-pool vrf-key-gen \
  --verification-key-file vrf.vkey \
  --signing-key-file vrf.skey
FlagRequiredDescription
--verification-key-fileYesOutput path for the VRF verification key
--signing-key-fileYesOutput path for the VRF signing key

kes-key-gen

Generate a KES key pair:

torsten-cli stake-pool kes-key-gen \
  --verification-key-file kes.vkey \
  --signing-key-file kes.skey
FlagRequiredDescription
--verification-key-fileYesOutput path for the KES verification key
--signing-key-fileYesOutput path for the KES signing key

issue-op-cert

Issue an operational certificate:

torsten-cli stake-pool issue-op-cert \
  --kes-verification-key-file kes.vkey \
  --cold-signing-key-file cold.skey \
  --operational-certificate-counter-file opcert.counter \
  --kes-period 400 \
  --out-file opcert.cert
FlagRequiredDescription
--kes-verification-key-fileYesPath to the KES verification key
--cold-signing-key-fileYesPath to the cold signing key
--operational-certificate-counter-fileYesPath to the opcert issue counter
--kes-periodYesCurrent KES period
--out-fileYesOutput path for the operational certificate

registration-certificate

Create a stake pool registration certificate:

torsten-cli stake-pool registration-certificate \
  --cold-verification-key-file cold.vkey \
  --vrf-verification-key-file vrf.vkey \
  --pledge 500000000 \
  --cost 340000000 \
  --margin 0.02 \
  --reward-account-verification-key-file stake.vkey \
  --pool-owner-verification-key-file stake.vkey \
  --single-host-pool-relay "relay.example.com:3001" \
  --metadata-url "https://example.com/pool-metadata.json" \
  --metadata-hash "a1b2c3d4..." \
  --out-file pool-reg.cert
FlagRequiredDescription
--cold-verification-key-fileYesPath to the cold verification key
--vrf-verification-key-fileYesPath to the VRF verification key
--pledgeYesPledge amount in lovelace
--costYesFixed cost per epoch in lovelace
--marginYesPool margin (0.0 to 1.0)
--reward-account-verification-key-fileYesStake key for the reward account
--pool-owner-verification-key-fileNoPool owner stake key (can be repeated)
--pool-relay-ipv4NoRelay IP address with port (e.g., 1.2.3.4:3001)
--single-host-pool-relayNoRelay DNS hostname with port (e.g., relay.example.com:3001)
--multi-host-pool-relayNoRelay DNS SRV record (e.g., _cardano._tcp.example.com)
--metadata-urlNoURL to pool metadata JSON
--metadata-hashNoBlake2b-256 hash of the metadata file (hex)
--testnetNoUse testnet network ID for the reward account
--out-fileYesOutput path for the certificate

metadata-hash

Compute the Blake2b-256 hash of a pool metadata file:

torsten-cli stake-pool metadata-hash \
  --pool-metadata-file pool-metadata.json

Output:

a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2

This hash is required when registering a pool. The metadata file must be served at the URL specified in the registration certificate and the hash must match. The file contents at that URL are checked by other nodes during pool discovery.

Example pool metadata file:

{
  "name": "Sandstone Pool",
  "description": "A Cardano stake pool running Torsten",
  "ticker": "SAND",
  "homepage": "https://sandstone.io"
}

retirement-certificate

Create a stake pool retirement certificate:

torsten-cli stake-pool retirement-certificate \
  --cold-verification-key-file cold.vkey \
  --epoch 500 \
  --out-file pool-retire.cert
FlagRequiredDescription
--cold-verification-key-fileYesPath to the cold verification key
--epochYesEpoch at which the pool retires
--out-fileYesOutput path for the certificate

Complete Pool Registration Workflow

# 1. Generate all keys
torsten-cli stake-pool key-gen \
  --cold-verification-key-file cold.vkey \
  --cold-signing-key-file cold.skey \
  --operational-certificate-counter-file opcert.counter

torsten-cli stake-pool vrf-key-gen \
  --verification-key-file vrf.vkey \
  --signing-key-file vrf.skey

torsten-cli stake-pool kes-key-gen \
  --verification-key-file kes.vkey \
  --signing-key-file kes.skey

# 2. Issue operational certificate
torsten-cli stake-pool issue-op-cert \
  --kes-verification-key-file kes.vkey \
  --cold-signing-key-file cold.skey \
  --operational-certificate-counter-file opcert.counter \
  --kes-period 400 \
  --out-file opcert.cert

# 3. Create registration certificate
torsten-cli stake-pool registration-certificate \
  --cold-verification-key-file cold.vkey \
  --vrf-verification-key-file vrf.vkey \
  --pledge 500000000 \
  --cost 340000000 \
  --margin 0.02 \
  --reward-account-verification-key-file stake.vkey \
  --pool-owner-verification-key-file stake.vkey \
  --single-host-pool-relay "relay.example.com:3001" \
  --metadata-url "https://example.com/pool.json" \
  --metadata-hash "a1b2c3..." \
  --out-file pool-reg.cert

# 4. Submit registration in a transaction
torsten-cli transaction build \
  --tx-in "abc123...#0" \
  --tx-out "addr_test1qz...+5000000" \
  --change-address "addr_test1qp..." \
  --fee 200000 \
  --certificate-file pool-reg.cert \
  --out-file tx.body

torsten-cli transaction sign \
  --tx-body-file tx.body \
  --signing-key-file payment.skey \
  --signing-key-file cold.skey \
  --signing-key-file stake.skey \
  --out-file tx.signed

torsten-cli transaction submit \
  --tx-file tx.signed \
  --socket-path ./node.sock