Plutus tools in development

The Plutus tools are currently in development. Early iterations of the tools have undergone testing as part of our research into their performance and features. Based on test results and feedback, our team has entered a new cycle of development to address certain design aspects and to place a greater focus on selected features and capabilities.

Logical components

Plutus tools consists of libraries, executables and logical components within Haskell packages for external developers to use. A single Haskell package may contain multiple logical components.

The tools are located in the plutus-apps repository.

For each tool or logical component shown below, we have indicated its specific location within plutus-apps and provided a brief description.

../../_images/plutus-tools-ecosystem.png

Illustration of the Plutus Tools Ecosystem showing logical components and some indication of their dependencies and relationships. (image source)

. Plutus use case examples

Plutus use case examples

Location

plutus-apps/plutus-use-cases

Plutus use case examples contains hand-written examples for the use cases we currently have. The primary examples are:

  • Auction,

  • Crowdfunding,

  • Game,

  • GameStateMachine, and

  • Vesting.

For each Plutus application use case, we provide test scenarios (or test cases) with and without the Plutus.Contract.Test.ContractModel.

The examples are for testing and educational purposes. While they work in the plutus-contract emulator, they are not guaranteed to work on the actual Cardano network, primarily because the size of the produced Plutus scripts are too big to fit in a transaction given current protocol parameters.

. PAB (Plutus application backend)

PAB

Location

plutus-apps/plutus-pab

PAB is a web server library for managing the state of Plutus contract instances. The PAB executes the off-chain component of Plutus applications. It manages application requests to the wallet backend, the Cardano node and the chain-index. PAB stores the application state and offers an HTTP REST API for managing application instances.

PAB wraps the contracts built with plutus-contract. It is the central point of contact, integrating many Cardano components.

. Contract monad emulator

Contract monad emulator

Location

plutus-apps/plutus-contract

Contract monad emulator is a library that provides an environment for emulating the blockchain. The environment provides a way for writing traces for the contract which are sequences of actions by simulated wallets that use the contract. The component is highly dependent on the Contract API (Contract monad).

. Plutus contract model testing

Plutus contract model testing

Location

plutus-apps/plutus-contract

Plutus contract model testing is used for testing prototype Plutus contracts with contract models, using the framework provided by Plutus.Contract.Test.ContractModel. This framework generates and runs tests on the Plutus emulator, where each test may involve a number of emulated wallets, each running a collection of Plutus contracts, all submitting transactions to an emulated blockchain. Once you have defined a suitable model, then QuickCheck can generate and run many thousands of scenarios, taking the application through a wide variety of states, and checking that it behaves correctly in each one.

. Plutus contract state machine

Plutus contract state machine

Location

plutus-apps/plutus-contract

Plutus contract state machine is a library that is a useful high-level tool for defining and modeling a Plutus application (smart contract) based on the State Machine formalism. It is helpful for writing a reference implementation for testing before creating the production version. However, we do not recommend using it in production as the scripts are too big to run on-chain.

. Contract API (also known as Contract monad)

Contract API

Location

plutus-apps/plutus-contract

Contract API is a logical component within the Plutus Contract package, providing an effect system for describing smart contracts that interact with wallets, DApps, a chain indexer and the blockchain. It provides the Contract API interface for writing the off-chain part of a Plutus application that is to be interpreted by an emulator or by Plutus application backend (PAB).

. Plutus chain index

Plutus chain index

Location

plutus-apps/plutus-chain-index-core

plutus-apps/plutus-chain-index

Plutus chain index is an application for indexing data from the Cardano blockchain that is used in the Contract Monad. The main design goal is to keep the size of the indexed information proportional to the UTXO set.

. Plutus Tx constraints

Plutus Tx constraints

Location

plutus-apps/plutus-tx-constraints

Plutus-tx-constraints contains a constraints-based API that can be used to generate on-chain validation functions and to build transactions by providing a list of constraints. The main design goal is to be able to use the same constraints on-chain and off-chain in a Plutus application. The off-chain part generates transactions based on types in cardano-api.

For example:

  • checkScriptContext (MustSpendAtLeast 10Ada, MustProduceOutput myOutput, …)

  • mkTx (MustSpendAtLeast 10Ada, MustProduceOutput myOutput, …)

. Plutus ledger

Plutus ledger

Location

plutus-apps/plutus-ledger

Plutus ledger is a set of transitional types that simplify the cardano-api types. It is intended to be a comprehensive, easy-to-use set of types that replicate the current era of cardano-api. It currently considers only the last era. Plutus ledger contains data types and functions that complement cardano-ledger related to Plutus.

. Plutus script utils

Plutus script utils

Location

plutus-apps/plutus-script-utils

Plutus script utils is a utility library for helping users write Plutus scripts that are to be used on-chain. Plutus script utils includes a variety of useful functions for on-chain operations in Plutus scripts.

It provides a number of utilities including:

  • hashing functions for Datums, Redeemers and Plutus scripts for any Plutus language version.

  • functionality for wrapping the untyped Plutus script with a typed interface.

  • utility functions for working with the ScriptContext of a Plutus Script.