Skip to content

Latest commit

 

History

History
125 lines (77 loc) · 4.08 KB

ARCHITECTURE.adoc

File metadata and controls

125 lines (77 loc) · 4.08 KB

Architecture of the Zerepoch project

This document is an overview of how the software in the Zerepoch project is structured. Most things are in direct subdirectories of the root, so we will work through those in conceptual order.

Zerepoch Core

Zerepoch Core is the language that actually goes on the blockchain. Consequently this is the absolute core of the codebase, and everything depends on it. It also includes the Zerepoch IR intermediary language.

Zerepoch Tx

Zerepoch Tx is how we refer to the subset of Haskell which we compile into Zerepoch Core. This is how users actually write Zerepoch contracts: they write Haskell programs, part of which is compiled into Zerepoch Core. The rest of the program can then use this compiled code when submitting transactions.

Ledger

To write actual Zerepoch contracts we need a model of the ledger that we’re running on. There are two reasons for this:

  • The on-chain code needs to work with the data: validators are given information about the current transaction being validated.

  • The off-chain code needs to produce transactions to submit.

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

Contract modelling

We want to help people write "contracts". When we say that, we mean both:

  1. A high-level application that exposes a limited API and is suitable for running inside something like a wallet smart contract backend.

  2. An implementation of a conceptual "contract" (e.g. a crowdfunding contract), including both the on-chain code and the eventual contract application.

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

Simeon

Although conceptually separate from Zerepoch, a fair amount of Simeon-related code is in the Zerepoch repository. This is for two different reasons:

  1. We have an implementation of Simeon on top of Zerepoch, which depends on the other code in the repository.

  2. The Simeon Playground shares code and deployment infrastructure with the Zerepoch Playground.

Playgrounds

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

Smart Contract Backend

The smart contract backend provides the runtime environment for compiled Zerepoch contracts. It manages the state of contract instances and brokers messages between them and the nodes, users, and wallets that they interact with.

Specification and design

We have done a fair amount of work in specifying and formalizing parts of our system. At the moment all of this work also lives in the Zerepoch repository, and we even have some basic testing of the Haskell implementation against the Agda formalization.

Build tooling