Skip to content

SeungheonOh/cardano-transaction-lib

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cardano-transaction-lib

Hercules-ci Cachix Cache PureScript code documentation

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

Documentation

Please explore our documentation to discover how to use CTL, how to set up its runtime, and how it compares to Plutus/PAB:

You can also access PureScript documentation for CTL and its dependencies for the most recent develop version, or generate it yourself.

Light wallet support

Support is planned for the following light wallets:

Roadmap

  • 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 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)

Architecture

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:

  1. How do we get the transaction in the right format?
    • This is handled by cardano-serialization-lib, a Rust library available as WASM
  2. 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
  3. How do we query for datums (i.e. the datums themselves and not just their hashes)?
    • Kupo solves this problem
  4. How do we get wallet data?
    • This is done via browser-based light wallet integration in the browser based on CIP-30
  5. How closely should we follow Plutus' Contract API?
    • CTL's Contract model is significantly less restrictive than Plutus' and allows for arbitrary effects within the Contract 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

Additional resources/tools:

Available support channels info

You can find help, more information and ongoing discusion about the project here:

About

A Purescript library for building smart contract transactions on Cardano

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PureScript 90.2%
  • JavaScript 4.3%
  • Nix 2.9%
  • Dhall 1.0%
  • Shell 0.8%
  • Haskell 0.6%
  • Other 0.2%