Last updated a year ago
Cardano has tools only in Haskell, developers are constrained due to the lack of a networking library in other languages such as Javascript
Create Ouroboros Networking package in Javascript, which allows talking to Cardano node by easily installing the NPM package
This is the total amount allocated to Ouroboros Networking Lib in JS.
## What is Ouroboros Networking library
Cardano has a family of networking protocols called mini-protocols. The cardano-node itself uses a Haskell implementation of mini-protocols to communicate with other cardano-nodes on the network. The protocols are low-level networking spec defined by IOHK, much like TCP.
One can use a mini-protocol networking package and talk to cardano-node to query blocks, tip, state, and submit transactions to cardano-node directly. (WITHOUT using cardano-cli, removing the dependency on CLI, can result in more flexibility in development)
There are 2 main components to build this library,
1. Mini-protocols
2. Data Parser (Block, Transaction, State, Metadata, and every piece of data on-chain)
While mini-protocol can help communicate with the node, it provides the CBOR encoded data from the chain, it is required to parse the data and convert it to JSON object to be used efficiently by the developers.
## Why in JS (Nodejs)
Javascript is a widely-used programming language, and Nodejs is the most favorite development platform among the developer. Having this package in Javascript will strongly boost a new family of projects and tools around Cardano.
## What can I do with the JS-based Ouroboros networking library
One can build projects of any scale using a networking package. The best example is our own project, Cardanoscan explorer, now the leading explorer for Cardano. A developer can install the package from npm and start building, with 0 to the minimal configuration required.
Everything below as efficiently as possible
- Wallet Backend
- Bots (Twitter, telegram, etc)
- Analytics Dashboards
- Metadata explorers
- Pool explorers
- Multi-Asset Dashboards
- Track pool updates
- Imagine anything to be done with chain data - is possible
Apart from the above, one can also access raw CBOR data from the chain for debugging purposes.
## Why do we want to build this JS package?
While this networking library is one of the core components of the Cardanoscan explorer, we are here for Cardano. Porting out a lot of our research and work that has been into the package is something that the community will benefit large and we love seeing this ecosystem grow day by day.
## Deliverables
Cardanoscan has only a subset of the networking package implemented only the features that were required by the explorer also our work was an internal implementation, it is not very well commented. With this proposal, we will port out our existing work and create a more mature, maintainable, and with most features of the mini-protocols.
- Chain-Sync protocol (we have limited implementation of this protocol already)
- Transaction Submit protocol
- Block fetch protocol
- Local State Query protocol
- Ping-Pong protocol
* Data Parser based on the specification defined using CDDL spec.
* MUX implementation, to support talking multiple mini-protocols at once using this library.
* Test suite
* Examples
The implementation will be done based on the specs defined by IOHK and will maintain the integrity of the chain by doing block hash validation as part of the test suites. The library will follow a functional approach to build the features, and the developers will have easy-to-use methods for using this package.
## Budget & Timeline
We have an implementation of the protocol but is limited and is not very advanced for this open-source package. We have to write a high performant Nodejs package using the protocol specifications defined by IOHK with all the features as detailed in the Deliverables section above. This implementation involves a lot of manual testing, working with chain-data, CBOR, streams, hashing, and many complex pieces.
We estimate to deliver the specified deliverables in about 3-4 months with a plan to dedicate 2 people to the project.
The cost for the implementation to be as per below
- developer salary (2 People) - 77,000 USD
- cloud VM cost (Testnet Relay node, Mainnet Relay node, testing/dev node) - 2000 USD
- other infrastructure/miscellaneous costs - 1000 USD
NB: Monthly reporting was deprecated from January 2024 and replaced fully by the Milestones Program framework. Learn more here
We have developed a part of the networking layer as part of our implementation with the Cardanoscan custom backend system