The Cardano blockchain is written in the famed and feared programming language, Haskell. Haskell is the basis of both Cardano programming languages, Plutus and Marlowe. Plutus is the general purpose programming language for all manner of smart contracts on Cardano. Marlowe is a simpler programming language specifically for writing financial smart contracts. A language like Marlowe that is specialized for one focused use is called a “Domain Specific Language,” or DSL. Rather than being aimed at computer developers generally, Marlowe’s target audience is financial professionals who can leverage their domain expertise to be able to create and manage smart contracts, without necessarily needing to be a developer, or hire one.
Sweet Helen, make me immortal with a kiss
–Christopher Marlowe
In the last installment of this read-along, we learned that the programming language Plutus was named after the Greek god of wealth, which makes a certain horse sense in the crypto world. This chapter starts by telling us that Marlowe is named after the Elizabethan poet Christopher Marlowe, but doesn’t offer any clues about why. Since I’m frankly more interested in this bit of arcana than in financial smart contracts, I took a peek at “Kit” Marlowe’s Wikipedia page. He was a poet, playwright, and contemporary of Shakespeare, and it is known that he influenced the great bard’s work. Maybe the Marlowe programming language was so dubbed because it’s so poetic? I know certain developers might view a bit of elegant code in this way. A more titillating possibility arose when I found the account of the poet’s death: Christopher Marlowe was murdered during a dispute over who would pay the bill. Perhaps if the settling of accounts had been defined in a neat blockchain smart contract, Marlowe would have lived.
Design Features
But back to Marlowe, the programming language. Advantages of Marlowe are that it is fairly simple to read and write. It’s possible to fully analyze how a contract will run; it is both very secure, and very predictable. Its structure is such that certain faults, such as infinite loops, are impossible to create. Every Marlowe transaction is guaranteed to have timeouts on all actions, and a defined timespan for the whole contract. Lacking this, a thoughtless or predatory contract could trap your funds for an indefinite duration. With Marlowe, you can set and read the time definitions for each part of the contract. Marlowe contracts can be tested in your browser, without using real money, so you can try out different scenarios and be sure you understand how a contract will behave. Another fascinating feature of Marlowe is that it is designed to be blockchain-agnostic. Although it was created and launched for Cardano by IOG, the intent is that Marlowe could work for other blockchains too.
Marlowe Playground and Blockly
With Marlowe, the emphasis on accessibility started early. The Marlowe Playground allows you to start interacting with Marlowe in a variety of ways. For learners, there are at least half a dozen sample contracts, which you can view in Haskell, JavaScript, Marlowe, or Blockly. Haskell is a somewhat obscure programming language, but nearly everyone has heard of JavaScript. Many people with some programming experience will feel more comfortable when they learn that Marlowe financial contracts can be written in JavaScript first, then converted to Marlowe. For those with no programming experience, but who can read English and do puzzles, Blockly is an exciting accessibility onramp. Blockly uses graphical blocks to represent code elements and variables. Puzzle-like interlocking elements allow users to put together the pieces in the right way, without needing to fully understand the syntax behind it. Blockly is not unique for Marlowe; it dates back more than 10 years as a tool that can be used with multiple programming languages to allow users to develop code using a graphical, drag & drop tool.
This is an example contract for the “Swap of Ada and dollar tokens” displayed in Blockly.
This screenshot of the same example contract shows the elements menu, where a user can choose graphical elements to build a Marlowe contract.
For further learning about Marlowe, I’m going to point readers to the main Marlowe website for up-to-date links and resources for getting started and using Marlowe. Some of the resources that are discussed in the book have changed or moved - which is really no surprise in a nascent and quickly evolving tech space.
The future is decentralized
Speaking of that evolution, another great place to look for new and upcoming projects and tools for Marlowe is in Project Catalyst. A search for funded projects that include “Marlowe” turns up 39 funded projects; 16 of them are completed.
The recently completed Fund 10 round includes these 2 funded projects that you might want to keep an eye on:
- Marlowe Runtime SDKs: aims to create “Software Development Kits” (SDKs) for Rust, Python, Go and JavaScript to easily interact with Marlowe Runtime
- Marlow Decentralized Oracle Integration: this project will integrate Marlowe Runtime with well-known decentralized oracles, including Charli3
Using the Lido Nation Catalyst Explorer, you can subscribe to any funded project to get their monthly reports delivered to your email!
If you have started using or exploring Marlowe, leave a comment below with your thoughts, or links to the latest resources.
No comments yet…