Appendix B: Transaction Quick Reference
As a stake pool operator, you need to understand the logic of creating transactions in the Cardano ecosystem. Therefore, the How to Set Up a Cardano Stake Pool guide explains how to create transactions manually using the transaction build-raw command.
Cardano CLI also includes functionality to create transactions calculating the fee and change automatically. The transaction build command uses the following syntax, where <UTXOToSpend> is the transaction hash and index of the UTXO to consume; <ReceivingAddress> is the payment address receiving funds in the transaction; <ReceivingAmount> is the amount in Lovelace that the transaction sends to <ReceivingAddress>; and, <ChangeAddress> is the payment address receiving the change from the transaction:
cardano-cli conway transaction build \
--tx-in <UTXOToSpend> \
--tx-out <ReceivingAddress>+<ReceivingAmount> \
--change-address <ChangeAddress> \
--out-file tx.raw
To withdraw rewards using the transaction build command, type the following command where <StakeAddress> is the stake address collecting rewards and <RewardBalance> is the entire balance of rewards in the account, in Lovelace:
cardano-cli conway transaction build \
--tx-in <UTXOToSpend> \
--withdrawal <StakeAddress>+<RewardBalance> \
--change-address <ChangeAddress> \
--witness-override 2 \
--out-file tx.raw
As long as you have a current copy of the protocol parameters file—named params.json throughout the How to Set Up a Cardano Stake Pool guide—the transaction build-raw allows you to build transactions offline. To calculate the transaction fee, the transaction build command obtains protocol parameters in real time, requiring a connection to an active Cardano Node instance.
Note | Using the |
In alphabetical order by description, Table 1 lists certificate files required to build transactions, as well as signing key files required to sign transactions, for each type of transaction included in the How to Set Up a Cardano Stake Pool guide.
Appendix B also includes the following sections:
- Generating Certificates offers templates for commands to generate each type of certificate listed in Table 1.
- Signing and Submitting Transactions provides templates for commands to sign and submit transactions.
- Viewing Transactions explains how to display transaction files using a human-readable format.
Note | Cardano CLI commands throughout the How to Set Up a Cardano Stake Pool guide may use the |
Appendix B uses the following file name extensions:
- SKEY—Secret signing key file
- VKEY—Public verification key file
- CERT—Certificate file
Description | Required | Required |
|---|---|---|
Sending Funds | N/A |
|
Registering a Stake Address |
|
|
Delegating to a Stake Pool |
|
|
Delegating to a Representative |
|
|
Registering a Stake Pool |
|
|
Updating Stake Pool Metadata |
|
|
Withdrawing Rewards | N/A |
|
Retiring a Stake Pool |
|
|
Generating Certificates
The following section provides templates for commands used to generate various certificates involved in operating a stake pool.
Stake Address Registration Certificate stake.cert
cardano-cli conway stake-address registration-certificate \
--stake-verification-key-file stake.vkey \
--key-reg-deposit-amt 2000000 \
--out-file stake.cert
Stake Address Vote Delegation Certificate vote-deleg.cert
cardano-cli conway stake-address vote-delegation-certificate \
--stake-verification-key-file stake.vkey \
--always-abstain \
--out-file vote-deleg.cert
Stake Delegation Certificate deleg.cert
cardano-cli conway stake-address stake-delegation-certificate \
--stake-verification-key-file stake.vkey \
--cold-verification-key-file node.vkey \
--out-file deleg.cert
cardano-cli conway stake-address stake-delegation-certificate \
--stake-verification-key-file stake.vkey \
--stake-pool-id 9769cbc0c7c6dbdf1b50010434224ff0173c194af9b29894fc8f49c8 \
--out-file deleg.cert
Stake Pool Deregistration Certificate pool.dereg
cardano-cli conway stake-pool deregistration-certificate \
--cold-verification-key-file node.vkey \
--epoch $(bc <<< "$(curl -s -H 'Accept: application/json' http://localhost:12788/ | jq -r '.cardano.node.metrics.epoch.int.val') + 1") \
--out-file pool.dereg
Stake Pool Registration Certificate pool.cert
cardano-cli conway stake-pool registration-certificate \
--cold-verification-key-file node.vkey \
--vrf-verification-key-file vrf.vkey \
--pool-pledge 100000000 \
--pool-cost 170000000 \
--pool-margin 0.15 \
--pool-reward-account-verification-key-file stake.vkey \
--pool-owner-stake-verification-key-file stake.vkey \
--mainnet \
--single-host-pool-relay relaynode1.pool.example.net \
--pool-relay-port 6000 \
--metadata-url https://pool.example.net/metadata.json \
--metadata-hash $(cardano-cli conway stake-pool metadata-hash --pool-metadata-file metadata.json) \
--out-file pool.cert
Signing and Submitting Transactions
The following procedures provide templates for commands to sign and submit transactions.
To sign a transaction:
- Using removable media, copy the
tx.rawfile for the transaction from the computer where you built the transaction to your air-gapped, offline computer. - Using a terminal window on the air-gapped, offline computer type:
cardano-cli conway transaction sign \
--tx-body-file tx.raw \
--signing-key-file payment.skey \
--mainnet \
--out-file tx.signed
To submit a transaction:
- Using removable media, copy the
tx.signedfile for the transaction from your air-gapped, offline computer to the block-producing node in your stake pool configuration. - Using a terminal window on the block-producing node, type:
cardano-cli conway transaction submit \
--tx-file tx.signed \
--mainnet
Viewing Transactions
To display a draft, unsigned or signed transaction file using a human-readable format:
- Using a terminal window, type the following command where
<TransactionFileName>is the path to the transaction file that you want to inspect:cardano-cli debug transaction view --tx-file <TransactionFileName>
