Please describe your proposed solution
Problem
Transaction flow design is a challenging problem for Cardano smart contract creators. Typically, transactions must be checked for numerous conditions to be processed by a protocol or dApp. The validation logic is incorporated into ledger scripts which are of limited size.
However, most dApps are complex meaning they rely on various transaction types incorporating complex contexts. Adequately processing these transactions within a protocol's complex rule set is a challenge most teams struggle to overcome. Naive design decisions often incur huge costs later on as application complexity grows.
Need for Enhanced Design Patterns and Open-source Tooling
The expansion of the Cardano ecosystem and the increasing complexity of applications being built on its platform necessitate more adaptable and efficient transaction protocols. Developers need tools to facilitate this process and to ensure protocols can be updated efficiently and relatively painlessly.
Furthermore, inadequate designs are costly, leading to:
- Script bloat
- Convoluted designs difficult to reason about
- Challenges as product applications evolve
- Cumbersome upgrade paths
Among similar issues.
Solution
The YTxP project aims to address these challenges by developing two key libraries: ytxp-lib and ytxp-sdk. These libraries evolve the Transaction Token Pattern (TxTP) into a more generic and flexible pattern. Overall, the YTxP has several key elements:
- Transaction Families: YTxP categorizes transactions within the context of a protocol. Transaction types are identified by the component UTxO types they act on, which are in turn (often) verified by the State Thread Token they contain. Transactions of different types can be composable. Organization of this kind greatly reduces the surface area of protocol updates..
- Yielding Scripts: Scripts that execute and release their associated UTxOs only when preconditions have been met.
- "Yielded To" Scripts: Staking validators, minting policies, or validator hashes which effectively delineate transaction families
YTxP can be implemented with a variety of on-chain and off-chain frameworks. This proposal includes ytxp-lib as a plutarch reference implementation of the on chain code. ytxp-sdk, on the other hand, focuses on YTxP types supporting both on-chain and off-chain frameworks, serialization, cardano-api compatibility, etc.
By offering an improved transaction protocol architecture alongside an on-chain supporting framework and utilities, these libraries will enable developers to build more robust and efficient smart contracts, enhancing the Cardano ecosystem's capabilities.
Market
The primary beneficiaries will be the YTxP library consumers, AKA Cardano smart contract developers. However, downstream improvements will positively impact DApp users by providing more feature-rich applications and faster product cycles.