Nothing came up for

Technical Overview: Plutus Architecture

Lend us your voice!
Audio recordings make content accessible to more people
Record Article
technical-overview-plutus-architecture-hero-image
Help Translate! login

Open English text in another tab. Open

Error! Try saving again
Translation saved

Since you’re here, you’ve probably heard of Cardano. If you’ve been here for a while, you might know what a “smart contract” is. Here is something that still isn’t well-known to many: Plutus. Drawing from a video published to IOG’s YouTuve channel in April, this article describes what Plutus is and its importance in the Cardano architecture.

The foundation of the Cardano blockchain platform is built on two separate layers: A Cardano Settlement Layer (CSL) and a Cardano Computation Layer (CCL). Plutus is a range of technologies powering the CCL :

  • Plutus is at the core of Cardano’s smart contract platform that powers the creation of DApps (decentralized applications).
  • Plutus enables non-fungible tokens (NFTs) which have been very popular this year.
  • Plutus is how you launch native assets on Cardano: the ability for you to create your own coin or currency.
  • Finally, Plutus allows arbitrary on-chain conditional logic: imagine excel-style “if”-statement programmability, but on the Cardano blockchain.

At the heart of how the Plutus platform components function is something called EUTxO.

First, “UTxO” stands for “Unspent Transaction Output’; it’s the name for the “cash drawer” model of accounting pioneered by Bitcoin. In this model, values of varying amounts are stored in UTxOs, like the way you might put bills of different values in a cash drawer. You can also think of a UTxO as wrappers for one or more ADA on the Cardano blockchain.

The “E” at the beginning of EUTxO stands for “Extended”: EUTxO is how Cardano does on-chain programmability and smart contracts. There are four components of EUTxO: Contract, Redeemer, Datum, and Context.

Contract: Smart Contracts are programs, stored on the blockchain, that run when pre-set conditions are met. They can be thought of as locks that hold UTxOs. You can also think of smart contracts as validators or simply a programming script.

Redeemer: This is the data passed from the user to the smart contract. In a simple UTxO, a redeemer could be a signature which provides proof of ownership of the UTxO and access to the contents. You can think of the redeemer as a key to unlock a contract.

Datum: A piece of information that can be associated with a UTxO. It is used to store script state information such as its owner or the timing details (which define when the UTxO can be spent). You can think of Datum as the hard drive for a smart contract, for storing all kinds of data.

Context: Context is essentially the summary or metadata of the transaction. It can include information such as who signed for the transaction or where the funds are going.

With these four components of EUTxO, the Plutus platform allows businesses and developers to develop a wide range of decentralized applications, financial products, and games on Cardano.

The Plutus Platform

The Plutus Platform starts with developer code, then goes through a series of optimization steps, and finally gets put on chain (the ledger api) and ultimately executed and run by the plutus core evaluator in a decentralized way.

Source Code

Plutus starts with programming code on a developer’s computer, before that code reaches the blockchain and before users come into the picture. As of this writing, all Plutus contracts are written either in the Haskell programming language, or supersets of Haskell. Confusingly enough, Plutus itself is also a programming language, a superset of Haskell that makes writing Haskell less laborious and reduces boilerplate. The Plutus platform is designed to support other languages or domain-specific languages in the future to make it easier for certain uses, but at the moment, Plutus and Haskell is your only option.

Compiler Pipeline

After a developer crosses the I’s and dots their T’s, the Haskell script is converted to Plutus IR. Plutus IR is an “Intermediate Representation” of the Haskell code. This IR state is not quite 1s and 0s machine code yet, but rather an opportunity for Plutus to optimize the developer’s code for the most efficient 1s and 0s output. Plutus IR is to Cardano development what LLVM is to Apple iOS apps development or the Rust programming language.

From Plutus IR, the code is turned into typed-Plutus core. This is just before the raw 1s and 0s. It provides a low level layer to help developers spot issues easily before entire 1s and 0s land.

Next up is untyped-Plutus Core–a lambda calculus variant, a way to express the app in pure logic (see link at the bottom for wikipedia article). This Untyped Plutus core representation of the app is what will get executed on the blockchain.

Getting On-Chain

After all of the optimization, the compiled app is finally ready to get ‘deployed’ or injected on the blockchain. In Cardano, there are other Plutus apps to help with this as well as developer toolkits.

Off-chain code

Once your code is on the blockchain, you will need to write another set of Plutus/Haskell code to support transaction generation. This off-chain component of your app is the part that will correctly gather things like the redeemer and the datum and build a transaction that can interact with the compiled code living on the blockchain.

Conclusion

With your compiled onchain code and your off-chain code, your DApp is ready to facilitate user interactions. The next installment in this series will go in depth about Plutus Interactions.

Related Links

  • Lambda calculus writeup wikipedia
  • Cardano Technical Briefing: Plutus by John Woods video

Get more articles like this in your inbox

What is your experience with the Plutus platform? What still puzzles you?

Or leave comment
Share

Related Insights

Your Cardano Wallet

Your first NFT

Flexing your first Cardano Wallet

How to open a Cardano Wallet: GeroWallet

No comments yet…

avatar
You can use Markdown

Join our pool!

Unmatched Support

We provide phone and email support for all of our delegates. We understand that many of our community members are not tech or crypto nerds. You expect the same level of service and support you get from Reggie down at the bank or Saiid, your nephew or friend at the office that won't stop talking about Bitcoin.

We host weekly meetups (currently online due to Covid).Visit our connect page for all the ways you can reach us. page for all the ways you can reach us.

Best in class servers

Our servers are run and managed by professionals whose only job is to manage and run servers 24/7 365/6 days a year.

We run our Cardano nodes on the same servers powering other services you've come to rely on everyday, like Google and Pokemon Go.

What this means for you is that our servers are always online and available to process transactions, earning you and the causes we support the optimal amount of $$$$. Visit our pool page for more technical details.

#4% for community development and investment

Of all the rewards that come in, we keep 4% annually. All 4% goes towards charities you pick, paying LIDO nation community members like yourself to write code and content for the site, and grants for local community educational projects.

See our financials page for full records of our spending, more details, and breakdowns.

An Amazing Community

When you delegate and join LIDO Nation, you get to participate in creating a space for people to interact, meet, learn, and teach each other. You get to be part of the engine that works to make every voice heard with equal importance.

LIDO Nation is an idea. Delegate, take it and lets make something great!

EP1: 'd' Parameter
0:00
/
~1:00
1x