Skip to content

Instantly share code, notes, and snippets.

@ilap
Last active May 24, 2020 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilap/a7eb990bf20d1223dfe546e7d7f2dcf8 to your computer and use it in GitHub Desktop.
Save ilap/a7eb990bf20d1223dfe546e7d7f2dcf8 to your computer and use it in GitHub Desktop.
Shelley Stakepool Pioneers Exercise Sheet 5

Shelley Stakepool Pioneers Exercise Sheet 5

  1. Run a pool to able to send transactions to the network
  2. Register a stake pool
  3. Delegate stake to your own stake pool
  4. Start a stake pool and produce blocks
  5. Receive delegation from other Pioneers

Keys, Addresses and Certificate relations

ShelleyKeyAndAddresses (1)

The addresses are just the blake2b-256 hash of the relevant veryifying/public keys, see examples below: The address is just a simple blake2b-256 hash of the verifying/public key.

  • Stake veryifying key to Address
Hexa string: 53cba6ad9b2d17ab50a3fe1889e442d55429453c36c51f74680d2ceb1d7c02d9
Blake2b-256: 32a8c3f17ae5dafc3e947f82b0b418483f0a8680def9418c87397f2bd3d35efb
  • Pool ID from Pool node operation key (a.k.a Cold verifiying key)
Hexa string: 5b4e12cc48b14a3d82e6d3e5ecdac599e6b97ca11186ed375b569f09d941363e
Blake2b-256: 3360b5b041f48d1a625bdb501d6cc16637394d8f27b908ebf75b4d6f6ece5e45

Run a pool to able to send transactions to the network

To be able to run a node as a stake pool, the node must have a

  • Node operator key pair (for evolving operator certificates), a
  • KES key pair (for protecting the blocks) and a
  • VRF key pair (signing the blocks).

Register a stake pool

The pool operator must submit a pool registration certificate that contains

  • the node operator's verifying key (pool.vkey)
  • the VRF verifying key (vrf.vkey)
  • the reward (account) verification key (owner.vkey)
  • the owner(s) staking verification key (staking.vkey)
  • the amount of pledge (in lovalece),
  • the amount of pool operational cost (in lovalece),
  • the pool marging (% in number),
  • etc.

Delegate stake to your own stake pool

For delegating to a pool, first, the delegator must register a stake/reward address (not key) by submitting a stake address registration certificate on the chain.

The registration certificate is created by using the verification key of the stake (stake.vkey), but contains the

  • stake/reward address (stake.addr)of the verification key (stake.vkey).
cardano-cli shelley stake-address key-gen --verification-key-file stake.vkey --signing-key-file stake.skey
cardano-cli shelley stake-address build --staking-verification-key-file stake.vkey > stake.addr
  1. Delegator's Stake Verifying Key.
cat stake.vkey
type: StakingVerificationKeyShelley
title: Free form text
cbor-hex:
 18b9582053cba6ad9b2d17ab50a3fe1889e442d55429453c36c51f74680d2ceb1d7c02d9
           v----The 32 byte long verifying/public key itself
 18b9 5820 53cba6ad9b2d17ab50a3fe1889e442d55429453c36c51f74680d2ceb1d7c02d9
 h'b9'h'53CBA6AD9B2D17AB50A3FE1889E442D55429453C36C51F74680D2CEB1D7C02D9'
  1. Delegator's Stake Address
cat ../stake.addr
8200582032a8c3f17ae5dafc3e947f82b0b418483f0a8680def9418c87397f2bd3d35efb
# The decoded CBOR 
# But CBOR cannot be an output address.
[0, h'32A8C3F17AE5DAFC3E947F82B0B418483F0A8680DEF9418C87397F2BD3D35EFB']

The certificate must be gisned with the relevant stake key (stake.skey) and submitted to the chain as a transaction.

Start a stake pool and produce blocks

Receive delegation from other Pioneers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment