Detail - bWorksApp/paas GitHub Wiki

This proposal is to complete a developing mainnet MVP. We submit this proposal into this category because we believe free, available smart contracts with classified validation logics will back to grow diverse dApps that clearly adopt to identified use cases.

The platform named PAAS based on our developing Cardano mainnet MVP uses for smart contract developers to publish their smart contracts classified by validator logics then dApp developers can select the right ones to build dApps by fetching APIs each time dApp build transactions.

It also provides the utilities:

Tools to compile Plutus, Marlowe and Aiken smart contract source code into Json objects.
Audit tools to:
Verify the source code of compiled smart contract.
Audit smart contract's validators and features.
Record meta data to track smart contract transactions which are built through platform.

The smart contracts should be classified by it validation logics:

Time.
Addresses.
Signature.
Harvest locked UTXOs.
Logic with params in datum, redeemer.
Combined validation logics.

Below are sample map smart contract validation logics to identified use case dApps:

Addresses validation -> pay salaries to a group, dividends to stake holder dApps.
Signature validation -> shipping, gift dApps.
Harvest locked UTXOs -> live casino dApp.
Logic with params in datum, redeemer -> DEX dApp.

So the idea is simple: if someone identified a use case to adopt dApp, they can go the platform select one smart contract that reflects the use case to build and launch its dApps.

The core logics of MVP is already worked for bWorks project and other dApp examples.

How it works

The possibilities

Complied Cardano smart contracts are JSON objects either they written in Plutus, Marlowe or Aiken languages so it is possible to post/get a smart contract via restful APIs and store it in document based db e.g Mongo DB at backend.

Publish a smart contract

A developer register its own smart contract as serialized script and source code github link
Describe datum and redeemer as a JSON object
Describe how script work with sample lock, unlock transactions and other extra information 
The backend then verifies the behavior of registered smart contract object to confirm its validator logic and datum & redeemer data type.
The admin from the community then audit this smart contract manually through a web function. 
Approve to list or reject the registered smart contract object.

Since it is impossible to read the logic with the compiled smart contract code. It is required to provide script public github code repo that lets microservice verify it comes from known source code and for the community to audit the contract.

Get a smart contract for dApp to build transactions

dApp developers select a smart contract that fit their dApp use case.
Developer web3 functions to submit transactions with this smart contract fetched via PAAS APIs.

Architecture

The project is include modules:

Backend APIs to provide REST endpoints for client requests and perform logics.
Microservices to handle system particular jobs e.g interact with Cardano nodes.
Developer frontend for plutus developer submit its plutus smart contract scripts.
CMS for admin to manage the platform overall.
Service subscriber frontend for users who want to use smart contract services.

Functions

Smart contract manager:
Register a compiled smart contract.
Compile haskell plutus, marlowe, aiken source code to serialized script.
Verify serialized script with given github code.
Audit the smart contract. 
Approve smart contract to list then available for dApp developer to use
Smart contract service provider:
Fetching serialized plutus script through APIs to build dApp
Monitor transactions of plutus scripts
Rate the usage of scripts
Dynamic modeling datum and redeemer data type
Delegate unlock trusted partner
Fetch smart contract list and a single smart contract to use in dApp for every transaction
Payment to pay developers for his smart contract usage
Model base and global search
Report
Plutus script utilizing statistic, number of API calls and amounts 
Lock and unlock transaction status   
Dashboard

Features

Freezed listed plutus script. This to make sure once a smart contract is listed and used by dApps it can not be changed since the change of plutus script may cause the scratch of dApps. The script developer has the right to provide another version only.   
Multi cabal and plutus versions build tool    
Dynamic modeling datum and redeemer data type
In app verify script behavior
Seamless applications
Email or Cardano wallet authentication 

Users

Smart contract developers. Who published its smart contracts
dApp developers. Who consume published smart contracts through APIs

Conclusion

The project can be seen as:

A smart contract verification and publication platform.
A platform to share smart contract.
The APIs to develop dApp without developing Plutus, Aiken or Marlowe scripts.
The service for smart contract developers to promote their product and earn.

This help to develop Cardano dApps much easier with significant lower cost. This benefit dApp investors, owners and developers.