Exploring Cardano Wallets: A Comprehensive Guide for Developers

·

Overview

In this guide, we'll walk you through creating a Cardano wallet, receiving test ada (tAda) on a testnet network, and executing basic transactions. We'll explore essential tools like cardano-cli and cardano-wallet to demonstrate their functionalities.

Prerequisites


Types of Cardano Wallets

1. Daedalus Wallet

2. Yoroi Wallet

3. cardano-wallet

4. cardano-cli


Creating a Wallet with cardano-cli

Step-by-Step Process

  1. Generate Payment Keys

    mkdir -p $HOME/cardano/keys
    cd $HOME/cardano/keys
    cardano-cli address key-gen \
      --verification-key-file payment1.vkey \
      --signing-key-file payment1.skey
  2. Derive Wallet Address

    cardano-cli address build \
      --payment-verification-key-file payment1.vkey \
      --out-file payment1.addr \
      --testnet-magic 1097911063
  3. Fund the Wallet

  4. Check UTXO

    cardano-cli query utxo \
      --testnet-magic 1097911063 \
      --address $(cat payment1.addr)

Sending Transactions with cardano-cli

  1. Prepare Protocol Parameters

    cardano-cli query protocol-parameters \
      --testnet-magic 1097911063 \
      --out-file protocol.json
  2. Build and Submit Transaction

    cardano-cli transaction build-raw \
      --tx-in <TxHash>#<TxIx> \
      --tx-out $(cat payment2.addr)+250000000 \
      --tx-out $(cat payment1.addr)+749825831 \
      --fee 174169 \
      --out-file tx.draft
    
    cardano-cli transaction sign \
      --tx-body-file tx.draft \
      --signing-key-file payment1.skey \
      --testnet-magic 1097911063 \
      --out-file tx.signed
    
    cardano-cli transaction submit \
      --tx-file tx.signed \
      --testnet-magic 1097911063

Managing Wallets with cardano-wallet

1. Start the Wallet Server

cardano-wallet serve \
  --port 1337 \
  --testnet $HOME/cardano/testnet-byron-genesis.json \
  --database wallets/db \
  --node-socket $CARDANO_NODE_SOCKET_PATH

2. Create a Wallet via API

curl -X POST http://localhost:1337/v2/wallets \
  -H "Content-Type: application/json" \
  -d '{
    "name": "test_wallet",
    "mnemonic_sentence": ["word1", "word2", ...],
    "passphrase": "secure123"
  }'

3. Send Funds

curl -X POST http://localhost:1337/v2/wallets/<walletId>/transactions \
  -H "Content-Type: application/json" \
  -d '{
    "payments": [{
      "address": "addr_test1...",
      "amount": {"quantity": 250000000, "unit": "lovelace"}
    }],
    "passphrase": "secure123"
  }'

FAQs

1. What’s the difference between cardano-cli and cardano-wallet?

2. How do I secure my wallet keys?

3. Why is my transaction failing?


Key Takeaways

👉 Explore Cardano Developer Tools
👉 Master Blockchain Integration