intersectmbo/plutus

repository·master·Indexed 23 days ago

https://github.com/intersectmbo/plutus

A repository featuring the Plutus Cost Model Visualization tool for analyzing Plutus Core built-in functions using Plotly.js, and the Constitution Script, a Plutus smart contract designed to automate parts of the Cardano Constitution. It includes tools for building the constitution script JSON envelope, configuring rules via JSON, and managing a Docusaurus-based documentation site.

Tokens
226.1K
Snippets
516
Records
914
Agent score
79%

What's inside intersectmbo-plutus

  1. Overview of Multicurrency EUTXO

    master
    The Multicurrency EUTXO model extends the Extended UTXO blockchain ledger model by adding support for multiple currencies. This extension allows user-defined tokens to be used to enhance the capabilities of state-machine-based smart contracts. For comparison, the standard UTXO model's multicurrency support is documented in the utxoma paper.
  2. Overview of the Extended UTXO model

    master
    The Extended UTXO model is a blockchain ledger model designed to increase expressivity compared to standard UTXO models. It enables the implementation of general state machines and the enforcement of invariants across entire transaction chains. This model was presented at WTSC'20.
  3. Overview of Plutus Core Conformance Test Suite

    master

    The Plutus Core Conformance Test Suite is an official test suite designed to ensure that Plutus implementations conform to the specified behavior. It covers the Haskell and Agda implementations of:

    • Untyped Plutus Core (UPLC) evaluation
    • CPU/memory costing of scripts
    • Coverage tests
    • Typechecking for Typed Plutus Core (TPLC) (including alpha equivalence via tplc-typecheck-test)
    • TPLC evaluation
    • Erasure of TPLC to UPLC

    Users can use this suite to validate their own alternative implementations of Plutus Core evaluators by running them against the provided input files and comparing results against the expected outputs.

  4. Overview of Resource Aware ML (RAML)

    master
    Resource Aware ML (RAML) is a language and toolset designed for the static analysis of computational resources. It is a subset of OCaml that includes algebraic datatypes, polymorphism, and higher-order functions, while omitting complex features like records, objects, and modules. RAML is specifically designed to handle polynomial bounds for resources such as heap space, execution time, and user-defined resources.
  5. Understand the formalization of IR compilation to System F-omega-mu

    master

    This formalization implements a two-part compilation process for Intermediate Representation (IR) into System F-omega-mu:

    1. Type-level compilation: Mutually recursive IR data types are compiled into System F-omega-mu types.
    2. Term-level compilation: Mutually recursive IR functions are compiled into System F-omega-mu terms.

    Note on Data Types: While IR data types are compiled at the type level, their constructors are not currently compiled at the term level. This is a known limitation due to the complexity of ensuring compiled constructors match the compiled types exactly.

  6. Understand the Plutus Core (PLC) Formalisation Structure

    master

    The Plutus Core (PLC) formalisation is an intrinsically typed implementation of the Plutus Core language. It is organized into several layers of abstraction to support different stages of the programming lifecycle:

    1. Intrinsically Typed PLC: The core implementation containing types, normal types, and terms indexed by types. It includes reduction semantics (CK and CEK machines) and proofs for syntactic properties (normalisation and progress).
    2. Extrinsically Typed (Well-Scoped) Terms: Represents terms prior to typechecking. These terms are intrinsically scoped and can be executed directly.
    3. Untyped Terms: A version of PLC that can be executed directly without type information.
    4. Type Checker: A sound mechanism that takes a well-scoped term and produces an intrinsically typed term as evidence of successful typechecking.
    5. Executable: A module designed to be compiled into Haskell to produce a standalone executable.
    6. Certified Compilation: A layer that defines the certify function, using translation relations to ensure compiler optimizations behave according to specification. This supports the --certify flag in the Plinth compiler and UPLC CLI tool.
  7. Understand the Plutus list algorithm implementations

    master

    The plutus-benchmark/lists directory provides implementations of simple list algorithms in Plutus, categorized into two main sets: sort and sum.

    • sort: Contains implementations of insertion sort, merge sort, and quicksort designed for Scott-encoded lists. These are used to evaluate the performance and scalability of sorting in Plutus Core.
    • sum: Contains benchmarks for summing lists of integers. These benchmarks compare the efficiency of different list types and folding methods, specifically comparing compiled and hand-written folds across Scott lists and built-in lists (Haskell lists accessed as a built-in type in Plutus Core).
  8. Core functionality of the PlutusCore library

    master

    The plutus-core Haskell package provides a suite of tools for manipulating Plutus Core programs according to the Plutus Core language specification. The primary exported interface is the PlutusCore module, which includes:

    • Parser and Pretty-printer: For textual Plutus Core representation.
    • Binary Serialization: Uses the flat package for serializing and deserializing programs.
    • Abstract Syntax Tree (AST): Representation of Plutus Core programs.
    • Renamer: Performs scope resolution and ensures the global uniqueness property (every unique is bound exactly once).
    • Type Checker: Synthesizes kinds for types and types for terms. Note that Plutus Core is fully typed, so this phase checks consistency rather than performing inference.
    • Evaluator: An interpreter based on the CK machine that follows the specification closely.
  9. Understand Plutus contract validation benchmarks

    master

    Plutus contract validation benchmarks measure the performance of transaction validations. These benchmarks use transactions derived from contracts located in the plutus-use-cases directory, which are obtained during contract execution on the blockchain emulator.

    Validation scripts are located in the data directory.