cardano-transaction-lib (CTL) is a Purescript library for building smart contract transactions on Cardano. It aims to port the functionality and interface of Plutus off-chain code to the browser environment and NodeJS.
Table of Contents
Please explore our documentation to discover how to use CTL, how to set up its runtime, and how it compares to Plutus/PAB:
- Super quick start
- Adding CTL as a dependency
- CTL's runtime dependencies
- Blockfrost support
- Getting started writing CTL contracts
- Managing contract environment
- Using CTL from JS
- Importing Plutus Scripts
- Migrating from Plutus to CTL
- Overview of testing approaches
- CIP-25 NFT standard support
- Transaction balancing
- Transaction chaining
- Ada staking support
- Key management
- SECP256k1 support (CIP-49)
- Custom query layers
- FAQs
- Feature overview video
- Comparison with other frameworks (Lucid)
- Development workflows for CTL
You can also access PureScript documentation for CTL and its dependencies for the most recent develop
version, or generate it yourself.
Support is planned for the following light wallets:
- Stage 1 Build a simple transaction in the browser that works with at least one light wallet (Nami)
- Stage 2 Once we can construct a simple user-to-user transaction, we will try to use the library to submit the tx with nami
- Stage 3 Once we have a simple working transaction, we will seek to build a Plutus smart contract transaction with datum from scratch
- Stage 4 Once we can construct Plutus smart contract transactions, we will seek to build a library/DSL/interface such that transactions can be built using constraints and lookups - as close as possible to a cut-and-paste solution from Plutus'
Contract
monad code in Haskell (but with no guarantee that code changes are not necessary)- Stage 4.1 Investigate supporting compatibility with the Vasil hardfork and improvements to our initial
Contract
API
- Stage 4.1 Investigate supporting compatibility with the Vasil hardfork and improvements to our initial
- Stage 5 Once we have a basic
Contract
-style API, we will further refine its public interface, expand wallet support (see below), expose a test interface (DONE - see here), provide a more ergonomic JS/TS API, support stake validators (DONE), and support CIP workflows on the public testnet (In progress) - Stage 6 Once CTL's
Contract
interface has been stabilized, we will add support for even more wallets and attempt to deprecate CTL's currently required Haskell server (DONE)
CTL is directly inspired by the Plutus Application Backend (PAB). Unlike PAB, however, CTL is a library and not a standalone process. Over the course of CTL's development, several questions have been raised as to how best create PAB-as-a-library:
- How do we get the transaction in the right format?
- This is handled by
cardano-serialization-lib
, a Rust library available as WASM
- This is handled by
- How do we query the chain?
- This has been solved using Ogmios & Kupo
- We will support an alternative BlockFrost backend as well in the future
- How do we query for datums (i.e. the datums themselves and not just their hashes)?
Kupo
solves this problem
- How do we get wallet data?
- This is done via browser-based light wallet integration in the browser based on CIP-30
- How closely should we follow Plutus'
Contract
API?- CTL's
Contract
model is significantly less restrictive than Plutus' and allows for arbitrary effects within theContract
monad - Certain features cannot be directly translated into Purescript from Haskell due to differences between the two languages
- Some of the Plutus conventions do not make sense for us, due to differences between on-chain and off-chain
- CTL's
cardano-serialization-lib
- Ogmios for chain queries
- Kupo for chain queries
- CIP-30 (wallet interface - Nami partially implements this)
- Nami docs
- Alonzo CDDL spec
You can find help, more information and ongoing discusion about the project here:
- Plutonomicon Discord
- #ctl channel at MLabs' Slack