Please describe your proposed solution.
<u>Introduction</u>
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.
Paas MVP prototype demo video:
<https://www.youtube.com/watch?v=4w8NyZIOnCM>Please try the MVP prototype at <https://paas.bworks.app>, credentials: demo/demo with functions:
- Post, get a smart contract APIs.
- Run dApp examples with posted smart contracts.
- Verify in app and onChain transactions at <https://cardanoscan.io>
<u>Current status of the project</u>
- Prototype of the MVP is developed and worked, core logics are verified.
- Common smart contract validators are not fully developed.
- Parts of project code is still at prototype level need refactor.
- Utilities are not fully developed yet e.g generalized contract audit tool.
- Security is not enforced. Performance is not benchmarked yet.
The proposal is to complete the project with outputs as a ready to go MVP for users with required works are listed in the milestones.
<u>Example</u>
A developer developed a Plutus smart contract script with validator logic that return true then the transaction will be succeed if:
- The signer’s signature is correct.
- The transaction submit time within given deadline.
Otherwise smart contract will return false and the transaction will be failed.
This contract can be used in many use case contexts e.g manage shipping, pay salary so the developer can publish this contract to PAAS then the contract will be persisted for other to use by fetching APIs every time they need smart contract to build transactions.
A dApp developer who develops e.g shipping manager dApp It can use this smart contract to rule the delivery by verify the signer signature and delivery time. It doesn't need to develop its own smart contract, they use available contract on platform by fetching API for every transactions.
This example worked on Cardano mainnet:
<https://cardanoscan.io/address/71fdf7eb205ba9ba574032db49fcdbf24e64d93c2a149e77c8807ce041>
<u>How it works</u>
<u>The possibilities</u>
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.
<u>Publish a smart contract</u>
- 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.
<u>Get a smart contract for dApp to build transactions</u>
- 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.
<u>Architecture</u>
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.
<u>Functions</u>
- 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
<u>Features</u>
- 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
<u>Users</u>
- Smart contract developers. Who published its smart contracts
- dApp developers. Who consume published smart contracts through APIs
<u>Conclusion</u>
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.
<u>Project contact</u>:
<u>Project diagram</u>
Architecture
Publish smart contract flow
Get a smart contract flow
MVP screenshoots
Dashboard
Published classified smart contracts
Publish a smart contract
dApp lock transaction with smart contract from PAAS API
dApp unlock transaction with smart contract from PAAS API
Result, Asset unlocked to receiver wallet
Reports
Mainnet TXs