The Plutus Platform and Marlowe
Explore Plutus
Explanations
What is the Plutus Platform?
Applications
The Plutus Platform
Further reading
What is a ledger?
Account-based and UTXO-based ledgers
Scripts and the Extended UTXO Model
Further reading
What is Plutus Foundation?
Plutus Core
Plutus Tx
Further reading
What is a rollback?
What does this mean for dapps?
What is the PAB?
Client interface
Other components
Chain index
Alonzo node
Wallet
Deployment Scenarios
Hosted
In-browser
What is the order book pattern?
Example: Distributed exchange
Orders and Plutus scripts
Decentralisation
Generalising the pattern
Off-chain oracles
On-chain oracles
State machines
Conclusion
Tutorials
Compiling and testing a Plutus app in the Plutus Playground
Running the “Hello, World” app
Running the first simulation of the app
Interpreting the results of the first simulation
Adding a payment to the first simulation
Running the “Vesting” app
Running the vesting simulation
Error Handling
Exercise
Writing a basic Plutus app in the Plutus Playground
Defining the types
Instances for data types
Defining the validator script
Asking for input
Locking the funds
Unlocking the funds
Deploying the app on the Playground
Exercise
Using Plutus Tx
Template Haskell preliminaries
Writing basic PlutusTx programs
Functions and datatypes
Typeclasses
The Plutus Tx Prelude
Lifting values
Writing basic validator scripts
Validator arguments
The
Data
type
Signaling failure
Validator functions
Using the validation context
Using the typed interface
Writing basic minting policies
Minting policy arguments
Using the minting context
Property-based testing of Plutus contracts
An overview of the guessing game
Emulated wallets
Values and
tokens
Introducing contract models
Generating actions
Modelling expectations
Restricting test cases with preconditions
Performing actions
Shrinking Actions
Debugging the model
Adding delays to test cases
Rerunning a failed test
Controlling the log-level
Refining preconditions
Measuring and tuning distributions
Custom generators vs preconditions
Instrumenting contract models to gather statistics
Goal-directed testing with dynamic logic
Introducing the dynamic logic monad
Quantifiers in dynamic logic
Repeating a dynamic logic test
Something good is always possible
Monitoring and tuning dynamic logic tests
More dynamic logic
Limitations
Testing only via
contract endpoints
Test assumptions on timing
Testing for information leaks
Further Examples
Testing Plutus Contracts with Contract Models
Introduction
Basic Contract Models
Example: A Simple Escrow Contract
The Contract Model Type
What contracts shall we test?
What actions should tests perform?
Generating Actions
Running tests and debugging the model
Analysing the distribution of tests
Exercises
Parameterising Models and Dynamic Contract Instances
Adding an initial action, and test case phases
Dynamic contract instances
Running our extended tests; another design issue
Exercises
Testing “No Locked Funds” with Dynamic Logic
Writing and testing properties using Dynamic Logic
Digression: revisiting a design decision
Fair’s fair: Unilateral strategies
Fixing the contract: refunds
Exercises
Taking Time into Account
Slots and POSIXTime
Initialising the deadline
Modelling the passage of time
Monitoring and the distribution of tests
No locked funds?
Digression: testing the model alone for speed
Exercises
Measuring coverage of on-chain code
Adding a coverage index
Measuring coverage
Interpreting the coverage annotations
The generated coverage report
Crashes, and how to tolerate them
Exercises
Debugging the Auction contract with model assertions
Modelling the Auction contract
No locked funds?
Model assertions, and unexpected expectations.
Crashing the auction
Coverage of the Auction contract
Exercises
Becoming Level 1 Certification Ready
Exercises
How-to guides
How to get started with the Plutus Platform
Further reading
How to export scripts, datums and redeemers
How to write a scalable Plutus app
The building blocks
Transaction outputs
State of transaction outputs
Changing the state of our app
Minting Policy Scripts
Scalability guidelines
Examples
Decentralised exchange
Marlowe
Summary
How to handle blockchain events
Transaction output lifecycle
Transaction states
PAB functions for listening to state changes
How to analyse the cost and size of Plutus scripts
Resource use of Plutus scripts
Examples
Validator scripts
Partial transactions
How to profile the budget usage of Plutus scripts
Compiling a script for profiling
Acquiring an executable script
Running the script
Analysing the results
Plutus Scripts
What is a Plutus spending script?
An example of using a Plutus spending script
Troubleshooting
Plugin errors
Haskell language server issues
Error codes
Explore Marlowe
Tutorials
Introducing Marlowe
Programming Languages and Domain-Specific Languages
Marlowe in a nutshell
Timeouts, deposits and commitments
Marlowe in action
Research-based
Finding out more
A first example
A simple escrow contract
Escrow in Marlowe
Adding timeouts
Adding commitments
Definitions
Notes
Background
The Marlowe model
Contracts
Participants and roles
Accounts
Steps and states
Blockchain
UTxO, wallets and the Marlowe Run app
Omniscient simulation
Values and tokens
Executing a Marlowe contract
Marlowe step by step
Pay
Close
Values, observations and actions
Oracles
If
When
Let
Assert
Marlowe in Blockly
Getting started
Exercises
Editing Blockly
The Marlowe data types
Marlowe
Basic components
Values, observations and actions
Extended Marlowe
Transactions
Slot ranges
Notes
Marlowe embedded in Haskell
A simple escrow contract, revisited.
Note
Marlowe embedded in JavaScript
Using the JS Editor in the Marlowe Playground
The
SomeNumber
type
The
EValue
type and boolean overloading
Example: Writing a Swap contract in TypeScript
The Marlowe Playground
Introducing the Marlowe Playground
Getting started
The JavaScript Editor: developing embedded contracts
The Haskell Editor: developing embedded contracts
Developing contracts in Blockly
Developing contracts in Marlowe
Simulating Marlowe contracts and templates
Oracle simulation
Saving and Opening Projects
Analysing a contract
Potential problems with contracts
Warnings
Non-positive payments
Non-positive deposits
Partial payment
Let
shadowing (not covered by static analysis)
Bad smells
Undefined
Let
usage (should be a warning)
Unreachable parts of a contract
Usability issues
Bad timing of
When
constructs
Errors
Ambiguous interval
Apply no-match
Useless transaction
Static analysis
An example
Under the hood
Next steps
ACTUS and Marlowe
ACTUS
Simple Zero Coupon Bond Example
Guaranteed Coupon Bond Example
Using Marlowe from the ghci command line
Marlowe in Haskell
Stepping through contracts
Alternative routes through the contract
Migrating from earlier versions of Marlowe
Remove
Both
Include accounts
Discussion: Implicit vs Explicit Accounts
Close
replaces
Null
/
Pay
Pay
Multi-clause When
Observations and Values
Inclusion of SlotIntervals
Reference
Reference
Examples
Cost model parameters
Glossary
Bibliography
Elsewhere
The Plutus Platform and Marlowe
»
Tutorials
Edit on GitHub
Tutorials
¶
Compiling and testing a Plutus app in the Plutus Playground
Writing a basic Plutus app in the Plutus Playground
Using Plutus Tx
Writing basic validator scripts
Writing basic minting policies
Property-based testing of Plutus contracts
Testing Plutus Contracts with Contract Models
Read the Docs
v: latest
Versions
latest
Downloads
pdf
epub
On Read the Docs
Project Home
Builds