In the Shelley era of Cardano, every stakeholder can have two sets of keys and addresses:
- Payment Keys and addresses: To send and receive transactions
- Stake Keys and addresses: To control protocol participation, create a stake pool, delegate and receive rewards.
--mainnet identifies the Cardano mainnet, for testnets use
--testnet-magic 1097911063 instead.
To generate a payment key pair:
This creates two files
payment.vkey (the public verification key) and
payment.skey (the private signing key).
To generate a stake key pair :
Both verification keys (
stake.vkey) are used to build the address and the resulting
payment address is associated with these keys.
To generate a
This address CAN'T receive payments but will receive the rewards from participating in the protocol.
Ensure that your node has synced to the current block height which can be checked at explorer.cardano.org. If it is not, you may see an error referring to the Byron Era.
To query the balance of an address we need a running node and the environment variable
CARDANO_NODE_SOCKET_PATH set to the path of the node.socket: