Strengthening Cardano’s Infrastructure With Rust

Cardano is a third-generation blockchain that promises high transaction throughput and fee determinism. While these aspects are often taken for granted by proponents, they are the result of serious R&D. For instance, Charles Hoskinson’s oft-cited 2017 whiteboard video highlights the computer science principles underpinning the protocol:

Hoskinson described the state of development at the time:

“We are modeling a formal verification of Ouroboros, Cardano’s consensus mechanism, using psi-calculus. Psi-calculus is a wonderful formal modeling language that is machine-understandable. Eventually, we’re going to be able to connect to the Haskell code in our GitHub.”

Similar design concepts are interwoven throughout the specification documents for the Cardano ecosystem. To create an ecosystem that tracks these principles closely, developers rely heavily on the Haskell programming language.

Briefly, Haskell is an industrial-grade functional programming language that lends itself to formal verification. This means that specification designs based upon formal proofs and mathematical reasoning can be implemented easily in the language. This in turn ensures that code executes reliably, and unintended side effects, which can lead to undesirable behavior, are largely avoided. Haskell is particularly significant in the implementation of the Cardano node client, infrastructure essential to securely verifying blockchain transactions.

Client Diversity and Rust

Although fundamental to a blockchain’s security, node client applications are susceptible to typical software vulnerabilities. Developers need only consider recent issues with the Ethereum blockchain and its most famous client, Geth, based on the Go programming language. In November 2020 and again in August 2021, bugs in the client software resulted in changes to the consensus mechanism and some degree of unintended hard forking of the network.

Fortunately, a minority of Ethereum nodes run clients implemented in Rust and other programming languages. This diversity is fundamental to a resilient ecosystem. Had only the Geth client been in use, the incidences could have resulted in double-spending attacks and other network disruptions.

Overall, these episodes – and others like them – underline the importance of client diversity in a cryptocurrency ecosystem. Along these lines, adapulse.io previously focused on Cardano’s Rust Project:

In short, Rust supports low-level implementation of software features. This allows for a greater range of application functionality that often requires more complicated programming languages like C++. Rust provides for similar efficiencies as C++ while sidestepping common pitfalls such as manual memory management.

Currently, Rust developers are enjoying skyrocketing demand, and the language is central to other popular cryptocurrency projects such as Polkadot and The Nervos Network. This points to a variety of addressable use cases in the space.

All things considered, Rust development on Cardano seems focused on the Jormungandr node project. Notably, Project Catalyst depends on Jormungandr for its voting application.

The Rust Cardano Networking Crate Proposal

As mentioned, Haskell underpins much of Cardano’s core infrastructure, including its node and associated networking protocol. However, Haskell developers are relatively few in number, and the language’s popularity is on the decline. This unfortunate reality is the source of production bottlenecks and integration issues throughout the ecosystem.

As such, 2nd Layer is looking to build out the existing open-source Rust library, in particular the networking protocol that determines how nodes communicate with one another and other infrastructure. This node networking protocol determines how information — including incorporated transactions — is propagated throughout the distributed network of nodes on Cardano.

2nd Layer describes itself as a company “building weapons in cyber-space to compete with both BigTech and Government, decentralized and distributed on top of Cardano Blockchain…” Sure enough, they hope to fortify the ecosystem by strengthening the development of Rust infrastructure.

In their Fund 6 proposal, 2nd Layer is seeking $14,000 in funding. With this, they will:

  • implement unit tests for formerly implemented protocols
  • implement server-side and client-only protocols
  • update IOG documentation
  • implement full integration testing against the Haskell node

The 2nd Layer Team

Interested voters can checkout 2nd Layer’s GitHub repo to get a sense of the project and the team’s business acumen. The team was previously denied $7,000 from Fund 3 due to being over budget for the voting round. Nevertheless, they have already laid out the initial groundwork for porting the protocol.

Project development will be led by Pavel Šimerda, a programmer passionate about low-level languages such as Rust and C++. According to 2nd Layer’s proposal, Pavel has years of low-level stack development experience, including work with RedHat.

On the other hand, Andrew Westberg is a frequent project contributor who also actively contributes to the Cardano ecosystem. Mark Stopka is a veteran of the blockchain industry. He is mainly interested in proof-of-stake distributed ledgers, governance systems, and zero-knowledge cryptography.

In addition to their Project Catalyst proposal, the team can be supported by delegations to the MUSE stake pool. If you’d like to know more information or have questions/comments regarding the Rust Cardano Networking Crate proposal, check out the link provided: https://cardano.ideascale.com/a/dtd/Rust-Cardano-Networking-Crate/367442-48088

Leave a Reply

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

Related Posts