completed
Marlowe - Decentralized Oracle Integration
Current Project Status
Complete
Amount
Received
₳235,714
Amount
Requested
₳235,714
Percentage
Received
100.00%
Solution

Integrate the existing Marlowe Runtime with feeds from well-known decentralized oracles in the Cardano ecosystem, such as Charli3

Problem

Marlowe is a brand new framework for building and running financial contracts. Decentralized oracles are a mandatory component in many scenarios. Marlowe lacks integration with decentralized oracles.

Feasibility
Value for money
Impact / Alignment

txpipe

2 members

Marlowe - Decentralized Oracle Integration

Please describe your proposed solution.

Context

  • Marlowe is a brand new language and runtime for developing financial smart contracts.
  • Marlowe contracts are built by combining a small number of building blocks that describe making a payment, waiting for a certain condition and other similar types of concepts.
  • Oracles is a whole category of tools that share the goal of injecting information onto the blockchain so that it can be used as part of on-chain validations (aka: contracts)
  • Decentralized oracles is a subset of the above that incorporates the desired feature of ensuring a higher level of assurance of the information by combining independent sources from independent parties.
  • Charli3 is the more notable decentralized Oracle protocol in the Cardano ecosystem. There's also Orcfax which is still in development, as far as we know.
  • Marlowe currently has a mechanism to inject information feeds from external sources into contract actions, but it requires a high degree of trust from the participants of the contract.

Technical Plan

Build a new off-chain component on top of the current Marlowe backend (the Marlowe Runtime) that integrates Marlowe contracts with feeds from Charli3.

We'll also integrate with COOP compatible feeds (eg: Orcfax) if there's any active Oracle in the network by the time we reach development.

This new component will be in charge of executing the following business logic:

  • Watch the blockchain in search for Marlowe contracts; introspect the internal logic and select only the instances that show a requirement for one of these oracles.
  • Watch the blockchain in search for compatible Oracle feeds and keep track of the corresponding reference inputs.
  • Upon finding a match between contract and feed, construct a particular transaction that will map the source data from the Oracle into a Marlowe action that can resolve a condition within the logic of the contract.

Build a new on-chain validator that will participate in the transaction that activates the condition of the Marlowe contract. To avoid any kind of trust requirements on the off-chain component, this on-chain validator will execute the following checks:

  • Ensure the presence of the reference input from the corresponding oracle and any corresponding authentication token.
  • Ensure the presence of an output to the Marlowe contract with the required redeemer (aka IChoice action)
  • Ensure that the data from the oracle’s reference input matches the data in the outgoing Marlowe redeemer.
  • Ensure that the corresponding Marlowe “role” token is present in the inputs and passed back to itself.

Lastly, combine both off-chain and on-chain components into a package for easy provisioning and execution by 3rd-party teams.

How does your proposed solution address the challenge and what benefits will this bring to the Cardano ecosystem?

An out-of-the-box integration of Marlowe with decentralized Oracles will simplify the development of a wide range of new types of contracts running on Cardano.

Decentralized Oracles have huge untapped potential, by enabling new ways of consuming its features we promote their usage and increase their visibility across the Cardano ecosystem.

How do you intend to measure the success of your project?

We’ll measure the success of the project by level of engagement and usage of our new integration mechanism:

  • Common activity metrics in the open-source Github repository, such as: number of issues, contributors, traffic, etc;
  • On-chain activity metrics of transactions that involve our integration, such as: number of Marlowe contracts including our integration, number of transactions consuming oracle feeds.
  • Level of engagement from developers through TxPipe existing communication channels, such as: our Discord server, our Twitter announcements and tech support ticketing system.

Please describe your plans to share the outputs and results of your project?

Being an open-source project, the outputs will be available to any developer in the ecosystem at every step of the development process:

  • Latest version of the source-code will be available in the Github repository.
  • Source code changes will be applied through a pull-request process.
  • Alpha and Beta versions will be released at every milestone.

Upon reaching the end of the development process, we’ll provide:

  • A LTS release version of the off-chain component available to download in many formats (binary, Docker image, etc)
  • A CLI (command line interface) binary to serve as entry point for developers
  • A documentation website with instructions for usage and deployment
  • A collection with examples of contracts consuming oracle feeds

After a reasonable (1-3 months) period after the end of development, we’ll provide:

  • A report describing on-chain activity of the integration
  • A report describing dev community engagement with the project

What is your capability to deliver your project with high levels of trust and accountability?

TxPipe is very proud of their past and current contributions to the ecosystem. Just to mention a few:

  • We have developed “Pallas”, a Rust library for Cardano which is used by several high-profile project in the community (such as: cncli and Aiken)
  • Through Catalyst, we have developed and delivered “Oura”, an off-chain data integration tool for Cardano used by many projects in the community (such as: Pool.io and dcSpark’s Carp, etc).
  • Through Catalyst, we have developed “Dolos”, a minimalistic version of the Cardano node which is being slowly rolled out to the community as a beta version.
  • We have developed “Demeter”, a cloud hosting platform for Cardano infrastructure with several high-profile clients (such as: JPG.store, SummonPlatform and others).

The above are examples of our accountability because:

  • It shows our commitment to evolving the open source community and the Cardano ecosystem.
  • It shows the technical expertise required to develop and maintain Cardano infrastructure.
  • It shows our commitment to the Catalyst program and its required procedures.

What are the main goals for the project and how will you validate if your approach is feasible?

Integrating Marlowe contracts with decentralized oracles aims to fulfill the following objectives:

  • Enable a whole new range of contracts that require verified oracle feeds
  • Increase visibility and usage of Marlowe contracts in the Cardano network
  • Increase visibility and usage of decentralized contracts in the Cardano network
  • Provide an out-of-the-box solution that simplifies development and reduces boilerplate for developers in the Cardano ecosystem

Please provide a detailed breakdown of your project’s milestones and each of the main tasks or activities to reach the milestone plus the expected timeline for the delivery.

Milestone #1: Off-chain component development (2 month)

  • Develop chain watch mechanism and filtering of Marlowe contracts
  • Develop transaction building logic for Charli3 feeds
  • Develop transaction building logic for COOP-compatible feeds

Milestone #2: On-chain component development (1 month)

  • Develop Aiken on-chain validator for Charli3 feeds
  • Develop Aiken on-chain validator for COOP-compatible feeds (subject to progress of the Orcfax project)

Milestone #3: Packaging and release (1 month)

  • Package backend components for distribution (Docker image, binary release)
  • Publish documentation site and examples

Milestone #4: Final report (3 months)

  • Gather on-chain metrics
  • Gather Github repository metrics
  • Prepare and share final report

Please describe the deliverables, outputs and intended outcomes of each milestone.

Milestone #1: Off-chain component development (2 month)

  • Output: an open-source repository containing the required codebase for the off-chain component of the project.
  • Outcome: we validate that our backend is capable of connecting Charli3 and (potentially) COOP-compatible oracle feeds with Marlowe contracts requesting those feeds (no on-chain validation).

Milestone #2: On-chain component development (1 month)

  • Output: an open-source repository containing the required codebase for the on-chain component of the project written in Aiken.
  • Outcome: we validate that our backend is capable of executing an end-to-end flow of the oracle feed integration, including on-chain validation.

Milestone #3: Packaging and release (1 month)

  • Output: a working backend packaged as docker image and a binary release; including a documentation site with usage examples.
  • Outcome: 3rd-party developers have access to well-documented mechanisms for running their own instances of the backend.

Milestone #4: Final report (after 3 months)

  • Output: a working backend packaged as docker image and a binary release; including a documentation site with usage examples.
  • Outcome: 3rd-party developers have access to well-documented mechanisms for running their own instances of the backend.

Please provide a detailed budget breakdown of the proposed work and resources.

FTE = full-time equivalent

All values expressed in ADA (₳)

Breakdown by resource type:

  • Rust developer: 1 FTE x 3 months = ₳ 128,571
  • Aiken developer: 1 FTE x 1 months = ₳ 85,714
  • Technical writer: 1 FTE x 1 months = ₳ 10,714
  • Project manager: 1/4 FTE x 4 months = ₳ 10,714

Breakdown by milestone

  • Milestone #1: ₳ 91,071
  • Milestone #2: ₳ 88,393
  • Milestone #3: ₳ 50,893
  • Milestone #4: ₳ 5,357

Who is in the project team and what are their roles?

This project will be coordinated by the TxPipe team. In particular, the following people will be involved in the development:

As explained in the solution section, a new hire will take care of the role of Rust developer for the actual contributions.

How does the cost of the project represent value for money for the Cardano ecosystem?

The resources associated with the development process will result in open-source code that can be leveraged by any team or member of the Cardano ecosystem.

Enabling new use cases around Marlowe contracts and decentralized oracles are a valid mechanism to promote usage of the network; more chain activity.

close

Playlist

  • EP2: epoch_length

    Authored by: Darlington Kofa

    3m 24s
    Darlington Kofa
  • EP1: 'd' parameter

    Authored by: Darlington Kofa

    4m 3s
    Darlington Kofa
  • EP3: key_deposit

    Authored by: Darlington Kofa

    3m 48s
    Darlington Kofa
  • EP4: epoch_no

    Authored by: Darlington Kofa

    2m 16s
    Darlington Kofa
  • EP5: max_block_size

    Authored by: Darlington Kofa

    3m 14s
    Darlington Kofa
  • EP6: pool_deposit

    Authored by: Darlington Kofa

    3m 19s
    Darlington Kofa
  • EP7: max_tx_size

    Authored by: Darlington Kofa

    4m 59s
    Darlington Kofa
0:00
/
~0:00