RESTful wrapper for Plutus Offchain
current project status
Current Project Status
complete
Total
amount
Received
$32400
Total
amount
Requested
$32400
Total
Percentage
Received
100%
$32400 Received out of $32400
Solution
Enrich the usability of cardano components with a RESTful abstraction for off-chain plutus for dApps that runs with the Plutus Application Backend (PAB).
Problem
Variations across tools like cardano-cli, serialization libs and Plutus, like in data serialization create difficulty when more than one is present in a dApp stack.
Impact alignment
Feasibility
Value for money

This proposal was approved and funded by the Cardano Community via Project F9: Developer Ecosystem Catalyst funding round.

  • download
  • download

[IMPACT] Please describe your proposed solution.

For dApps designed with a backend running on the PAB, it will add a lot of utility to have a RESTful abstraction for the off chain code. A frontend can interact with the PAB to invoke the endpoints exposed via the Plutus off-chain code but the PAB cannot return a response back to the calling frontend. A RESTful response from the Plutus off-chain will provide access to attributes deduced with Plutus. For example, the script address of a parameterized Plutus contract.

Benefits:

A convenient way to bridge the frontend/backend for DApps with off-chain Plutus. The RESTful API can be used to fetch at runtime

  • Serialized datum
  • Datum hash as encoded by Plutus
  • Parameterized script address
  • Plutus pub key hash for a given bech32 address
  • CBOR encoded script generated with Plutus

What is listed above is not an exhaustive set of use cases for getting attributes from the off-chain code. However they go a long way to simplify the frontend-backend-Plutus interaction for a dApp.

To call out a related case, there are differences in the way data serialization is done by different tools like cardano-cli, serialization libs and Plutus. Unless identical serialized bytes are used the corresponding hashes turn out to be different. This leaves an inconsistency across toolsets and can become inconvenient to dApps that use more than one of the tools in their tech stack. This RESTful abstraction will make it easier to employ Plutus Application Backend (PAB) running Plutus smart contracts in the dApp stack.

It is important to highlight that this wrapper tooling is non intrusive that it does not change the way the PAB or Plutus off-chain works. Instead, it provides an abstraction to communicate with the Plutus off-chain code at runtime.

This diagram shows how the deployment model will be when this tooling is used.

Deliverables:

  • Open source repository of the implementation
  • Tooling: RESTful wrapper over Plutus off chain code
  • Examples: Sample PAB executable smart contract example and rest endpoints
  • Documentation: Documentation, tutorial and video walkthrough

How can dev teams use this solution?

The wrapper module (written in Haskell) can be imported into their projects which uses Plutus smart contracts. The wrapper will provide the necessary abstraction for the frontend/backend to access the Plutus off-chain. Dev teams can reuse the REST endpoints from this tooling and then wire those with their own smart contracts by following the examples which will be provided. The various endpoints can be invoked by a dApp frontend (or backend) and the REST based wrapper will interact with the off-chain code.

[IMPACT] Please describe how your proposed solution will address the Challenge that you have submitted it in.

This proposal is to develop tooling that can make dApp development in Cardano richer and easier. It aligns directly with the following guiding questions of this challenge.

How do we attract developers from outside of our current community to participate in Catalyst? - A RESTful abstraction is one of the most convenient patterns in software development today for system integrations. New Cardano developers already have a steep learning curve of learning how Cardano blockchain works (eUTXO model etc) as well as Plutus. This solution will help them bridge frontend/backend with off-chain Plutus for dApps running Plutus smart contracts in a familiar manner.

What do developers want, and how do they get it from the Cardano dev ecosystem? - Developers often want open source and tested code that they can adopt in their development, preferably from those who have been in the space for longer. This will be one of the open source repositories through which we share our expertise and learning from working on Cardano.

What are enterprise dev managers looking for in order to be able to build out enterprise projects - either internal or commercial? - To have standard approaches to doing something and not having to reinvent the wheel are aspects that dev managers focus on. This solution gives a readily usable tooling/codebase to help in dApp development.

Among the potential directions listed in the challenge, this solution fits under 'Deployment, testing, and monitoring frameworks', 'Samples, recipes and templates' and 'Support structures'

[IMPACT] What are the main risks that could prevent you from delivering the project successfully and please explain how you will mitigate each risk?

Overall, this is a low-risk project as delivery can be only delayed but not prevented.

  1. Unforeseen circumstances affecting availability of dev resources - In case the availability of dev resources reduces during the course of the project due to health issues or other unforeseen circumstances, it will put a strain on the timeline. However, it can only cause a delay in the timeline and cannot prevent delivery. We will be able to complete the development even with just 1 developer although with a delayed timeline if it comes to that.
  2. IOG or another team building the exact solution in the immediate future - At this point we are not aware of IOG or any other team building this open source solution. In the rare case that such a situation arises before we complete the project, we would like to collaborate with that team. This project may still be deemed successful if a better tooling arises out of such collaborative effort.

[FEASIBILITY] Please provide a detailed plan, including timeline and key milestones for delivering your proposal.

The roadmap for this project is planned based on the work breakdown, biweekly milestones and timeline are described here. Also, please note that though the team members have ongoing projects from previous funds which are on track. One of our Fund 8 projects under Open Source Developer Ecosystem got completed (visit repository) 2 weeks ahead of schedule. This gives us additional bandwidth to stick to the timeline below.

Week 1-2:

Develop a minimal version of RESTful wrapper component with one endpoint

PAB executable smart contract for one example use case

Review and test cases

Milestone: Dev complete for a single end to end flow

Week 3-4:

Integration as a PAB executable project

Preliminary testing on testnet with PAB

Add utility functions for easier extension

Milestone: Preliminary testing on testnet complete

Week 5-6:

Expand RESTful wrapper with more endpoints

Review and test cases

Integration testing

System testing on testnet with PAB

Milestone: Dev complete for project. Testing on testnet complete.

Week 7 - 8:

Acceptance testing on mainnet with PAB

Prepare Documentation and Tutorial

Video walkthrough

Close out

Milestone: Repository ready for use

Week 9:

Buffer window: To make up for any unexpected delay.

Week 10:

Buffer window: Close out

Maximum time required from start to close is 2.5 months.

[FEASIBILITY] Please provide a detailed budget breakdown.

The effort estmate and budget calculation is as follows:

Effort:

  • RESTful API with utility functions - 120 hours
  • PAB executable smart contract examples (2-3 use cases) and wiring with REST endpoints - 80 hours
  • Estimated hours for test cases and peer review - 40 hours
  • System testing testnet with PAB - 40 hours
  • Acceptance testing on mainnet with PAB - 25 hours
  • Prepare documentation and tutorial - 40 hours
  • Prepare video walkthrough - 20 hours
  • Contingency estimate for effort (10%) - 40 hours

Total engineering hours = 405

Requested budget (@80/hr) : 32400

[FEASIBILITY] Please provide details of the people who will work on the project.

We are a group of experienced Software Engineers/Plutus Pioneers/ community ambassadors in the Cardano ecosystem. We are passionate about Cardano and open source development and have been building with Cardano for close to a year. You can view our work on open source repositories for Plutus/Cardano in our Github repo.

Github: https://github.com/lambdacc

People working on this project are:

Reshma Mohan

Software Engineer with 8 years of experience. She is Plutus Pioneer from the 1st cohort. She now spends most of her work time developing in Haskell and drafting articles about Cardano. She is also active in the community as an Ambassador to Genius Yield DEX platform. She holds a Bachelor of Technology degree in Electrical and Electronics Engineering.

Sandeep Sharma

Software engineer with over 10 years of experience. He holds a Bachelor of Technology degree in Computer Science. He specializes in backend development and API integrations.

[FEASIBILITY] If you are funded, will you return to Catalyst in a later round for further funding? Please explain why / why not.

No. The scope of this project is for a fullly functional tooling to assist developers. It will not need further funding.

[AUDITABILITY] Please describe what you will measure to track your project's progress, and how will you measure these?

Progress will be measured by as per the biweekly milestones listed. What we enumerated under the section for timelines and milestones is a work break down. That will be our basis for measuring the progress of this project. We will measure

  • Status of each work item through a week
  • Attainment of each milestone
  • Ensure regular peer review to avoid rework.

These metrics will be included in progress reports that we submit during the course of implementation.

[AUDITABILITY] What does success for this project look like?

Success of this project will look like

  • Many dev teams making use of this toolset in dApps which have Plutus smart contract deployed on PAB.

  • Activity under Github issues by way of seeking new features, improvements or reporting bugs.

  • Pull requests from new contributors to this repository.

  • A positive feedback from the dev community about benefits of this tooling.

    [AUDITABILITY] Please provide information on whether this proposal is a continuation of a previously funded project in Catalyst or an entirely new one.

This is an entirely new proposal.

Sustainable Development Goals (SDG) Rating

SDG goals:

Build resilient infrastructure, promote inclusive and sustainable industrialization and foster innovation

SDG subgoals:

Develop quality, reliable, sustainable and resilient infrastructure, including regional and transborder infrastructure, to support economic development and human well-being, with a focus on affordable and equitable access for all

Key Performance Indicator (KPI):

Universal Human Rights Index (UHRI):

#proposertoolsdg

Avis des conseillers communautaires (1)

Comments

Monthly Reports

The first milestone as per roadmap in the proposal was completed. A single end to end flow is dev complete and publised under the open source repo. It provides the set up for a restful server for Plutus offchain with one endpoint which provides the Plutus pub key hash for a given bech32 address. Design and implementation of remaining deliverables are in the process.

Disbursed to Date
$32,400
Status
Still in progress
Completion Target
1. In the next month
Comments 0

Login or Register to leave a comment!

Two new functionalities were added to the project since the last report along with more utility functions. Those are 1. getting Parameterized script address and 2.CBOR encoded script generated from Plutus Contracts. The public repository has been updated. Two smaller endpoints will be added and tested by the end of the month and project is on track to be dev complete in another 2 weeks, at which point all remaining milestones as per the proposal would be achieved.

Disbursed to Date
$32,400
Status
Still in progress
Completion Target
1. In the next month
Comments 0

Login or Register to leave a comment!

The development and testing of this open source tooling was completed. Walkthrough guide was prepared. The public repository was published and is ready to use. All relevant information has been included in the project repository.

Disbursed to Date
$32,400
Status
Complete
Completion Target
1. In the next month
Comments 0

Login or Register to leave a comment!

close

Playlist

  • EP2: epoch_length

    Authored by: Darlington Kofa

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

    Authored by: Darlington Kofa

    4 min 3 s
    Darlington Kofa
  • EP3: key_deposit

    Authored by: Darlington Kofa

    3 min 48 s
    Darlington Kofa
  • EP4: epoch_no

    Authored by: Darlington Kofa

    2 min 16 s
    Darlington Kofa
  • EP5: max_block_size

    Authored by: Darlington Kofa

    3 min 14 s
    Darlington Kofa
  • EP6: pool_deposit

    Authored by: Darlington Kofa

    3 min 19 s
    Darlington Kofa
  • EP7: max_tx_size

    Authored by: Darlington Kofa

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