Plutarch to Develop Typed eDSL in Haskell to Solve Plutus’ Open Source Challenge

Currently, stateful Plutus smart contracts (DeFi) are difficult to implement due to Cardano’s current transaction size parameters. Cardano has been working on increasing its current transaction size parameters by increasing the block size at a certain percentage, such that blocks can carry more transactions. Cardano has also announced an increase of Plutus script memory units per transaction. Plutarch proposes typed eDSL in Haskell for writing significantly more efficient Plutus Core validators compared to the PlutusTx smart contract execution cost.

The Plutarch Proposal

As per the proposal, Plutarch written validators are often significantly more efficient than Plutus Tx written validators. With Plutarch, developers have much more fine gained control of the Plutus Core validator generated, without giving up any type information.

For instance, one validator script from a large production contract was rewritten in Plutarch, changed from Plutus Tx. The comparison between the Plutarch script’s execution cost compared to the Plutus Tx script’s execution cost indicates that Plutarch provides a highly performant alternative for Haskell engineers to begin writing Plutus core validators without the current limitations of PlutusTx. The comparison was done using benchmark comparison of the CPU, Memory, and Script Size. These numbers were gathered by simulating the whole contract flow on a testnet.

An open source alternative to writing validators in PlutusTx addresses the open source development challenge in many ways. First, Haskell developers will have the infrastructure needed to write untyped Plutus Core validators and a lower barrier to building Plutus smart contracts since there will be no need to learn the nuances of PlutusTx. Second, with Plutarch as a smart contract language closer to raw Haskell, new developers gain a diverse selections of paths to build their Plutus smart contracts rather than the singular PlutusTx option. Lastly, it will expand options and lower the barrier to entry for proficient Haskell developers who want to build Cardano smart contracts but don’t want to learnt the subtleties of PlutusTx.  

The Team Behind Plutarch

The proposal was submitted by Liqwid Labs, Emily Martins and MLabs. Liqwid Labs is an open source, algorithmic and non-custodial interest rate protocol built for lenders, borrowers and developers. Liqwid Labs builds decentralized finance (DeFi) products that facilitate economic freedom for all. Emily describes herself as a developer interested in Functional Programming and Type Theory, writing Haskell and Agda. She has been on Project Catalyst since Jan. 9, 2021.

MLabs is a Haskell, Rust, blockchain and AI consultancy who specialize in the blockchain, fintech and payment space. MLabs is currently providing audits for Plutus smart contracts on Cardano. MLabs has partnered with many projects on the Cradano blockchain including SundaeSwap, Cardax and Ardana. The MLabs team is driving the PLutonomicon effort as an open source tooling for Plutus developers to leverage.

Budget Estimates

Plutarch has requested $75,000. The budget will be used to pay for all elements of the project in engineering hours. The elements are divided up into the following engineering hours, totaling to 1150hrs:

  • Plutarch extended numeric hierarchy support – 100
  • Plutarch-test updates – 100
  • Enhancements to Plutarch testing and benchmark tools – 200
  • Implementing Plutarch helper functions – 100
  • Plutarch version 1.2 updates to bring to parity with Plutus changes – 200
  • Plutarch functionality to create/manage Stake Validators – 150
  • Technical documentation and code examples – 50
  • General Testing – 75
  • Security Audit – 75
  • Technical specification – 100

Conclusion

Plutarch is seeking to solve the open source challenge in different ways that will allow developers to build Cardano smart contracts without the need to learn the subtleties of PlutusTx. Currently, stateful Plutus smart contracts (DeFi) are difficult to implement due to Cardano’s current transaction size parameters. Although several proposals have been put forward to increase the transaction size, it will take some time before they are implemented. This proposal is backed by a strong team of protocols who have developed and implemented other big projects in Cardano. It will therefore be possible to follow up and hold them accountable for any issues in future.

To learn more about Plutarch, check out their proposal.

Image courtesy of pixabay

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts