Vote for lido! For Cardano Summit Educational Influencer Award.
funded
XSY - On-chain DApp Certifications
Current Project Status
In Progress
Amount
Received
₳60,000
Amount
Requested
₳300,000
Percentage
Received
20.00%
Solution

A robust on-chain DApp certification framework to empower developers to introduce powerful interoperability features and smart contract upgrade logic to decentralized protocols.

Problem

Currently, there is no widely adopted on-chain smart contract certification system for decentralized protocols on Cardano. This makes it difficult for DApps to build dynamic interoperability features.

Impact Alignment
Feasibility
Value for Money

Team

3 members

XSY - On-chain DApp Certifications

Please describe your proposed solution

The DApp Certification framework has been a long-anticipated feature for the Cardano ecosystem. The DApp Certification program described in CIP-0096 is a framework for the on-chain publication of audit certificates for DApps. Interested parties can then query these certificates and inspect and verify their claims. In its current form, this framework is extremely useful for products such as DApp catalogues and wallets because it enables them to provide this information to users, for instance, to notify them that they are interacting with an unaudited and potentially malicious contract. This can safeguard users against phishing and spoofing scams which seek to trick users into signing a malicious transaction by pretending to be a legitimate application or contract.

However, in its current form, the DApp Certification framework is missing several features which are critical to mass adoption. The certificates are published on-chain via the transaction metadata, which is not accessible from Plutus smart contracts. In this proposal, we will extend the DApp Certification program such that the relevant information from audit certificates will be made available for Plutus smart contracts. This will provide the building blocks required for developers to introduce dynamic interoperability into DApp protocols on Cardano. As it stands currently, without this feature developers must explicitly hard code all possible external interactions. For instance, if a lending DApp must swap liquidated collateral on a DEX then it needs to explicitly define each and every smart contract and state NFT through which the swap is allowed. This is not only laborious but also quite dangerous. With this feature, DApps will no longer have to explicitly define all possible external interactions. In place of enforcing that a swap is performed with a specific pool in a specific DEX, a contract can instead enforce that a swap is performed on any pool on any DEX as long as: the liquidity is sufficient; the price is amicable; or any other arbitrary criteria the developers want to establish. This allows smart contract protocols to be designed with very strong interoperability properties. Any smart contract protocol can leverage this by simply allowing UTxOs that contain DApp Certificates to be included as reference inputs. By doing so, the smart contract will have access to the audit certificate information and will be able to perform complex interactions without specific knowledge of the protocol.

One powerful use-case of these on-chain audit certificates is to enable a secure smart contract upgrade mechanism. In fact, DApps on Cardano have to decide between two painful options in regard to facilitating smart contract upgrades:

  1. Support smart contract upgrades & place user funds at risk.
  2. Do not support upgrades at the smart contract level but instead rely on a social migration to upgrade the protocol.

Option 1 introduces a backdoor to steal from users by moving funds to an arbitrary insecure smart contract thus deactivating security mechanisms.

Option 2 has a number of obvious issues. The first and foremost of which is that, if users are not informed of the protocol migration their funds will sit inactive indefinitely. In certain situations, their funds may even become inaccessible to them without special technical support or support from the protocol's authorized agents (which for instance might be required to interact with a depreciated liquidity pool on a DEX). Inactivity alone is a tremendous problem that is illustrated by the large amount of stake delegated to inactive pools.

This proposal offers a third option that facilitates smart contract upgrades without introducing a backdoor or allowing arbitrary transfers of users' funds.

Several components are required to facilitate secure DApp upgrades on Cardano.

  1. A set of onchain smart contracts to facilitate:
  2. The addition and removal of auditor credentials via onchain consensus.
  3. The issuance and peer review of audit certificates by accredited auditors.
  4. Onchain publication of audited script hashes and relevant audit information required to perform a safe smart contract upgrade. Information is verified by the presence of an audit certificate.
  5. An onchain utility library to facilitate the integration of the secure upgrade mechanism into existing Cardano smart contract protocols.

This secure upgrade mechanism seems to be critical for safety of most DApps requiring upgrades as well as for the whole Cardano ecosystem.

Please define the positive impact your project will have on the wider Cardano community

This proposal will enable smart contract protocols on Cardano to upgrade without relying on social migration or introducing a backdoor that puts user's funds at risk. The lack of a secure upgrade mechanism currently is a huge security risk for the Cardano ecosystem. Many of the top TVL protocols currently support arbitrary upgrade paths that put all the funds at risk, since a malicious upgrade can steal all funds. The secure upgrade mechanism will enable protocols to support smart contract upgrades without putting user's funds at risk. Furthermore, the enhanced DApp Certification framework will expand the realm of possibilities for Cardano DeFi protocols by enabling powerful interoperability features that otherwise would not be feasible.

The DApp certifications will allow users (and wallet providers) to easily verify whether the smart contract they are interacting with is audited. This protects users from being tricked into signing malicious transactions constructed by bad actors (i.e. the so called "wallet draining attacks").

What is your capability to deliver your project with high levels of trust and accountability? How do you intend to validate if your approach is feasible?

Our team consists of highly skilled developers with experience developing open-source tooling (Convex) in the ecosystem. Our developers are extremely experienced in all stages of DApp development on Cardano from design and architecture all the way to mainnet releases. They are intimately familiar with the requirements of DApp protocols, and the nuances of smart contract development on Cardano. We are uniquely positioned to deliver this critical infrastructure to the Cardano ecosystem.

Historically a number of promising well intentioned tools and libraries in the ecosystem did not see much traction upon release. Often this can be the result of the tooling being developed in a vacuum without feedback from production use-cases.

In order to make sure that the proposed framework is well-equipped for production use, we will develop and revise it with feedback from a live mainnet protocol.

What are the key milestones you need to achieve in order to complete your project successfully?

Milestone 1: CIP 96 describes a standardized method for certificates to be published and stores on-chain and for stake-holders to be able to verify the different claims of the certificates. However, the certificates are published onchain via the transaction metadata which is, in-practice, not accessible from Plutus smart contracts.

A prerequisite of our proposed secure upgrade mechanism is that relevant information from audit certificates is accessible from within Plutus smart contracts.

This milestone encompasses updating the specification of CIP-96 with respect to the following:

  • Who has the right to submit a request for posting an audit artifact to the certification contract ?
  • How to guarantee that the audit artifact meets the expected standards necessary to generate the certification token (mainly to be used for on-chain upgrade verification) ?
  • How to accept new auditors and who are eligible to form the committee to review the request for posting audit artifacts ?
  • Update the certification contract datum to facilitate the implementation of a secure on-chain upgrade mechanism.

Milestone 2: Once the framework for secure smart contract upgrades is established, protocols will have to integrate the newly established standard into their smart contracts. If they have to do so from scratch the burden of work required might dissuade them or they might make mistakes in utilizing the standard.

This milestone encompasses the development and publication of a smart contract library designed to vastly simplify the process through which existing DApps can implement a secure upgrade mechanism for their smart contracts.

Milestone 3: Our goal is to provide extensive developer documentation to ensure that this framework is not only user-friendly but also highly intuitive for developers to utilize effectively.

Milestone 4: We will develop a series of tests for the secure upgrade mechanism smart contract library. These tests will serve to offer a degree of confidence in the security and reliability of the framework.

Milestone 5: This milestone encompasses the development and publication of the overarching DApp Certification framework.

Final Milestone: This milestone entails the creation of testing procedures and the execution of a high-level security analysis for the DApp certification framework (along with the close-out video and report).

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

Jean-Frédéric Etienne has more than 15 years of experience in safety and threat analysis and is an expert in several formal verification techniques. He is currently the architecture and technical lead for the Djed implementation on Cardano and has put in place a property-based testing methodology to extensively assess the correctness and robustness of Plutus smart contracts against all potential attacks. He has also specified and proved the adaptation of the Djed protocol on the EUTxO model and has developed a set of Plutus libraries to produce optimized on-chain code.

Jean-Frédéric will be working on the design and architecture of the secure upgrade mechanism as-well-as safety analysis of the on-chain DApp certification framework.

Jann Müller is a Haskell programmer with years of experience in writing scalable, mission-critical systems. He has been working with Plutus since its inception and is the maintainer of the sc-tools library for Cardano apps. He is the lead developer of XSY and will be working on the off-chain parts of the framework.

Philip DiSarro is an expert in the field of Compiler Development & Programming Language Theory. He has made significant open-source contributions to the Cardano developer ecosystem. As a co-chair of the IOHK developer experience working group he worked to identify and resolve pain points that DApp developers experience in Cardano. He has a vast wealth of professional experience in smart contract security and auditing on Cardano; and was responsible for the identification and resolution of a large number of critical exploits in production open-source smart contracts. Recently, Philip has concentrated his efforts on designing and deploying effective zero-knowledge proof applications within the Cardano ecosystem. Philip is a senior Haskell developer on the XSY team, a consultant and lecturer for Emurgo, and the CEO and co-founder of Anastasia Labs.

Philip will be contributing to the implementation of the on-chain DApp certification library.

Romain Soulat has more than a decade of experience in the development and application of verification tools for high-profile certified products. He has been a research engineer for almost 10 years and is now the Technical Lead for Plutus High-Assurance at IOI, where he has been leading the development of testing tools. He has also been actively involved in the Certification working group and is the main author of CIP-0096.

Romain will be working on the new design of CIP-0096, using CIP-0068 style metadata. He will lead discussions with different stakeholders to ensure that the new design of CIP-0096 meets all the previously identified requirements, as well as the new ones from the types of applications described in this proposal. Additionally, he will ensure that the design will well be adopted by the community.

Amir H. Meyssami Rad is a Haskell developer and a member of the XSY development team with over two years of experience in developing on Cardano. His expertise spans wallet integration tools, off-chain transaction library development, DApp and on-chain development using Plutus across various projects.

Konstantinos Lambrou-Latreille is a Haskell programmer with more than 5 years of relevant experience. He worked for 3 years in IOG on Plutus off-chain tooling such as a node emulator for testing Plutus applications, a transaction building library, and a chain-indexer.

Please provide a cost breakdown of the proposed work and resources

Total cost: 300,000 Ada

  • 1 x update CIP-96 ( 8 weeks) - 100,000 Ada
  • Update spec
  • Meeting with CIP editors and working group
  • Discuss with Lace team to change spec
  • Discuss with CIP-72 team - present use case
  • 1 x engineer (14 weeks) - 100,000 Ada
  • Safety analysis on the CIP-96 spec
  • Draft a design specification for upgrade mechanism together with the development libraries to integrate a secure upgrade to any smart contract.
  • Formal verification on the merkle tree algorithm
  • Internally outside of proposal
  • DJED implementation on-chain code
  • Property-based testing ( 1 property modification STO31)
  • 1 x engineer ( 14 weeks) - 100,000 Ada
  • Implementation of development libraries
  • On/Off-chain code - certification contract
  • Property-based testing depends on no. of properties identified.
  • Best effort up to 50 properties

The schedule accounts for delays such that if the timeline exceeds the above, the work will be continued until the proposal is feature complete.

No dependencies

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

Simply put, right now users' funds in many DApps are at risk of being stolen via a malicious smart contract upgrade. This proposal intends to bring in a tangible and secure solution.

The proposed project's cost is valuable for the Cardano ecosystem by addressing critical security and usability concerns related to DApp upgrades. By investing in the development of a secure upgrade mechanism and associated components, Cardano can mitigate the risk of user funds being compromised during smart contract updates. This not only safeguards the ecosystem's reputation but also fosters user trust and confidence in Cardano-based DApps. Additionally, the project's commitment to testing and integration with real use cases, such as the DJED protocol, ensures that the solution is practical and effective. Furthermore, the provision of a smart contract library to have integrate this secure upgrade mechanism and comprehensive documentation streamlines adoption for existing DApps, reducing development overhead and potential errors. In essence, the project's cost translates into enhanced security, usability, and overall ecosystem stability, making it a sound investment for Cardano.

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