Skip to content

How to register your stake pool on the chain

Cardano Foundation Team edited this page Dec 19, 2019 · 1 revision

Pre-Requisites

optional: if you want to be able to track your rewards from Daedalus/Yoroi and derive your owner public key from your mnemonic

Step 1: Start jormungandr

  • Start a passive node for Jörmungandr using your weapon of choice:

    • Using cardano-wallet
      $ cardano-wallet launch --genesis-block-hash $GENESIS_HASH -- --config config.yaml
      
    • Using jormungandr
      $ jormungandr --genesis-block-hash $GENESIS_HASH --config config.yaml
      
    • Using nix
      git clone https://github.com/input-output-hk/jormungandr-nix
      cd jormungandr-nix
      nix-shell --arg customConfig '{ enableWallet = true; }'
      run-jormungandr
      
      note: this same nix-shell command can be used to get cardano-wallet-jormungandr in PATH
      
      

❓ See Protocol Parameters below for values of $GENESIS_HASH

Step 2: Get your reward credentials

  • Option A: Using cardano-wallet and your mnemonic sentence
    • Extract your owner account private key from your mnemonic sentence:
    $ cardano-wallet mnemonic reward-credentials
    Please enter your 15-word mnemonic sentence: perfect canvas ...
    
    (Enter a blank line if you didn't use a second factor.)
    Please enter your 9–12 word mnemonic second factor:
    
    Here's your reward account private key:
    
        ed25519e_sk17zph7f___wrwlv2
    
    Keep it safe!
    

    ⚠️ This command is currently only available on the development branch of cardano-wallet and will be made available through an imminent new release.

    • Save it to disk
    $ echo ed25519e_sk17zph7f___wrwlv2 > owner.prv
    
    • Extract the corresponding public key using jcli
    $ jcli key to-public < owner.prv > owner.pub
    
    • Generate its corresponding account address
    $ jcli address account --testing --prefix addr $(cat owner.pub) > owner.addr
    
  • Option B: generate arbitrary new credentials
    • Generate a new key pair using jcli
    $ jcli key generate --type ed25519 | tee owner.prv | jcli key to-public > owner.pub
    
    • Generate its corresponding account address
    $ jcli address account --testing --prefix addr $(cat owner.pub) > owner.addr
    

Step 3: Fund your account

  • Option A: Using Daedalus
    • Using Daedalus, send an initial pledge to your reward account using the address stored in owner.addr
    $ cat owner.addr
    addr1.....
    
    • (optional) At this stage, you can either wait for the transaction to be inserted and your reward balance updated in Daedalus (or the cardano-wallet web server). Or, you may proceed with Step 4 and Step 5 in the meantime.
  • Option B: Using cardano-wallet
    • Start by creating a wallet using your mnemonic sentence
    $ cardano-wallet wallet create MyWallet
    Please enter a 15–24 word mnemonic sentence: perfect canvas ...
    
    (Enter a blank line if you didn't use a second factor.)
    Please enter your 9–12 word mnemonic second factor:
    
    Please enter a passphrase: **********
    Enter the passphrase a second time: **********
    Ok.
    {
    ...
    "id": "2d4cc31a4b3116ab86bfe529d30d9c362acd0b44",
    ...
    }
    
    • Pay attention to the "id" field in the response from the previous command. And use it to fund your reward account:
    $ cardano-wallet transaction create 2d4cc31a4b3116ab86bfe529d30d9c362acd0b44 \
      --payment $PLEDGE_AMOUNT@$(cat owner.addr)
    Ok.
    {
    ...
    }
    

    ℹ️ $PLEDGE_AMOUNT can be anything but must be enough to pay for the registration fees. The remaining amount will act as an initial stake delegated to your pool.

    • (optional) Inspect the wallet and wait for the "balance" > "reward" field to match your reward account balance. You may also simply proceed with the next steps while the transaction is being inserted.
    $ cardano-wallet wallet get 2d4cc31a4b3116ab86bfe529d30d9c362acd0b44
    Ok.
    {
    ...
    "balance": {
        ...
        "reward": {
            "quantity": 10000000000,
            "unit": "lovelace"
        }
        ...
    }
    ...
    }
    

Skip to nix instructions if you're using nix.

Step 4: Generate your pools credentials

  • Generate your KES/VRF key pair
$ jcli key generate --type=SumEd25519_12 > kes.prv
$ jcli key to-public < kes.prv > kes.pub
$ jcli key generate --type=Curve25519_2HashDH > vrf.prv
$ jcli key to-public < vrf.prv > vrf.pub

ℹ️ You may also have a look at https://input-output-hk.github.io/jormungandr/stake_pool/registering_stake_pool.html#the-primitives for more details.

Step 5: Generate your registration certificate

  • Choose carefully values for --tax-limit, --tax-ratio and --tax-fixed. Their semantic is defined as:
--tax-limit <TAX_LIMIT>
    The maximum tax value the stake pool will take.
    This will set the maximum the stake pool value will reserve for themselves.
    Including both the `--tax-fixed` and the `--tax-ratio`.

--tax-ratio <TAX_RATIO>
    The percentage take of the stake pool.
    Once the `tax-fixed` has been take, this is the percentage the stake pool will take for themselves.
    [default: 0/1]

--tax-fixed <TAX_VALUE>
    set the fixed value tax the stake pool will reserve from the reward

ℹ️ You may also have a look at https://input-output-hk.github.io/jormungandr/stake_pool/registering_stake_pool.html#choosing-the-tax-parameters for more details.

  • Generate your pool registration certificate
$ jcli certificate new stake-pool-registration \
    --kes-key $(cat kes.pub) \
    --vrf-key $(cat vrf.pub) \
    --owner $(cat owner.pub) \
    --management-threshold 1 \
    --tax-limit $TAX_LIMIT \
    --tax-ratio $TAX_RATIO \
    --tax-fixed $TAX_FIXED \
    --start-validity 0 \
    > stake-pool-registration.cert

ℹ️ Note that the --tax-limit is totally optional and can be left out if you do not wish to impose a limit.

💡 From there, you can view your pool id by doing:

jcli certificate get-stake-pool-id < stake-pool-registration.cert

Step 6: Prepare your transaction

  • Make sure your transaction from Step 3 has been inserted into the ledger.

  • Prepare a transaction to carry your registration certificate using jcli

$ jcli transaction new | \
  jcli transaction add-account $(cat owner.addr) $PLEDGE_AMOUNT  | \
  jcli transaction add-certificate $(cat stake-pool-registration.cert) | \
  jcli transaction finalize $(cat owner.addr) \
    --fee-constant $FEE_CONSTANT \
    --fee-coefficient $FEE_COEFFICIENT \
    --fee-pool-registration $FEE_POOL_REGISTRATION \
  > transaction.tmp

❓ See Protocol Parameters below for fees values.

  • Create a witness for your account public key
$ jcli transaction make-witness \
  $(jcli transaction data-for-witness < transaction.tmp) \
  --genesis-block-hash $GENESIS_HASH \
  --type account \
  --account-spending-counter 0 \
  owner.witness \
  owner.prv
  • Finalize the transaction
$ jcli transaction add-witness owner.witness < transaction.tmp \
  | jcli transaction seal \
  | jcli transaction auth -k owner.prv \
  | jcli transaction to-message \
  > transaction.bin

Step 7: Submit your transaction

  • Make sure you have Jörmungandr running and the rest API enabled. We'll assume the default port present in the configuration from the annex: tcp/3100.

  • Submit your transaction

$ jcli rest v0 message post \
  --host http://localhost:3100/api \
  --file transaction.bin
  • Monitor your transaction in the log and wait for it to be inABlock
$ jcli rest v0 message logs --host http://127.0.0.1:3100/api

Nix Pool Creation

In nix-shell as shown above when starting jormungandr:

create-stake-pool -h (shows help)
example: create-stake-pool -t 100000000 -r "4/10" -l 1000000000000 -t TIKR -n "Pool Name" -u "https://example.com"

note: the json and sig files in ./state-jormungandr-itn_rewards_v1 are what need uploaded to stake pool registry

send-pool-registration -h (shows help)
example: send-pool-registration -s owner.prv -c ./state-jormungandr-legacy/POOL.cert

delegate-stake -h (shows help)
delegate-stake -s owner.prv -p 0000000000000000000000000000000000000000000000000000000000000000

send-delegation -s owner.prv ./state-jormungandr-itn_rewards_v1/stake_delegation.cert

Step 8: Register your metadata

Annex

Protocol Parameters

See Protocol Parameters

Example Pool Configuration

  • No taxes, minimal pledge (only sufficient to pay for the registration)
# --tax-limit not provided when creating the certificate
TAX_RATIO="0/1"
TAX_FIXED=0
PLEDGE_AMOUNT=$((FEE_CONSTANT+FEE_COEFFICIENT+FEE_POOL_REGISTRATION))=700000