Creating Wallet Payment and Stake Keys and Addresses


For the purposes of this guide, we will be creating keys and working in what is called a "hot" environment. Meaning that the device we are creating keys on (in this case, your Raspberry Pi designated as a block producer) is connected to a network and is reachable by other devices. In production, you will want to adapt an offline methodology (i.e. a "cold" environment) for creating, storing, and using sensitive private keys.

In order to interact with the Cardano blockchain (in this case, the Preprod testnet blockchain) we will need to create the operational components of a wallet. In our case, we are going to create payment keys, staking keys, a payment address, and a staking address. We will use this wallet to request funds from the faucet. These funds are worthless and will just be used for instructional purposes. We will then practice crafting transactions and sending test funds to other classmates. First let's create a couple directories

cd
mkdir preprodnet/wallets preprodnet/wallets/wallet1
cd ~/preprodnet/wallets/wallet1

Then let's create payment keys.

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

Next let's make staking keys.

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

We will then build a payment address using both our stake.vkey and payment.vkey.

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

Finally we will create a staking address using our stake.vkey.

We are now going to request some Test ADA from the Sanchonet Faucet, found here:

https://docs.cardano.org/cardano-testnet/tools/faucet

First, you are going to need to copy your address to your clipboard.

Copy the output of that command, paste in the faucet address field and submit.

Once the next block is created on the network (usually within a few seconds), you will be able to query your address.

You should now see 10000000000 lovelaces attached to this UTxO which you may now use and spend. Remember, each single Test ADA equals 1 million test lovelaces, so you now own 10 thousand Test ADA to play with.

Next Step On Your Own: Create a second wallet (payment+staking keys and addresses) in a directory called "wallet2". However, don't fund this one with the faucet.

Last updated