Simple Transactions
On this page I will explain how to perform simple transactions (wallet to wallet) based on different tutorials (CoinCashew, stake pool school ...)
First, find the tip of the blockchain to set the invalid-hereafter parameter properly.
currentSlot=$(cardano-cli query tip --mainnet | jq -r '.slot')
echo Current Slot: $currentSlotamountToSend=10000000
echo amountToSend: $amountToSendSet the destination address which is where you're sending funds to.
destinationAddress=$(cat payment.addr)
echo destinationAddress: $destinationAddressdestinationAddress=addr1qxhazv2dp8yvqwyxxlt7n7ufwhw582uqtcn9llqak736ptfyf8d2zwjceymcq6l5gxht0nx9zwazvtvnn22sl84tgkyq7guw7q
echo destinationAddress: $destinationAddressdestinationAddress=$(cat geldtigerCold.addr)
echo destinationAddress: $destinationAddressFind your balance and UTXOs.
cardano-cli query utxo \
--address $(cat payment.addr) \
--mainnet > fullUtxo.out
tail -n +3 fullUtxo.out | sort -k3 -nr > balance.out
cat balance.out
tx_in=""
total_balance=0
while read -r utxo; do
in_addr=$(awk '{ print $1 }' <<< "${utxo}")
idx=$(awk '{ print $2 }' <<< "${utxo}")
utxo_balance=$(awk '{ print $3 }' <<< "${utxo}")
total_balance=$((${total_balance}+${utxo_balance}))
echo TxHash: ${in_addr}#${idx}
echo ADA: ${utxo_balance}
tx_in="${tx_in} --tx-in ${in_addr}#${idx}"
done < balance.out
txcnt=$(cat balance.out | wc -l)
echo Total ADA balance: ${total_balance}
echo Number of UTXOs: ${txcnt}Run the build-raw transaction command.
Calculate the current minimum fee:
Calculate your change output.
Build your transaction.
Copy tx.raw to your cold environment.
For this purpose you can use scp (secure copy)
Sign the transaction with the payment secret key.
Copy tx.signed to your hot environment.
For this purpose you can use scp (secure copy)
Send the signed transaction.
Check if the funds arrived.
Last updated