**Catalyst Project ID:** 1100127
**Catalyst Proposal:** *Enhancing Marketplaces: Aiken Language Optimization and Potential Novel Uses*
# **Milestone 1:** *Research and Development Plan - Analysis and Roadmap Development*
## FOR FULL RESEARCH NOTES PLEASE FIND THE LINK BELOW (14 page google doc):
[Catalyst Project ID: 1100127 - SUBMITTED FULL RESEARCH NOTES FOR MILESTONE 1](https://docs.google.com/document/d/1TZomvVifPOUeSlmihhgGENoh3_zn5FG2rGhZaPyhgo8/edit?usp=sharing)
Feel free to leave us comments and suggestions using the comment feature in google docs.
For an overview of the 14 page document please read on here :)
## 1. An analysis of the current state of the Aiken language within the Cardano marketplace ecosystem.
### **Existing Documentation**
**Official Resources:** The TxPipe team, developers behind Aiken, might have a project website or repository. Keywords would be: "TxPipe Aiken" or "Aiken smart contract language".
**Community Resources:** Prominent examples include Forums and Cataly Proposals.
* *Cardano Forums:* Search forums like "https://forum.cardano.org/" for discussions or threads mentioning Aiken and marketplaces.
* *Project Catalyst Proposals:* Look for proposals on Project Catalyst https://projectcatalyst.io/ related to Aiken and marketplaces. You can search using keywords like "Aiken", "marketplace", "smart contracts". Funded proposals provide valuable insights.
**Informative Articles:** Search for articles discussing Aiken and Cardano marketplaces. Titles like "Aiken: Revolutionizing Smart Contract Development on Cardano" or "Enhancing Marketplaces: Aiken Language Optimization and Potential Novel Uses" offer good starting points (found on Medium: https://medium.com/ and Lido Nation respectively).
**Staying Updated:** Follow Cardano and Aiken development on social media. Look for Twitter accounts or communities related to Cardano and blockchain development.
### Analyze Technical Performance
**Metrics and Tools:**
* *Execution Time:* Measure the time it takes for a smart contract to execute a specific function. Tools like profilers can be used within development environments.
* *Memory Usage:* Analyze the memory footprint of smart contracts written in both languages. Language features like garbage collection can significantly impact this metric.
* *Transaction Fees:* Estimate the Cardano transaction fees associated with deploying and executing smart contracts in Aiken vs. Plutus.
**Considerations:**
* *Benchmark Design: *Micro-benchmarks might not reflect real-world performance. Aim to design benchmarks that represent typical marketplace operations.
* *Hardware and Network Factors:* Performance can vary depending on hardware and network conditions. Control these factors during benchmarking as much as possible.
**Additional Resources:** Explore Cardano's benchmarking tools, like the Plutus Application Framework (PAF) meters, to understand existing performance evaluation practices within the ecosystem.
## 2. Identified areas for improvement and potential scalability solutions.
### Compile Feedback and Data:
While Aiken-lang offers promise for Cardano smart contract development, some limitations and areas for improvement exist. Here's a summary based on the feedback we simulated:
* **Limited Functionality:** Lack of built-in libraries for common cryptographic functions used in marketplaces. This can force developers to implement these functions from scratch, increasing development time and complexity.
* **Potential Complexity:** Aiken's garbage collection mechanism seems complex. A complex garbage collection system can be error-prone and introduce challenges during development.
* **Documentation and Learning Curve:** There might be a need for more documentation and tutorials to make Aiken more accessible to developers, especially those new to the language.
It's important to note that this is based on simulated feedback, and the actual pain points may differ. As Aiken matures and the community grows, these areas will likely receive significant attention.
### Consult with Experts:
###
#### Identifying Experts
* Cardano Foundation: The Cardano Foundation actively supports Aiken development. Reach out to them to connect with the development team or recommend resources for finding experts.
* Online Communities: Cardano forums and developer communities like "https://forum.cardano.org/" are a great place to find active Aiken developers and enthusiasts.
* Project Catalyst Proposals: Look for Project Catalyst proposals focused on Aiken development or improvement (refer to previous conversation for details). These proposals often involve experienced developers who could be valuable resources.
#### Brainstorming Solutions:
Once we've identified experts, we would consider these discussion points:
* Limited Functionality:
* Propose the development of standard libraries for common marketplace functionalities like secure token transfers and auction mechanics.
* Explore ways for community-driven library creation and contribution.
* Potential Complexity:
* Discuss potential simplifications to Aiken's garbage collection mechanism without compromising its efficiency.
* Explore alternative memory management approaches if necessary.
* Documentation and Learning Curve:
* Collaborate on creating comprehensive documentation and tutorials for Aiken.
* Encourage the development of online courses or workshops to introduce developers to the language.
### Prioritize Improvements:
###
In this section we outline priority areas for improvement based on their impact on performance, usability, and scalability. We will work on prioritized lists for improvements to Aiken-lang smart contracts, focusing on performance, usability, and scalability for the Cardano marketplace ecosystem
#### Top Priority (High Impact on All Three):
####
* **Standardization and Libraries:**
* Develop a core set of pre-built, secure, and well-tested libraries for common marketplace functionalities (token transfers, escrow services, auctions, dispute resolution, etc).
* This directly addresses performance by reducing redundant code and potential errors. It improves usability by providing building blocks for developers, and enhances scalability by enabling efficient reuse of code across marketplaces.
#### Medium Priority (Significant Impact on Usability and Performance):
####
* **Documentation and Learning Resources:**
* Create comprehensive documentation for Aiken, including tutorials, reference guides, and code examples.
* Develop online courses or workshops specifically designed for Aiken and Cardano marketplaces. **NOTE: This will be a proposed outline but we will not have time for the course itself to be built out within this proposal. Maybe in F13.**
* Improve accessibility of existing documentation.
* This directly improves usability by lowering the barrier to entry for new developers and fostering a more knowledgeable community. Better documentation can also lead to performance improvements by reducing development errors and inefficiencies.
#### Medium Priority (Significant Impact on Scalability):
####
* **Garbage Collection Optimization (if applicable):**
* If the current garbage collection mechanism is overly complex, explore ways to simplify it without compromising efficiency.
* A complex system can hinder scalability by introducing overhead during smart contract execution. Optimization can improve memory management and potentially lead to better performance in large-scale marketplaces.
#### Lower Priority (Long-term impact on Usability and Performance):
* Advanced Tools and IDE Integration:
* Develop Aiken-specific development tools and integrations with popular IDEs.
* This includes debuggers, profilers, and code completion features.
* These tools can improve usability by streamlining development workflows and potentially lead to performance improvements through better code quality and debugging capabilities. However, the impact is likely less significant than the previous areas.
## 3. A project scope defining the goals and objectives of the Aiken language upgrade.
Here we share the project scope defining the goals and objectives of the Aiken language upgrade
### **A. Set Goals and Objectives:**
Let us articulates what the project aims to achieve with the Aiken language upgrade, including technical and ecosystem goals.
**Technical Goal:** Show that upgraded smart contracts from plutus to Aiken-Lang with Deno and Typescript will do the following:
- increase transaction speed
- reduced costs
**Ecosystem Goal:**
- enhanced developer engagement
- increased adoption
### **B. Outline Key Deliverables:**
Let us now list the major outputs of the project, such as updated language documentation, new language features, and community engagement initiatives.
**The Key improvements Aiken-lang brings to smart contracts compared to Plutus on Cardano:**
- **Ease of Use:** Aiken-lang is designed to be more developer-friendly than Plutus. It has a simpler syntax and requires less boilerplate code. This allows developers to write and understand smart contracts more easily. Aiken also offers built-in testing frameworks to streamline the development process.
- **Performance:** Aiken-lang is said to offer significant performance improvements over Plutus. This means smart contracts written in Aiken can potentially execute faster and use fewer resources on the Cardano blockchain. This can lead to lower transaction fees for users.
- **Learning Curve:** For developers familiar with languages like Python or Javascript, Aiken offers a smoother learning curve compared to Haskell, the primary language used with Plutus.
**Articulate what the project aims to achieve with the Aiken language research:**
- **Increased Developer Adoption:** By making smart contract development easier with a more user-friendly syntax and built-in testing tools, Aiken aims to attract a wider range of developers to the Cardano ecosystem. This could lead to more innovation and a richer variety of applications built on Cardano.
- **Improved Smart Contract Performance:** Aiken strives to make smart contracts run faster and use fewer resources on the blockchain. This translates to potentially lower transaction fees for users interacting with these contracts. Faster execution times could also improve overall network scalability.
- **Simplified Learning Curve:** For developers already familiar with mainstream languages like Python or Javascript, Aiken offers a smoother transition into blockchain development compared to Haskell, the current primary language for Plutus smart contracts. This could lead to faster development cycles and a quicker influx of skilled developers into the Cardano ecosystem.
**The technical goals (e.g., increased transaction speed, reduced costs) and broader ecosystem goals (e.g., enhanced developer engagement, increased adoption):**
**Technical Goals:**
- **Increased Transaction Speed:** Aiken aspires to significantly improve the execution speed of smart contracts. This translates to faster processing of transactions on the Cardano blockchain, potentially leading to a smoother user experience and reduced wait times.
- **Reduced Costs:** Faster execution translates to lower resource consumption for smart contracts. This could lead to significant cost reductions in transaction fees for users interacting with these contracts on the Cardano network.
Broader Ecosystem Goals:
- **Enhanced Developer Engagement:** Aiken prioritizes developer-friendliness with a simpler syntax and less boilerplate code compared to Plutus. This aims to make writing and understanding smart contracts easier, fostering greater developer engagement with the Cardano ecosystem. Built-in testing frameworks further streamline the development process.
- **Increased Adoption:** By lowering the barrier to entry for developers, Aiken aims to attract a wider talent pool. This broader developer base could lead to a surge in innovation and the creation of a wider variety of applications built on Cardano, ultimately driving increased adoption of the platform."
### **C. Identify Stakeholders**
We want to find who will be impacted by the project and who needs to be involved in its execution, including developers, marketplace operators, and end-users.
1. **Developers:**
- **Smart Contract Developers:** They are the primary beneficiaries of Aiken-lang's easier syntax and development tools. They'll be able to write and deploy smart contracts faster and with more confidence due to improved security features.
- **Plutus/Haskell Developers:** Developers already familiar with Cardano's native smart contract languages might need to adapt or upskill to leverage Aiken-lang's advantages.
- **Aiken-lang Tool Developers:** Developers who contribute to building and improving Aiken-lang's development environment (compilers, debuggers, libraries).
2. **Cardano Ecosystem:**
- **Cardano Foundation:** As a supporter of Aiken-lang, they have a stake in its adoption within the Cardano ecosystem.
- **Marketplace Operators:** Operators of Cardano-based Decentralized Applications (DApps) marketplaces may see an increase in smart contract submissions due to Aiken-lang's ease of use.
- **Cardano Node Operators:** They might need to update their nodes to support Aiken-lang smart contracts in the future.
3. **End-Users:**
- **DApp Users:** Users of Cardano-based DApps will ultimately benefit from faster development cycles and potentially more secure smart contracts thanks to Aiken-lang.
- **Cardano Community:** The broader Cardano community has a stake in the success of Aiken-lang as it contributes to the overall growth and innovation of the platform.
4. **Additional Stakeholders:**
- **Security Auditors:** They will play a crucial role in verifying the security of smart contracts written in Aiken-lang.
- **Investors and Businesses Building on Cardano:** Businesses looking to build secure and reliable DApps on Cardano will be interested in the adoption of Aiken-lang."
### D. More Detailed on nest steps
For the development phase, testing plan, deployment strategy, and specific improvements to the Aiken language we plan on implementing the following:
#### Detailed steps for the development phase:
* Implement the specified smart contract functions in Aiken-lang, such as mintNFT, listNFT, buyNFT, etc. and new functions we will work on
* Develop the NFT data structure using the provided struct definition.
* Implement the bulkPurchase modifier and the buyNFTsInBulk function for bulk purchase functionality.
* Implement the staking-related functions: stakeNFT, unstakeNFT, claimRewards, getStakedNFTs, and getStakingDetails.
* Develop standard libraries for common marketplace functionalities like token transfers, escrow services, auctions, and dispute resolution.
* Create comprehensive documentation, tutorials, and code examples for the implemented features.
#### Testing plan:
* Conduct thorough unit testing for each smart contract function to ensure correctness and expected behavior.
* Perform integration testing to verify the interaction between different functions and components of the smart contract.
* Test the bulk purchase functionality with various scenarios, including multiple NFTs and insufficient funds among others.
* Verify the staking functionality by testing the staking, unstaking, and reward claiming processes.
* Conduct performance testing to measure execution times, memory usage, and transaction fees for each function.
* Perform security testing and auditing to identify and address potential vulnerabilities or attack vectors.
* Test the smart contract on a test network or a local development environment before deploying to the main Cardano network.
#### Deployment strategy:
* Compile the Aiken-lang smart contract code into the required format for deployment on the Cardano blockchain.
* Prepare detailed deployment instructions and documentation for marketplace operators and developers.
* Collaborate with the Cardano community and ecosystem partners to integrate the upgraded Aiken language into existing tools and frameworks.
* Provide migration guides and support for developers transitioning from Plutus to Aiken-lang.
* Continuously monitor and update the deployed smart contract to address any issues or incorporate new features.
* Engage with the community and gather feedback for further improvements and iterations.
#### Specific improvements to the Aiken language:
* Implement the specified smart contract functions to enhance marketplace functionality and user experience.
* Develop standard libraries to reduce redundant code, improve performance, and enhance scalability.
* Create comprehensive documentation and learning resources to lower the entry barrier for developers and foster a knowledgeable community.
* Optimize the garbage collection mechanism to improve memory management and scalability in large-scale marketplaces.
* Develop Aiken-specific development tools and IDE integrations to streamline development workflows and improve code quality.
* Incorporate the bulkPurchase modifier and buyNFTsInBulk function to enable efficient bulk purchasing of NFTs.
* Implement staking functionality to provide additional incentives and engagement opportunities for NFT holders.
# **Milestone 2: Language Development - Develop and Test the Enhanced Aiken Marketplace Contract Features**
Catalyst Project ID: 1100127 - SUBMITTED FULL RESEARCH NOTES FOR MILESTONE 2
All full notes and documents related to Milestone 2 can be found here in this [Google Drive Folder](https://drive.google.com/drive/folders/1tSzjiBaRFR6QfXobEc9E5rvB3YkFN1Kn?usp=sharing)
****
**Submission Checklist for Milestone 2 including links to each document (if you prefer to check them one at a time)**
- [X] _Google Document 1:_ GitHub Repos used in our research - **[Document 1](https://docs.google.com/document/d/1UIy87o55bd6OBatJ3_4hQYM3kJJZd5jrcqdTobFFmZo/edit?usp=sharing)**
- [X] _Google Document 2:_ Feature Documentation of the list of features tested - **[Document 2](https://docs.google.com/document/d/1-k4Z-aLiPmM68CPXxHztD29yGXlmDkThNUcvNq4zfM4/edit?usp=sharing)**
- [X] _Google Document 3:_ Testing documentation showing all the tests done on the aiken functions - **[Document 3](https://docs.google.com/document/d/1uQVmqCgmaO3sbokU5B_DMOW3bZLPqpO7aooMZpSoKjI/edit?usp=sharing)**
- [X] Google Document 4: Development Process Documentation - **[Document 4](https://docs.google.com/document/d/1LqZbOV1feabtuINhcjH1hJoiBdGat7yz8D22ZvwR2nI/edit?usp=sharing)**
- [X] Peer review proof for both code and documentation - **[Document 5](https://docs.google.com/document/d/1xjqF3ir3kASaVIHntr6ZsXnStsgLNcnO5RrJkoYpFdA/edit?usp=sharing)**
- [X] All documentation is clear, concise, and free of errors
****