This document highlights key differences between CTL and other Cardano offchain frameworks.
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
- Thanks to Catalyst, we now support an alternative BlockFrost backend as well (docs)
- How do we get wallet data?
- This is done via browser-based light wallet integration in the browser based on CIP-30 (
purescript-cip30-typesafe
)
- 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
- Our API scope is a lot more extensive, as we provide support for wallet interactions, staking operations, and more support for balancer tweaking.
- CTL's
For a more in-depth explanation of the differences between PAB and CTL (with code examples), refer to plutus-comparison.md
.
- Both CTL and Lucid support using seed phrases and private keys.
- Lucid allows to use any address without a private key for querying - CTL does not allow that, but it's still possible to build transactions for other wallets to sign via other means.
Lucid uses a Provider
class that defines all available queries. CTL query methods are defined in QueryHandle
.
CTL supports the following queries that Lucid does not:
getScriptByHash
getTxMetadata
getChainTip
getCurrentEpoch
evaluateTx
(not needed for Lucid)getEraSummaries
getPoolIds
Lucid, on the other hand, provides a way to get a UTxO that contains a specified NFT (getUtxoByUnit
).
- Both CTL and Lucid support Blockfrost and Kupo+Ogmios
- Lucid also supports Maestro
- Both CTL and Lucid allow for custom backends - Lucid via
Provider
interface implementation, and CTL via a customQueryHandle
.
Both CTL and Lucid support all operations with ADA delegations.
CTL uses Cardano Testnet, while Lucid uses an emulator.
Additionally, CTL supports testing with real wallets via headless browsers and provides an assertion library.
Lucid aims for simplicity, while CTL allows more fine-grained control over transaction building process without losing the benefits of declarativeness.
- CTL uses
cardano-serialization-lib
, while Lucid uses a fork ofcardano-multiplatform-lib
. Lucid allows to use CML'sTxBuilder
or call CML directly, while CTL allows to alter the transaction arbitrarily as PureScript data type either before or after balancing. - In CTL, CSL types and method wrappers are used via
purescript-cardano-serialization-lib
andpurescript-cardano-types
. However,TxBuilder
APIs from CSL are not provided by these packages. - Plutus Data conversion is handled via a schema-enabled API in Lucid. CTL allows for automatic
ToData
/FromData
deriving for some types, viaHasPlutusSchema
.