Haskell, the core programming language of the Cardano blockchain, is a perfect choice for building critical infrastructure in the modern financial system. As a functional programming language, it allows developers to produce reliable, robust, and high assurance code. However, despite serving as a basis for Cardano Plutus and Marlowe smart contracts, Haskell is still not among the most widely used languages in today’s world of software development.
Overview of the Ouroboros Networking library
The Cardan node uses an implementation of Haskell-based mini-protocols to communicate with other nodes on the network. These protocols are low-level networking specs defined by IOHK. If you want to talk to the Cardano node directly without using a Cardano CLI, you can use a mini-protocol networking package. Ouroboros is one such networking library/package that eliminates dependency on the CLI, thus giving you more development flexibility to query Cardano blocks, fetch state, submit transactions to the node, or access on-chain data.
The networking library consists of two components – the mini protocols and a data parser. The mini protocols help communicate with the node and provide CBOR encoded data from the Cardano chain. The data parser will then parse the data and convert it into a JSON object that can be used efficiently by developers.
Bringing a Host of Possibilities to the Cardano Ecosystem
Other than the above capabilities, the library will also allow you to access raw CBOR data for debugging purposes. The aim of building this package is bringing Cardano to the larger developer community so we can see the ecosystem grow day by day.
As it stands, the networking package only implements the features that were required by the Cardanoscan explorer – which was an internal project by the proposing team. With this proposal, the team is looking to build on their existing work and create a more mature, maintainable, and feature-rich networking library. The plan is to port out existing work and enhance it to include the following:
- Chain-Sync protocol (limited implementation of the protocol is available)
- Transaction Submit protocol
- Block fetch protocol
- Local State Query protocol
- Ping-Pong protocol
- Data Parser based on CDDL specifications
- MUX implementation (to provide support for talking multiple mini-protocols concurrently)
- Test suite and examples
The implementation of this open-source networking library will follow all specifications defined by IOHK to ensure it maintains the integrity of the Cardano protocol. Additionally, the team will also perform block hash validation as part of the test suites. From a development perspective, building the library’s features will take a functional approach but there will be easy-to-consume methods such as an API for end-users (developers).
Project Budget and Timelines
The project will focus on building on the already available implementation of the protocol which has limited features. As mentioned, the package is still not advanced, so Ashish and the team will have to build a high-performance Nodejs package with all the deliverables listed above. A lot of manual testing and working with on-chain data will be required to ensure the package works efficiently and adheres to the protocol specifications defined by IOHK.
According to the minds behind this project, it would take them three to four months to deliver the networking library – with two developers working on the project on a full-time basis. The team is therefore requesting a total funding of $ 80,000 to make the Ouroboros networking library project a reality. From this amount, $77,000 will be used as salary for two full-time developers over the development period. The team will also spend $ 2000 on cloud VM costs (testnet relay node, mainnet relay node, and testing/dev node). The remaining $ 1000 will cover other infrastructure and miscellaneous costs.