Instantiating Lucid Evolution
Lucid Evolution is a transaction building framework for Cardano which provides flexible off-chain development patterns. The library is designed with modularity in mind, allowing you to:
- Build and simulate transactions
- Work with different Cardano networks (Mainnet, Preprod, Preview, or Custom networks)
- Choose from multiple provider options for blockchain interaction
Provider
To interact with the Cardano blockchain (querying UTxOs, datums, or protocol parameters), you'll need to configure a provider. Providers are chain indexing services that offer API access to blockchain data.
Lucid Evolution supports several providers:
import { Lucid, Blockfrost } from "@lucid-evolution/lucid";
const lucid = await Lucid(
new Blockfrost("https://cardano-preprod.blockfrost.io/api/v0", "<blockfrost-api-key>"),
"Preprod"
);
While a provider is required for blockchain interaction, you can still use transaction building features of the Evolution library without one.
Common Queries
By abstracting away the provider calls, Evolution library provides different methods to query on-chain data:
UTxOs (Unspent Transaction Outputs) are building blocks of Cardano's eUTxO model. A nuance from account-based models is that your wallet's balance is the sum of all UTxOs at your address.
const utxos = await lucid.utxosAt("addr_test...");