Last updated 8 months ago
Plutus developers don't have a standard open source contract tooling required to quickly build, test and simulate their smart contracts.
Plutus/PAB utility functions & data structures for Plutus scripts; Open source (Apache 2.0) & in use on mainnet by projects like SundaeSwap.
This is the total amount allocated to Plutus-extra: Plutus helper library.
Plutus-extra Overview
Data structures
The package introduces PlutusTx.Set of unique values (running in linear time), PlutusTx.Map of key-value pairs, PlutusTx.Bimap of pairs, and PlutusTx.NonEmpty list which always has at least one element.
Plutus Application Backend (PAB) utility functions
Modules in Plutus.PAB directory introduces utility functions to be used with the PAB:
Type classes
PlutusTx.Bifunctor behaves like a Functor over both of it's type arguments (see attached example diagram below)
Extra functions
The package extends Plutus.V1.Ledger and PlutusTx with useful library functions placed inside modules ending with Extra suffix.
E.g., PlutusTx.Either.Extra introduces function maybeToEither (see attached example diagram below)
The full collection of helper libraries and data structures that compose Plutus-extra and its sub-libraries include:
-plutus-extra: extended functions and data structures for Plutus scripts.
-plutus-numeric: a range of extensions to Plutus' numerical hierarchy.
-plutus-pretty: a collection of helpers for pretty-printing Plutus types.
-tasty-plutus: a testing framework for Plutus scripts.
-plutus-collection: list utility functions that are not present in the Plutus standard library, including functions involving lengths that work with the Natural number type in plutus-numeric, as well as functions related to sorting.
-plutus-context-builder: a utility library for creating ScriptContext with Spending or Minting ScriptPurpose. This provides a builder abstraction for assembling ScriptContext.
-plutus-deriving: a helper for deriving lawful instances of Plutus type classes.
-plutus-golden: a framework for testing serialized representation stability using golden testing. This focuses on type classes used for serialization for Plutus projects.
-plutus-laws: a helper library for checking type class laws, similar in spirit to quickcheck-classes.
-plutus-size-check: a tasty-based utility for checking the on-chain sizes of anything the Plutus compiler can compile.
-quickcheck-plutus-instances: a collection of instances for Plutus types to support general use of QuickCheck.
How does a Plutus helper library support Cardano developers during smart contract development?
In many programming languages helper libraries and utility functions serve as the tooling new developers need to efficiently build and test modular applications. Plutus smart contract development is no different; with an emphasis on property-based testing, performance modeling and script size/resources checks the plutus-extra helper lib becomes a critical piece of infrastructure for the Plutus developer experience.
Similar smart contract utility functions and testing tools on other blockchains have significantly boosted smart contract deployments and developer traction. Ethereum developers use inbuilt functions in Truffle Suite (https://trufflesuite.com/truffle/) to quickly build/test/deploy their contracts.
As early Plutus developers we understand the importance of simple to use tooling for new Cardano smart contract developers, and we are glad to see plutus-extra already in use in some of the ecosystems largest projects. Using this funding to include additional functions requested by Plutus devs interacting with the library, revamp documentation and scale up plutus-extra into an open source product maintained by Cardano ecosystem developers.
Adding the full-time engineering resources needed to develop plutus-extra into a more comprehensive helper library has been the largest challenge to date. Liqwid Labs and MLabs engineers built this library from the combined experience gained developing the Liqwid protocol.
We aim to complete the development of additional helper sub-libraries, data structures and utility functions 3 months after receiving funding. This mostly involves building the high-priority feature requests from Plutus developers currently using the library (this library is already in use in several MLabs DeFi projects, Liqwid and LiqwidX).
Developers will be able to use our library to:
Budget breakdown:
Engineering hours: 925
Total budget request: $75,000
Feature Total Time
Feature updates and developing enhanced Plutus testing tools …………………………………..200
Building out Plutarch helper functions …………………………………………………100
Added functions for property based testing………………………………..100
Integrate deployment tooling library………………….100
Added functionality to create/manage Stake Validators ……………………………………………175
Technical documentation and developer content………………………………………………………50
General Testing………………………………………………………………………………………..75
Security Audit………………………………………………………………………………………………..75
Technical Specification………………………………………………………………………………………………………..50
Total Time………………………………………………………………………………………………..925 engineering hours
Total Budget request $75,000
Haskell / Plutus engineers at Liqwid Labs and MLabs are committed to maintaining the plutus-extra library's current functionality and extending it with additional utility functions, property-based testing tools and helpful data structures.
Liqwid Labs CTO Emily Martins; Senior Haskell developer who built the Agora Plutus governance module (includes treasury, delegated voting, proposals, staking, rewards distribution), the liqwid-sdk and is an active contributor to Plutarch and plutus-extra repos, (5+ years building production Haskell applications).
MLabs Haskell engineers have worked closely with the IOG Plutus engineers to build extended on/off-chain functionality as Plutus Partners since March 2021. MLabs engineers have an advanced understanding of Plutus and Plutus related infrastructure; they are the only development shop operating at their scale and successfully shipping secure Plutus applications for multiple DeFi projects, working with IOG to build extensions to Plutus functionality and building open source Plutus infrastructure to lower the barrier to entry for new Plutus developers.
The number of commits, contributions and forks/stars is the main KPI we are currently using internally to measure the utility of plutus-extra.
In addition to these metrics tracking new sub-libraries as an important metric to gauge the growth of overall utility the library covers.
What does success look like?
3 months: 1. additional tooling focused on helping developers manage the contract deployment process, 2. CDA members adopting plutus-extra (and contributing where resources allow) 3. 30-50% growth (increase in # of commits, contributors, forks/stars).
6 months: structured process to extend the libraries with requested features from the Plutus developer ecosystem.
This is an entirely new proposal.
NB: Monthly reporting was deprecated from January 2024 and replaced fully by the Milestones Program framework. Learn more here
A team of 14 senior Haskell / advanced Plutus developers have made contributions to plutus-extra libraries.
Several plutus-extra devs are MLabs Cardano ecosystem developers; IOG Plutus Partner with over 80 Haskell developers working on some of the ecosystem's largest projects.