cardano course
  • Welcome!
  • Video lessons
  • Handbook
    • Module 1. Building and running the node
      • Building the node
      • Running the node and connecting to a network
    • Module 2. Basic operations
      • Creating keys and addresses
      • Creating a simple transaction
      • Registering the stake address and delegating
    • Module 3. Protocol parameters and configuration files
      • Protocol parameters
      • Byron genesis file
      • Shelley genesis file
      • Alonzo genesis file
      • Conway genesis file
      • Node configuration file
      • Topology file
    • Module 4. Peer-to-peer (P2P) networking
    • Module 5. Creating a stake pool
      • The setup
      • Generating keys
      • Registering a stake pool
      • Runtime system options
      • Running the nodes
      • Stake snapshots
      • Upgrading cardano-node and cardano-cli
      • Pool operations and maintenance
      • Retiring a stake pool
    • Module 6. Monitoring the nodes
    • Module 7. Cardano governance
      • Update proposals
      • Polls
    • Module 8. Setting up a local cluster
      • Creating a local cluster
      • Spending the genesis UTXO
      • From Byron to Shelley
      • Moving funds to a Shelley address
      • Creating a first stake pool
      • Bringing decentralization parameter down to .80
      • From Shelley to Alonzo
      • Creating a second stake pool before moving to the Babbage era
      • Redelegating genesis keys
      • Vasil hard fork
      • Creating a local cluster with the mkfiles script
    • Module 9. Simple scripts and Plutus scripts
    • Module 10. New tracing system
    • Module 11. Running the SMASH server
    • Module 12. Running the token metadata server
  • Curated playlist
Powered by GitBook
On this page
  • Generating the artifacts
  • Payment and stake key pairs
  • Cold keys
  • Key evolving signature (KES) keys
  • Verifiable random function (VRF) keys
  • Upload keys to the block-producing node

Was this helpful?

Edit on GitHub
  1. Handbook
  2. Module 5. Creating a stake pool

Generating keys

First, you should register a stake pool using the following command:

cardano-cli stake-pool registration-certificate \
--cold-verification-key-file cold.vkey \
--vrf-verification-key-file vrf.vkey \
--pool-pledge <AMOUNT TO PLEDGE IN LOVELACE> \
--pool-cost <POOL COST PER EPOCH IN LOVELACE> \
--pool-margin <POOL OPERATOR MARGIN > \
--pool-reward-account-verification-key-file stake.vkey \
--pool-owner-stake-verification-key-file stake.vkey \
--testnet-magic 2 \
--pool-relay-ipv4 <RELAY NODE PUBLIC IP> \
--pool-relay-port <RELAY NODE PORT> \
--single-host-pool-relay STRING <The stake pool relay's DNS name that corresponds to an A or AAAA DNS record> \
--metadata-url https://git.io/JJWdJ \
--metadata-hash <POOL METADATA HASH> \
--out-file pool-registration.cert

Generating the artifacts

You will now need to generate all the following artifacts:

payment.vkey

payment verification key

payment.skey

payment signing key

payment.addr

funded address linked to stake

stake.vkey

staking verification key

stake.skey

staking signing key

stake.addr

registered stake address

cold.skey

cold signing key

cold.vkey

cold verification key

kes.skey

KES signing key

kes.vkey

KES verification key

vrf.skey

VRF signing key

vrf.vkey

VRF verification key

opcert.cert

operational certificate

opcert.counter

issue counter

metadata url

metadata hash

Payment and stake key pairs

WE WILL GENERATE KEYS IN OUR AIR-GAPPED MACHINE.

Payment and stake keys

Generate payment keys:

cardano-cli address key-gen \
--verification-key-file payment.vkey \
--signing-key-file payment.skey

Generate stake keys:

cardano-cli stake-address key-gen \
--verification-key-file stake.vkey \
--signing-key-file stake.skey

Generate the payment address:

cardano-cli address build \
--payment-verification-key-file payment.vkey \
--stake-verification-key-file stake.vkey \
--testnet-magic 2 \
--out-file payment.addr

Generate a recovery phrase and save it to a file:

cardano-address recovery-phrase generate > recoveryphrase.txt

Get the root private key:

cat recoveryphrase.txt | cardano-address key from-recovery-phrase Shelley > root.prv

Generate the private and public keys for the index 0 address:

cardano-address key child 1852H/1815H/0H/0/0    < root.prv > payment-0.prv
cardano-address key public --without-chain-code < payment-0.prv > payment-0.pub

Convert the private key so that it can be used within the cardano-cli:

cardano-cli key convert-cardano-address-key \
--shelley-payment-key \
--signing-key-file payment-0.prv \
--out-file payment-0.skey

Get the public (verification) key compatible with the cardano-cli:

cardano-cli key verification-key \
--signing-key-file payment-0.skey \
--verification-key-file payment-0.vkey

Generate the stake keys:

cardano-address key child 1852H/1815H/0H/2/0 < root.prv > stake.prv
cardano-address key public --without-chain-code < stake.prv > stake.pub

Convert:

cardano-cli key convert-cardano-address-key \
--shelley-stake-key \
--signing-key-file stake.prv \
--out-file stake.skey

Get the extended verification key:

cardano-cli key verification-key \
--signing-key-file stake.skey \
--verification-key-file stake.evkey

Also, get the non-extended verification key:

cardano-cli key non-extended-key \
--extended-verification-key-file stake.evkey \
--verification-key-file stake.vkey

Finally, generate the payment address:

cardano-cli address build --testnet-magic 2 \
--payment-verification-key $(cat payment-0.pub) \
--stake-verification-key $(cat stake.pub) \
--out-file payment-0.address

Also, generate the stake address:

cardano-cli stake-address build --testnet-magic 2 \
--stake-verification-key-file stake.pub \
--out-file stake.address

REQUEST FUNDS FROM THE FAUCET

Cold keys

cardano-cli node key-gen \
--cold-verification-key-file cold.vkey \
--cold-signing-key-file cold.skey \
--operational-certificate-issue-counter-file opcert.counter

Key evolving signature (KES) keys

cardano-cli node key-gen-KES \
--verification-key-file kes.vkey \
--signing-key-file kes.skey

Verifiable random function (VRF) keys

cardano-cli node key-gen-VRF \
--verification-key-file vrf.vkey \
--signing-key-file vrf.skey

Upload keys to the block-producing node

On the Block producer, run:

mkdir keys

Use a USB drive to bring kes.skey vrf.skey and opcert.cert to your working machine and from there, upload:

scp kes.skey vrf.skey opcert.cert username@host:/remote/directory

DO NOT COPY COLD KEYS OR PAYMENT KEYS TO THE BLOCK PRODUCER OR RELAY NODES.

PreviousThe setupNextRegistering a stake pool

Last updated 1 year ago

Was this helpful?