Page cover

Creating a first stake pool

The node is now in the Shelley era, but block production is still controlled by the BFT nodes. Create the first stake pool for the system:

mkdir pool1

Generating pool owner keys

You need an address and funds (for the pool owner):

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

To delegate your stake to the pool, you will need stake keys:

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

Build the address:

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

Send some funds to the pool owner address from user1.payment.addr:

Sign the transaction:

Submit it to the blockchain:

Generating stake pool keys

Generate cold keys:

Generate VRF keys:

Generate KES keys:

To generate the operational certificate:

You can now create a topology file for the pool and update the BFT nodes' topologies so that they include the pool:

Next, write a script to start the stake pool node:

Give it executable permissions:

You should be ready to start the node from the pool1 directory.

The pool cannot create blocks just yet. You need to register it to the blockchain.

Registering the stake address

Create a registration certificate:

Registering a stake address requires a two ada deposit:

Use the build-raw command this time, note that it does not automatically calculate fees and change. Again, for simplicity, pay a one ada fee and add the two ada deposit. Use a variable for the change calculations:

Build:

Sign:

Submit:

Registering a stake pool

Now, it's time to register the stake pool. On a real network, you would need to have metadata for your pool so that it could be properly displayed by wallets. It is not strictly necessary, but for learning purposes, you can use this same file https://git.io/JJWdJ from the documentation.

Get the file:

Get the metadata hash and save it to a file:

Generate the registration certificate:

Create a delegation certificate to honor your pledge:

Query the protocol parameters again to find the pool deposit:

Now, to make a 500 ada deposit, submit both the delegation certificate and the registration certificate:

Now you should wait for the next epoch transition for the stake snapshot to pick up your pool, and two epochs for your pool to start producing blocks. For this to work, you must lower the decentralization parameter (currently set to 1).

Last updated

Was this helpful?