View on GitHub
File Changes
m
+32/-146
Plutus Core is the language that actually goes on the blockchain. Consequently
this is the absolute core of the codebase, and everything depends on it.

                      
-
=== `language-plutus-core`
+
include::language-plutus-core/ARCHITECTURE.adoc[]

                      
-
This package implements the Plutus Core language.
-

                      
-
This includes:
-

                      
-
- AST types
-
- Parser
-
- Various checkers including a typechecker
-
- Prettyprinter
-
- Simple evaluator (see `plutus-core-evaluator` for fancier evaluators)
-
- Support for some standard constructs e.g. the encodings of recursive types
-
- A number of example programs
-

                      
-
=== `plutus-core-intepreter`
-

                      
-
This package contains the production evaluator that we use, along with an experimental
-
lazy evaluator.
-

                      
-
=== `plutus-exe`
-

                      
-
This package defines a command-line executable that used to typecheck or
-
evaluate Plutus Core programs.
+
include::plutus-exe/ARCHITECTURE.adoc[]

                      
== Plutus Tx

                      
programs, part of which is compiled into Plutus Core. The rest of the program
can then use this compiled code when submitting transactions.

                      
-
=== `plutus-ir`
-

                      
-
Plutus IR is a higher-level language that sits between Plutus Tx and Plutus
-
Core in the compilation pipeline. This package implements the compiler, which
-
compiles Plutus IR into Plutus Core.
-

                      
-
=== `plutus-tx`
-

                      
-
This package provides several things:
+
include::plutus-ir/ARCHITECTURE.adoc[]

                      
-
- The Plutus Tx compiler, which compiles GHC Core into
-
Plutus IR.
-
- A GHC Core plugin, which is the mechanism by which people use
-
the compiler.
-
- A couple of special typeclasses which aid with the interface
-
between Haskell and Plutus Tx, and Template Haskell support for
-
generating instances.
-
- It provides a partial replacement Prelude, since many parts of the
-
normal Haskell Prelude cannot be used with Plutus Tx.
+
include::plutus-tx/ARCHITECTURE.adoc[]

                      
== Ledger

                      
- We want to write tests that simulate the "full" behaviour of contracts, i.e.
  across time, in a multi-agent scenario.

                      
-
=== `plutus-wallet-api`
+
include::plutus-wallet-api/ARCHITECTURE.adoc[]

                      
-
This package should probably be split in two!
-

                      
-
The `ledger` sublibrary defines our model of an Extended UTXO ledger, including:
-

                      
-
- The types that describe transactions, pending transactions, keys, currencies, etc.
-
- Functions that implement the ledger validation rules.
-

                      
-
The rest of the package defines the "wallet API", which was our attempt at
-
defining the interface that contracts would use to the wallet. As it turns out,
-
we need to do things somewhat differently, and so `plutus-contract` is the
-
future, but the functions in here are still used fairly widely.
-

                      
-
=== `plutus-emulator`
-

                      
-
This package defines the chain emulator, which is used for tests, and to back
-
the simulations in the Plutus Playground.
+
include::plutus-emulator/ARCHITECTURE.adoc[]

                      
== Contract modelling

                      
These packages are geared towards providing the tools to do that, and building
up examples to ensure that we have adequate functionality.

                      
-
=== `plutus-contract`
+
include::plutus-contract/ARCHITECTURE.adoc[]

                      
-
This package has a new API for defining "contracts": bundled applications that
-
interact with a wallet smart contract backend. This is in many ways the
-
"successor" to much of `plutus-wallet-api`, and should eventually
-
replace much of it.
+
include::plutus-contract-tasty/ARCHITECTURE.adoc[]

                      
-
=== `plutus-use-cases`
+
include::plutus-use-cases/ARCHITECTURE.adoc[]

                      
-
This package contains worked examples of a number of contracts, along with
-
tests using the emulator. This should always be our "most real" project: this is
-
where we try and do the things that we think people will really try and do.
-

                      
-
It has a few other miscellaneous tests and benchmarks that use the use-cases as
-
a source of large/real validators.
-

                      
-
=== `iots-export`
-

                      
-
This package defines a scheme for exporting interfaces to Typescript using IOTS.
-
This is used by `plutus-contract` to expose an interface for Typescript clients.
+
include::iots-export/ARCHITECTURE.adoc[]

                      
== Marlowe

                      
. The Marlowe Playground shares code and deployment infrastructure with the
Plutus Playground.

                      
-
=== `marlowe`
-

                      
-
This package contains an implementation of the Marlowe interpreter as a Plutus
-
contract.
+
include::marlowe/ARCHITECTURE.adoc[]

                      
-
=== `marlowe-symbolic`
-

                      
-
This package contains a web-service for doing static analysis of Marlowe
-
programs using symbolic execution.
+
include::marlowe-symbolic/ARCHITECTURE.adoc[]

                      
== Playgrounds

                      
The Plutus/Marlowe Playgrounds are our web-based environment for developing and
testing basic Plutus and Marlowe contracts. That means they're the main way that
anyone outside the team has interacted with out product!

                      
-
=== `playground-common`
-

                      
-
This package contains some library code which is shared between the Plutus and
-
Marlowe Playgrounds.
-

                      
-
=== `plutus-playground-lib`
-

                      
-
This package contains some library code for the Plutus Playground.
-

                      
-
=== `plutus-playground-server` and `marlowe-playground-server`
+
include::playground-common/ARCHITECTURE.adoc[]

                      
-
These packages contain the servers that back the Plutus/Marlowe Playgrounds by
-
compiling user code and evaluating their simulations.
+
include::plutus-playground-lib/ARCHITECTURE.adoc[]

                      
-
They also define executables that generate Purescript bindings for the types that
-
the Purescript code needs.
+
include::plutus-playground-server/ARCHITECTURE.adoc[]

                      
-
=== `plutus-playground-client` and `marlowe-playground-client`
+
include::marlowe-playground-server/ARCHITECTURE.adoc[]

                      
-
These contain the Plutus/Marlowe Playground client code, written in Purescript.
+
include::plutus-playground-client/ARCHITECTURE.adoc[]

                      
-
=== `web-common`
+
include::marlowe-playground-client/ARCHITECTURE.adoc[]

                      
-
This contains some Purescript client code that is shared between the Plutus and
-
Marlowe Playgrounds.
+
include::web-common/ARCHITECTURE.adoc[]

                      
-
=== `deployment`
+
include::deployment/ARCHITECTURE.adoc[]

                      
-
This folder contains the nixops/Terraform code used for deploying the Playgrounds.
-

                      
-
=== `deployment-server`
-

                      
-
This package contains a small server that handles automatic continuous
-
deployment of the alpha Playground whenever PRs are merged.
+
include::deployment/ARCHITECTURE.adoc[]

                      
== Documentation

                      
-
=== `plutus-tutorial` and `marlowe-tutorial`
-

                      
-
These packages contains tutorials for Plutus/Marlowe. The Plutus tutorial is a
-
literate Haskell project, the Marlowe one is not (yet).
-

                      
-
=== `plutus-book`
+
include::plutus-tutorial/ARCHITECTURE.adoc[]

                      
-
This package contains the Plutus Book. It is a literate Haskell project.
+
include::marlowe-tutorial/ARCHITECTURE.adoc[]

                      
-
=== `example`
+
include::plutus-book/ARCHITECTURE.adoc[]

                      
+
=== `deployment-server`
+

                      
+
This package contains a small server that handles automatic continuous
+
deployment of the alpha Playground whenever PRs are merged.
+
=== `deployment`
+

                      
+
This folder contains the nixops/Terraform code used for deploying the Playgrounds.
\ No newline at end of file
+
=== `docs`
+

                      
+
This folder contains a variety of miscellaneous documents.
+

                      
+
NOTE: Many of these are quite out of date, but can be useful for reference.
\ No newline at end of file
+
=== `example`
+

                      
+
This contains an example project that is designed to help people get started if
+
they want to use our libraries locally, rather than in the Playground. This can
+
otherwise be quite challenging, since our projects aren't on Hackage yet!
\ No newline at end of file
+
=== `extended-utxo-spec`
+

                      
+
This folder contains the Extended UTXO model specification.
+

                      
+
NOTE: This is more of a design document, really, it's not aiming for full precision.
\ No newline at end of file
+
=== `iots-export`
+

                      
+
This package defines a scheme for exporting interfaces to Typescript using IOTS.
+
This is used by `plutus-contract` to expose an interface for Typescript clients.
\ No newline at end of file
+
=== `language-plutus-core`
+

                      
+
This package implements the Plutus Core language.
+

                      
+
This includes:
+

                      
+
- AST types
+
- Parser
+
- Various checkers including a typechecker
+
- Prettyprinter
+
- Evaluator
+
- Support for some standard constructs e.g. the encodings of recursive types
+
- A number of example programs
+
=== `marlowe-playground-client`
+

                      
+
The Marlowe Playground client code, written in Purescript.
\ No newline at end of file
+
=== `marlowe-playground-server`
+

                      
+
This packages contains the server that backs the Marlowe Playground by
+
compiling user code and evaluating their simulations.
+

                      
+
It also defines an executable that generates Purescript bindings for the types that
+
the Purescript code needs.
\ No newline at end of file
+
=== `marlowe-symbolic`
+

                      
+
This package contains a web-service for doing static analysis of Marlowe
+
programs using symbolic execution.
\ No newline at end of file
+
=== `marlowe-tutorial`
+

                      
+
This package contains a tutorial for Marlowe.
\ No newline at end of file
+
=== `marlowe`
+

                      
+
This package contains an implementation of the Marlowe interpreter as a Plutus
+
contract.
\ No newline at end of file
+
=== `metatheory`
+

                      
+
This folder contains the Agda formalization of the Plutus Core metatheory,
+
including a `plc-agda` executable that is the equivalent of the `plc` executable
+
from `plutus-exe`. This is used for some basic tests.
+
=== `nix`
+

                      
+
This contains miscellaneous Nix code.
\ No newline at end of file
+
=== `papers`
+

                      
+
This folder contains our published academic papers.
\ No newline at end of file
+
=== `pkgs`
+

                      
+
This contains the generated Nix code representing our Haskell package set.
+
=== `playground-common`
+

                      
+
This package contains some library code which is shared between the Plutus and
+
Marlowe Playgrounds.
\ No newline at end of file
+
=== `plutus-book`
+

                      
+
This package contains the Plutus Book. It is a literate Haskell project.
\ No newline at end of file
+
=== `plutus-contract-tasty`
+

                      
+
Implements the `Language.Plutus.Contract.Test.TracePredicate` type. Trace predicates are expectations about the mockchain after running a contract trace. They can be turned into unit tests (with `tasty-hunit`) and produce useful debug output about the trace and the state of the contract.
\ No newline at end of file
Diff too large – View on GitHub