Connect your HW wallet to your computer.
cardano-cli query protocol-parameters \
--mainnet \
--out-file protocol.json
should create protocol.json
file.
cardano-hw-cli address key-gen \
--path 1852H/1815H/0H/0/0 \
--verification-key-file payment.vkey \
--hw-signing-file payment.hwsfile
should create payment.vkey
and payment.hwsfile
files.
cardano-hw-cli address key-gen \
--path 1852H/1815H/0H/2/0 \
--verification-key-file stake.vkey \
--hw-signing-file stake.hwsfile
should create stake.vkey
and stake.hwsfile
files.
cardano-cli address build \
--payment-verification-key-file payment.vkey \
--stake-verification-key-file stake.vkey \
--out-file payment.addr \
--mainnet
should create payment.addr
file.
cardano-cli stake-address delegation-certificate \
--staking-verification-key-file stake.vkey \
--stake-pool-verification-key-file cold.vkey \
--out-file delegation.cert
should create delegation.cert
file.
cardano-cli query utxo \
--address $(cat payment.addr) \
--mainnet
example return:
TxHash TxIx Lovelace
----------------------------------------------------------------------------------------
2a602e9ad218967602b4ca7be48648224e07f34fb0059f164ea3f99dbbfee1cb 0 1983692
cardano-cli transaction build-raw \
--tx-in "2a602e9ad218967602b4ca7be48648224e07f34fb0059f164ea3f99dbbfee1cb#0" \
--tx-out $(cat payment.addr)+0 \
--ttl 0 \
--fee 0 \
--certificate-file delegation.cert \
--out-file tx.draft \
--alonzo-era \
--cddl-format
should create tx.draft
file.
cardano-cli transaction calculate-min-fee \
--tx-body-file tx.draft \
--tx-in-count 1 \
--tx-out-count 1 \
--witness-count 2 \
--byron-witness-count 0 \
--mainnet \
--protocol-params-file protocol.json
example return:
199845 Lovelace
cardano-cli query tip --mainnet
cardano-cli transaction build-raw \
--tx-in "2a602e9ad218967602b4ca7be48648224e07f34fb0059f164ea3f99dbbfee1cb#0" \
--tx-out $(cat payment.addr)+1783847 \
--ttl 13909233 \
--fee 199845 \
--certificate-file delegation.cert \
--out-file tx.raw \
--alonzo-era \
--cddl-format
HW wallets expect the transaction CBOR to be in canonical format (see CIP-0021). Unfortunately, cardano-cli sometimes produces tx files not compliant with CIP-0021. Use the following command to fix the formatting issues.
cardano-hw-cli transaction transform \
--tx-file tx.raw \
--out-file tx.transformed
cardano-hw-cli transaction witness \
--tx-file tx.transformed \
--hw-signing-file payment.hwsfile \
--hw-signing-file stake.hwsfile \
--mainnet \
--out-file payment.witness \
--out-file stake.witness
cardano-cli transaction assemble \
--tx-body-file tx.transformed \
--witness-file payment.witness \
--witness-file stake.witness \
--out-file tx.signed
cardano-cli transaction submit \
--tx-file tx.signed \
--mainnet
cardano-cli query utxo \
--address $(cat payment.addr) \
--mainnet