Please describe your proposed solution
Protofire - Cardano Developer Studio v2 (Dev Studio v2) is a significant evolution of the original version, designed to provide a comprehensive and highly interactive development environment for Cardano smart contract developers. Our solution is divided into two main components: the Dev Studio Repository and the Dev Studio VS Code Extension.
Background on Developer Studio
The original Developer Studio, funded by a previous Catalyst proposal, was created to address the challenges in Cardano smart contract development. It provided an all-in-one repository with automated multi-container workflows using Docker Compose, simplifying the setup of essential tools like Cardano Node, Wallet, and DB Sync. This initial version significantly reduced the time and complexity involved in setting up a Cardano development environment.
Links:
Dev Studio v2 builds upon this foundation, expanding its capabilities and introducing a more intuitive, integrated development experience.
Dev Studio Repository
New Tools and Containers
- Dev Studio will incorporate new tools to enhance development in Cardano, including Scrolls (a tool for maintaining optimized collections of on-chain entities).
- Generic development container: An improvement of the current development container. The new container includes tools for development in Haskell and Aiken, providing a complete environment for compiling and testing smart contracts.
- Container for creating and managing custom Cardano test networks:
- Allows configuring private networks with one or multiple interconnected nodes.
- Customization of network parameters (slot time, etc.) to simulate different scenarios.
- Ideal for development and testing in a controlled environment without external interference.
CLI Improvements
- More user-friendly, visually appealing, and detailed menus to guide users through the different functionalities.
- Enhanced user experience for more intuitive navigation.
- Creation of contract development repos from templates and certain user configurations: language, versions of compilation tools to include in dev container, extensions to include, etc. The Dev Containers created in these repos include the new Dev Studio extension.
Configuration and Compatibility
- Central JSON configuration file for Dev Studio:
- Includes availability matrix and version compatibility for node, wallet server, dbsync.
- Contains download paths for all images and tools.
- Provides information on availability of snapshots and images on Docker Hub.
- Allows us to keep Dev Studio always up-to-date, despite the ever-changing world of Cardano and its tools. This JSON could be updated in the repo or the repo itself could have a function in the CLI to update the JSON, avoiding the need for the user to download the entire Dev Studio again.
Advanced File and Data Management
- Specific folders for configuration and data of each tool.
- Separation by network, versions, and customizable names.
- Automatic recognition of configuration and data folders by each container/tool.
VS Code Dev Studio Extension
Initial Setup and Project Management
- Support for multiple languages: Haskell, Aiken, Helios.
- Creation of projects from scratch or integration with existing user repos.
- Generation of repos based on smart contract templates and some user inputs: chosen language, versions of compilation tools, extensions to add in dev container, etc.
- Integration with specific Dev Containers for each language:
- Provides pre-configured development environments with necessary compilers and tools.
- Includes VS Code extensions specific to each language (linters, formatters, etc.).
- Allows for consistent development regardless of the user's local environment.
Contract Compilation
- Support for Haskell, Aiken, and Helios.
- Standardized project structure to facilitate interaction with the extension (specific file naming conventions and folder structure).
- Basic Code Analysis:
- Automatic detection of validators and policies in the code
- Extraction of parameters necessary for compilation
- Identification and analysis of datums and redeemers
- Haskell and Aiken: compiler in local environment or in dev container.
- Helios: Compilation integrated into the extension (JavaScript compiler).
- Interface with input fields to provide compilation parameters based on the parameter structure of parameterizable contracts.
- Generation and storage of results in JSON format and blueprint when applicable.
- Specific folder structure for compilation results
- Management of generated artifacts (compiled scripts, Blueprints)
Interaction with Contracts
- Possibility to create/edit blueprints to define the structure and behavior of contracts.
- Blueprint-based transaction creation system:
- Dynamic generation of interfaces for redeemers and datums according to contract specification.
- Support for different data types according to Blueprint CIP
- Support for different types of basic transactions: minting, creation, consumption, and updating. Selection of UTXOs for inputs and configuration of outputs (addresses, values -tokens- and datums).
- Selection of specific redeemers and datums from the blueprint for each transaction:
- Minting: Choice of redeemers.
- Creation: Choice of datum.
- Consumption: Choice of redeemer.
- Update: Choice of redeemer and new datum.
- Validation of inputs based on the data types expected by the contract.
Connection with Network and Tools
- Automatic detection of Cardano nodes, networks, and auxiliary tools in the local environment.
- Flexible integration with different backends:
- Priority use of local nodes and tools managed by Dev Studio.
- Option to connect with external API services such as Blockfrost (requires additional configurations, such as API key, etc.).
UTXO and Balance Management
- Detailed visualization of UTXOs associated with addresses and contracts.
- Calculation and presentation of total balances and per UTXO.
- Detailed information about native tokens in each UTXO.
- To create transactions, UTXOs that will be part of the inputs can be chosen.
Bidirectional Integration with Dev Studio Repository
- The extension detects and uses containers and tools managed by Dev Studio.
- The Dev Studio CLI offers options to create new projects with:
- Predefined templates.
- Dev Containers configuration.
- Automatic installation of relevant extensions, including the Dev Studio extension.
Advanced Features (Planned for Future Versions)
- Contract testing.
- Creation and interpretation of blueprints from code.
- Standard specification for complex transactions and interface to operate them.
- Integration of Helios and Aiken playgrounds within VS Code.
Development in Web-Based
- Environments Support for VS Code in browser:
- Possibility to install the Dev Studio extension in VS Code for Web.
- Creation and compilation of Helios contracts directly in the browser, without the need for additional compilers.
- Contract testing and transaction creation from the web environment.
- Integration with cloud development platforms:
- Support for GitHub Codespaces: Automatic configuration of complete development environments in the cloud.
- Integration with Gitpod: Use of .gitpod.yml and .gitpod.Dockerfile files to configure development environments.
- Allows users to work on Cardano projects completely in the cloud, with associated costs depending on the chosen platform.
Workflow and Usability
The Dev Studio extension is designed to provide a guided, step-by-step workflow that encompasses the entire lifecycle of smart contract development in Cardano:
- Project creation or opening.
- Development environment configuration.
- Writing and compiling contracts.
- Generation and manipulation of blueprints.
- Interaction with the Cardano network (local or public).
- Creation and execution of transactions.
- Visualization and analysis of results.
This approach allows developers, from beginners to experts, to efficiently navigate the development process, reducing the learning curve and increasing productivity.
Integration and Flexibility
A key aspect of our solution is the seamless integration between the Dev Studio Repository and the VS Code extension. This allows developers to leverage the power of the repository's containers and tools directly from their VS Code development environment.
Flexibility is another strong point: the extension can detect and work with different environments (local, Docker, Blockfrost), adapting to each developer's preferences and available resources.
Future Vision
Our long-term vision is for Cardano Developer Studio v2 to become the standard development environment for Cardano, similar to what Remix is for Ethereum. We plan to continue expanding the platform's capabilities, including:
- Advanced testing and simulation tools.
- Deeper integration with contract analysis and optimization tools.
- Support for emerging design patterns and standards in the Cardano ecosystem.
- Continuous improvements in user experience and accessibility for new developers.
With Cardano Developer Studio v2, we aim to significantly accelerate application development in Cardano, fostering innovation and ecosystem growth.