Skip to main content

Marlowe Playground

In the following video, Pablo Lamela, Marlowe Engineering Lead, shows how to create Marlowe contracts in Marlowe Playground using Blockly.

A low-code pathway for building, simulating, and analyzing smart contracts

Intended to be used by both low-code professionals and experienced developers alike, the Playground provides multiple methods for building, simulating, and analyzing Marlowe smart contracts in a sandbox environment using an iterative design process.

Once you have created a contract, you can analyze its behavior through formal verification and testing; for example, you can check whether any payments made by the contract could conceivably fail. You can also step through how your contract will behave, simulating the actions of the participants.

Multiple Playground language options for creating Marlowe smart contracts

The Playground provides multiple language options for building contracts:

  1. Use the Blockly visual drag and drop programming tool to create contracts by fitting together blocks that represent the different components. Blockly is an intuitive low-code tool to get started with building Marlowe smart contracts.

  2. Write code directly in the Marlowe language's text format.

  3. Write code using the embedded JavaScript/TypeScript editor.

  4. Write code using the embedded Haskell editor.

Blockly editor

You can use the Blockly visual programming tool to create contracts by fitting together blocks that represent the different components. This is a very useful tool for those users who may not have experience in programming editors and want to build the contracts visually.

Blockly gives you a lot of feedback about what you can and cannot do along the way. It is very intuitive. If you try to put a block into the wrong place, it simply won't fit.

JavaScript editor

You can also use the embedded JavaScript editor to write Marlowe code in the Playground. You can import values and functions from the provided library written in TypeScript. They can be used to generate Marlowe smart contracts from TypeScript or JavaScript.

info

About the Marlowe library, JavaScript, and TypeScript

Even though we use the term "JavaScript," the Marlowe Script framework is written in TypeScript. Although JavaScript is a subset of TypeScript, programmers with limited TypeScript expertise are advised to learn the basics of TypeScript before using the Marlowe JavaScript code. For more information, see the TypeScript website.

Haskell editor

Experienced Haskell developers can use the embedded Haskell editor in the Playground to render Marlowe code. Marlowe is written as a Haskell data type, and thus it is straightforward to generate Marlowe smart contracts using Haskell.

IOG Academy's self-paced course on learning Haskell