Evolution SDK
Transactions

Your First Transaction

Complete walkthrough of building, signing, and submitting a simple payment transaction on Cardano using Evolution SDK.

Your First Transaction

Building a Cardano transaction involves three clear stages: construction (specifying outputs and constraints), signing (cryptographically authorizing with your wallet), and submission (broadcasting to the network). Evolution SDK makes this workflow type-safe—each stage returns a builder that only exposes valid operations for that phase.

This guide walks through a complete payment transaction from client setup to on-chain confirmation. You'll learn the fundamental pattern that applies to all Evolution SDK transactions, regardless of complexity.

Complete Example

Here's a full transaction workflow—configure once, then build, sign, and submit:

import { ,  } from "@evolution-sdk/evolution";

// 1. Configure your client
const  = ({
  : "preprod",
  : {
    : "blockfrost",
    : "https://cardano-preprod.blockfrost.io/api/v0",
    : ..!
  },
  : {
    : "seed",
    : ..!,
    : 0
  }
});

// 2. Build transaction
const  = await 
  .()
  .({
    : ..("addr_test1vrm9x2dgvdau8vckj4duc89m638t8djmluqw5pdrFollw8qd9k63"),
    : ..(2_000_000n)
  })
  .();

// 3. Sign with your wallet
const  = await .();

// 4. Submit to network
const  = await .();
.("Transaction submitted:", );

Breaking It Down

Stage 1: Client Configuration

Set up your connection to the network. This happens once—you'll reuse the client throughout your application:

import {  } from "@evolution-sdk/evolution";

const  = ({
  : "preprod",
  : {
    : "blockfrost",
    : "https://cardano-preprod.blockfrost.io/api/v0",
    : ..!
  },
  : {
    : "seed",
    : ..!,
    : 0
  }
});

Stage 2: Building the Transaction

Chain operations to specify what the transaction should do. Call .build() when ready to finalize:

import { ,  } from "@evolution-sdk/evolution";

const  = ({
  : "preprod",
  : { : "blockfrost", : "", : "" },
  : { : "seed", : "", : 0 }
});

const  = await .()
  .({
    : ..("addr_test1vrm9x2dgvdau8vckj4duc89m638t8djmluqw5pdrFollw8qd9k63"),
    : ..(2_000_000n)
  })
  .();

The builder handles UTxO selection, fee calculation, and change outputs automatically.

Stage 3: Signing

Authorize the transaction with your wallet's private keys:

import { ,  } from "@evolution-sdk/evolution";

const  = ({
  : "preprod",
  : { : "blockfrost", : "", : "" },
  : { : "seed", : "", : 0 }
});

const  = await .()
  .({ : ..("addr_test1vrm9x2dgvdau8vckj4duc89m638t8djmluqw5pdrFollw8qd9k63"), : ..(2_000_000n) })
  .();

const  = await .();

Stage 4: Submission

Broadcast the signed transaction to the blockchain and get the transaction hash:

import { ,  } from "@evolution-sdk/evolution";

const  = ({
  : "preprod",
  : { : "blockfrost", : "", : "" },
  : { : "seed", : "", : 0 }
});

const  = await .()
  .({ : ..("addr_test1vrm9x2dgvdau8vckj4duc89m638t8djmluqw5pdrFollw8qd9k63"), : ..(2_000_000n) })
  .();

const  = await .();

const  = await .();
.("Transaction hash:", );

What Happens Under the Hood

Evolution SDK handles several complex operations automatically:

  • UTxO Selection: Chooses inputs from your wallet that cover the payment amount plus fees
  • Fee Calculation: Computes minimum required fees based on transaction size and protocol parameters
  • Change Output: Creates a change output sending excess value back to your wallet
  • Balance Checking: Validates you have sufficient funds before building
  • Witness Creation: Generates cryptographic signatures during signing

You focus on what to send—Evolution SDK handles how to send it correctly.

Next Steps

  • Simple Payment - Common payment patterns and examples
  • Multi-Output - Send to multiple addresses in one transaction
  • Wallets - Different wallet types and configuration
  • Querying - Check transaction status and balances