Introducing Scalus: Empowering Cardano DApp Development with Scala

TLDR

Project Name: Scalus

Project Lead: Alexander Nemish

Request for Funding: 290,400 ADA for 6 months

Open Source: Yes

Scalus is a project proposed by a former compiler engineer at IOG, Alexander Nemish, to simplify and enhance the development of decentralized applications (DApps) on the Cardano blockchain. The project aims to provide a Scala implementation of Cardano Plutus, allowing developers to write Cardano smart contracts using the Scala programming language.

The benefits of Scalus are numerous:

It enables the use of a well-established language (Scala) that has a larger pool of talent, a robust development community, and compatibility with multiple platforms. This means more developers will be able to create DApps for Cardano without needing to learn a new language.

Developers will be able to write code once and use it on multiple platforms, frontend and backend, and easily integrate with other languages like Java, Kotlin, JavaScript, TypeScript, or even Rust.

It offers a lower level API for UPLC (Untyped Plutus Core) code creation, giving developers more control and flexibility over their contracts.

Scalus provides extensive testing options, including property-based testing framework, to ensure rigorous testing of contracts and DApps.

All the outputs of this project will be open-source and available on GitHub.

The success of the project will be measured by the number of developers happily using Scalus and the number of successful projects using it. The team also plans to share updates via GitHub, their official website, and social media platforms.

The project is split into several phases. The first phase, Scalus Core, is expected to be completed in about three months and will result in a working and tested code. The second phase, APIs and integrations, will take about two months, and the final phase, documentation, examples, and tutorials, is expected to be completed in a month.

The budget breakdown is detailed and seems cost-efficient given the significant benefits and potential it holds for the Cardano ecosystem. Scalus plans to make DApp development simpler, faster, and less expensive, and if successful, could have a substantial impact on the Cardano Developer Ecosystem.

Background on problem

The problem stems from the inherent complexity of blockchain technology and its implications on software development, specifically the creation of decentralized applications (DApps) on the Cardano blockchain.

In the blockchain world, and especially in Cardano’s ecosystem, DApps play a pivotal role. These applications leverage the decentralized nature of the blockchain to create innovative solutions, from financial products to voting systems, supply chain management, and more. They have the potential to revolutionize various sectors by introducing trust, transparency, and immutability, while eliminating the need for intermediaries.

However, DApps development presents a set of challenges that aren’t usually encountered in traditional software development. One such challenge is the learning curve associated with mastering new programming languages specifically designed for smart contract development.

For the Cardano blockchain, the primary language for writing smart contracts is Plutus, which is based on the functional programming language Haskell. While Plutus is robust and designed to handle the complexities of blockchain technology, the pool of developers who are proficient in Haskell and, by extension, Plutus, is not as large as those of more widespread languages. This poses a limitation for the adoption and development of DApps on Cardano.

Also, the Plutus language is employed for on-chain contract logic, but for the off-chain parts (which is a considerable portion of any DApp), developers have to resort to other languages. This can lead to inefficiencies and inconsistencies, especially when these parts need to communicate or when a certain code base has to be replicated in different languages.

Furthermore, there’s a need for a more diverse, mature, and readily available set of development tools and libraries. Developers appreciate and often require a comprehensive set of tools, including a well-supported IDE (Integrated Development Environment), effective debugging tools, extensive libraries, and a large community for support.

While the Cardano ecosystem is growing and becoming richer, providing developers with a familiar environment can boost the development pace and adoption of DApps, leading to a broader and more varied range of applications available for end-users on the Cardano blockchain.

In addition, compatibility across various platforms (such as JVM, JavaScript, TypeScript, and potentially LLVM/WebAsm, Android, and iOS), and the ability for code reuse both on-chain and off-chain, are key attributes that could significantly ease DApp development, maintenance, and scalability.

Solution

Introduction to Scala

Scala is a high-level, general-purpose programming language that seamlessly integrates functional and object-oriented paradigms. It runs on the Java Virtual Machine (JVM), which makes it highly compatible with a wide array of platforms. Its versatility and expressiveness make it a good fit for a broad range of tasks, from writing small scripts to building large systems. Its interoperability with Java and its compatibility with existing Java libraries make Scala an attractive option for developers.

Integration of Scala in the Cardano Ecosystem

Scalus aims to bring the power, flexibility, and familiarity of the Scala language to the Cardano ecosystem. By introducing a development framework based on Scala, the objective is to overcome the barriers of DApp development on Cardano and open the door to a wider range of developers. This approach will not replace Plutus; instead, it will provide an alternative for developers more comfortable with Scala or JVM languages.

Design Principles and Functionality

Scalus will be designed to meet the needs of developers and to harmonize the on-chain and off-chain code bases. Developers will write both the on-chain and off-chain parts of their DApps in Scala. The code will then be compiled to Plutus for the on-chain parts and to JVM byte code for the off-chain parts. This provides developers with a unified development environment and enables code reuse, which enhances efficiency and consistency.

Development Tools and Libraries

To support developers, Scalus will provide a set of development tools and libraries tailored to DApp development. These will include a well-supported IDE, debugging tools, and libraries designed to ease common tasks in DApp development. Moreover, the solution will leverage the vast array of existing Java libraries, thanks to the JVM compatibility, to further enrich the development environment.

Cross-Platform Compatibility

Due to its JVM foundation, Scala provides high compatibility across various platforms. Developers can easily deploy their DApps to JVM, JavaScript, TypeScript, and potentially LLVM/WebAsm, Android, and iOS platforms. This wide-reaching compatibility promotes the development of DApps for multiple platforms, thus broadening their accessibility and utility.

Community Support and Growth

With Scala’s substantial existing developer community, this solution aims to bring together an extensive base of developer talent. By providing resources such as comprehensive documentation, tutorials, sample code, and community support forums, the Scala solution aims to encourage the growth and diversification of DApps on the Cardano blockchain.

Future Directions

Scalus will continue to evolve in line with the needs of the developer community and the changing landscape of blockchain technology. Future developments could include deeper integrations with other popular JVM languages, improved tooling, and more advanced libraries to ease the development of increasingly complex DApps.

In essence, Scala provides a highly promising route to accelerate and simplify DApp development on the Cardano blockchain, ensuring greater accessibility and versatility, and paving the way for a rich and diverse array of decentralized applications.

Impact on Cardano Ecosystem

Developer Accessibility: As Scala is a popular programming language with a large developer community, Scalus can facilitate the transition for these developers into the Cardano ecosystem, effectively opening up a larger talent pool for DApp development.

Efficiency: Scalus allows code to be written once and used across different platforms such as JVM, JavaScript, TypeScript, potentially LLVM/WebAsm, Android, and iOS, thereby improving the efficiency of DApp development and allowing for easy integration with other codes in Java, Kotlin, JavaScript, TypeScript, or even Rust, if needed.

Integration with Existing Ecosystems: Scalus can simplify the adoption of Cardano DApps by companies that have already heavily invested in the Scala and Java ecosystems. This could lead to an increased utilization of Cardano for decentralized applications, particularly within the financial sector.

Improvement of Developer Experience: With features like working debugger, good IDE support, and faster ‘change-compile-test’ turnaround, Scalus can greatly enhance the developer experience, which could in turn attract more developers to the Cardano ecosystem.

Long-term Growth and Sustainability: By providing tools that make DApp development simpler, faster, and less expensive, Scalus could contribute to the long-term growth and sustainability of the Cardano ecosystem.

The applicant and the team — Can they deliver?

Alexander Nemish, the main applicant, brings to the table a rare and valuable combination of technical skill and practical experience. His background as a compiler engineer at IOHK, where he worked on the Marlowe DSL, and his decade-long experience as a senior Scala engineer with major financial companies like UBS and Deutsche Bank make him an ideal candidate for this project. Furthermore, he has already shown tangible progress with Scalus, having developed its 0.2 version, which has successfully compiled and run complex contracts on Testnet and Mainnet. His extensive experience in using and developing for Scala, coupled with his understanding of blockchain technologies and familiarity with the Cardano ecosystem, puts him in a unique position to address the challenges of this project. His commitment to open source values is also an added advantage, ensuring that the outcomes of the project will be accessible to the wider Cardano community. His solid plans for testing and continuous integration further solidify his ability to deliver a high-quality, reliable product. Overall, Alexander’s deep expertise, demonstrated commitment, and clear vision make him an excellent fit for developing Scalus, a tool that holds great promise for expanding the capabilities of the Cardano ecosystem.

Further Questions/Interview

I connected with Alexander and here is what he had to say.

[GENERAL] Is there a backup plan in case the main applicant can’t continue the project for unforeseen reasons?

The project is already fully open sourced and will be developed fully open sourced in a continuous manner. Even though there is no explicit backup plan, anyone in the community can fork the repo at any time and continue if needed.

[GENERAL] What measures will you implement to ensure the security of the DApps developed through Scalus, Audit etc..?

There are 4 points here:

1. Any contract requires 100% test coverage. Scalus will provide a property-based testing library primitives to facilitate rigorous testing of DApps, leveraging existing ScalaCheck library.

2. Scalus aimes to implement a set of Plutus compatibility tests to ensure its CEK machine behaves the same as in Plutus.

3. Scalus code already has a decent test coverage and will be fully test-covered during the development.

3. I plan to create a Scalus Audit Proposal in the next Catalyst round.

[IMPACT] How do you plan to encourage developers to adopt Scalus for their DApps creation?

I plan to write a series of posts on Twitter, Reddit, and Medium. Also I’ll attend various Twitter Spaces and podcasts.

I’m talking to Cardano Foundation and IOG guys about Scalus, so they are aware as well.

[IMPACT] What are the specific aspects of Scalus that will make it attractive to developers already familiar with other development tools?

Of course. Scalus aimes to do what Plutus failed to do — write code once and run it everywhere. Scalus leverated Scala ability to be run on JVM (fast backend), JavaScript Node.js and browser environments, and on-chain! Isn’t that a dream come true? Also, Scalus leverates Scala’s tooling. No need to develop a new language parser, typer, syntax highlighter, IDE support, rename/refactoring tools, language server, build tool, package manager, code distribution, dependency manager, to name a few.

Also, Scalus will leverage a Scala CLI tool to simplify Scalus development. Developers will have a super simple way to start a Scalus project.

[IMPACT] Are there potential risks or challenges you foresee that could hinder the success of the project?

The biggest risk is if I am not funded ) I started the project without funding from Fund 9, though.

[CAPABILITY/FEASIBILITY] Can you provide examples of past projects you have successfully completed that demonstrate your capability to deliver Scalus?

1. Marlowe (https://marlowe.iohk.io/), I was one the core developers, and I wrote 99% of the Marlowe on-chain code.

2. The actual Scalus. It already works (https://github.com/nau/scalus) and needs funding to be completed rather than being developed from scratch.

3. I also wrote JScala — Scala to JavaScript converter macros. Also I wrote a couple of other compilers: Lasca and DepC (dependent types typechecker)

[RESOURCES & VALUE FOR MONEY] Is there any potential for additional costs that aren’t included in the initial budget?

I plan to have another round of Catalyst funding in the future, for the audit, other improvements and enhancements. So yes, there are additional costs, but it’s for another funding round.

[RESOURCES & VALUE FOR MONEY] Could you provide a contingency plan if the actual project cost exceeds the estimated budget?

I have put a contingency budget of 10% in the budget. It’s not the recommended 2X, but it’s something 🙂

[RESOURCES & VALUE FOR MONEY] How will the project ensure transparency and accountability for the use of funds?

I’m the sole developer, the project is fully open sourced. Catalyst funding impies having regular meetings with demonstrations of achieved milestones to get further payments.

Hence, I’m the only one accountable, and everything is transparent and visible on GitHub.

[GENERAL] Do you have any plans for the long-term maintenance and updates of Scalus post project completion?

Yes, as I mentioned above I plan to have an audit, enhancements and maintenance in the future.

[GENERAL] What potential opportunities for Scalus do you foresee in the future evolution of blockchain and DApps?

I see Scalus as a default choice for DApp development on Cardano. It’s the only platform that has it all: on-chain and off-chain code sharing, same language for frontend and backend, easy integration with JVM ecosystem and JavaScript/TypeScript ecosystem, powerful and mature host language Scala, rich development tools, large and experienced developers community, excellent frameworks, even ability to compile to LLVM/WASM, potentially even iOS and Android. There is no close second.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts