Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large/Deep Contract Support (Merkleized Contracts) Milestone Log #88

Open
nhenin opened this issue Nov 9, 2023 · 0 comments
Open

Large/Deep Contract Support (Merkleized Contracts) Milestone Log #88

nhenin opened this issue Nov 9, 2023 · 0 comments

Comments

@nhenin
Copy link
Collaborator

nhenin commented Nov 9, 2023

Specification

Why Merkleizing Contracts ?
In many real world scenarios, the size of a Marlowe contract can pose challenges. For instance, a contract may be too big to fit on a Cardano transaction. To handle this situation, the Marlowe semantics and plutus validator both support a size optimization called merkleization. Merkleization is a process that transforms a contract from a tree structure into a merkle DAG (directed-acyclic graph) consisting of multiple contract fragments that reference each other by hashes.

Merkle DAGs translate well to storage in UTxO-based blockchains like Cardano, because these blockchains are themselves merkle DAGs. Transactions reference outputs of previous transactions by their hashes.

A merkleized Marlowe contract gives just enough information to validate the next transaction. When applying an input to a merkleized contract, the next contract fragment must be provided alongside the input. As long as the continuation's hash matches the hash contained in the existing fragment, we know the continuation is genuine. The provided continuation can then be used to compute the next contract that will be in effect after the input is applied.

**What is the Development Status of this Feature on the Marlowe Stack ? **

The Building Blocks necessary for this functionality are complete at the Runtime level (Runtime Rest API). We have to propagate the feature in the ts-sdk and build a prototype on top of it (Token Plan 2.0).

Design Session

See Miro board link: https://miro.com/app/board/uXjVNO9wt2A=/ Password: marlowe123

Execution Plan

  1. Implement marlowe-object in the ts-sdk (used by endpoints below)
  2. Implement these endpoints at the ts-sdk level :
    - Implement createContractSources #69
    - Implement getContractSourceById #70
    - Implement getContractSourceAdjacency #71
    - Implement getContractSourceClosure #72
  3. Revisit the Vesting "POC" using merkleization
  4. Working on Token 2.0 Milestone
@nhenin nhenin changed the title Merkleization Execution Plan Large/Deep Contract Support (Merkleized Contracts) Milestone Log#64 Nov 14, 2023
@nhenin nhenin changed the title Large/Deep Contract Support (Merkleized Contracts) Milestone Log#64 Large/Deep Contract Support (Merkleized Contracts) Milestone Log Nov 14, 2023
@nhenin nhenin self-assigned this Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant