Please describe your proposed solution.
The Cardano Node only exposes its client (Node to Client) data over a local UNIX socket as a measure of security. However, this can make the data difficult to access and consume, especially from remote clients. This data is necessary for tasks such as building transactions or monitoring traffic in the node’s mempool.
The gOuroboros library provides the building blocks for communicating with a Cardano Node as a client in Golang. Our previously funded proposal from Catalyst Fund 9 led to the development of the client side of the protocol.
This proposal intends to leverage this prior work and to build upon it to create a query layer for interfacing with a Cardano node and expose these Ouroboros Node to Client (NtC) queries over multiple HTTP-based protocols. This will allow for consumption in client applications using methods of the developer’s choosing and provide capabilities for varying security scenarios.
Node protocols (Ouroboros NtC):
- LocalTxSubmission
- LocalTxMonitor
- LocalStateQuery
API protocols:
- REST
- WebSockets
- gRPC
This includes the creation of a Go SDK for the UTxORPC project to provide the gRPC functionality.
How does your proposed solution address the challenge and what benefits will this bring to the Cardano ecosystem?
Golang is an extremely popular programming language. GitHub Language Statistics from GitHut 2.0 (code: <https://github.com/madnight/githut>) show that in Q1 2023, the number of pull requests on Golang repositories grew 10.423% and Haskell repositories grew only 0.201% (source: https://madnight.github.io/githut/#/pull_requests/2023/1/Go,Haskell) while the number of repository stars on Golang repositories grew 12.107% and Haskell repositories grew only 0.238% (source: <https://madnight.github.io/githut/#/stars/2023/1/Go,Haskell>). The Golang developer community is over 4x the size of the Haskell developer community, based on the number of Github repos with code for each. Since it’s hard to judge community size, we’re using these numbers as a proxy. We hope to bridge the gap between Golang developers and the Cardano blockchain and attract more developers to Cardano.
Implementing a multi-protocol HTTP-based API will leverage the breadth of existing web technologies for scaling, building, maintaining, and securing HTTP data flows. Creating an API service in Golang allows us to leverage not only our prior work but also the existing code and libraries in the Golang ecosystem. This reduces the time to completion for this project, allows for engaging a larger developer pool for the project, and lowers the barrier for entry into the Cardano ecosystem.
Utilizing UTxORPC for the gRPC interface will ensure interoperability with other Cardano ecosystem projects, such as TxPipe’s Dolos, increasing diversity in the ecosystem while preventing fragmentation due to various implementations.
How do you intend to measure the success of your project?
As our goal is feature completion and open source code, our measure for success will be when the cardano-node-api application supports the desired client queries and can serve them over the desired protocols.
This will be measured by the completion of tasks and milestones within our project board for this project.
Please describe your plans to share the outputs and results of your project?
The cardano-node-api application is open source and developed in public. Each individual piece of work is submitted publicly to the cardano-node-api repository and can be viewed by anyone.
Progress is tracked through GitHub Issues and a GitHub Projects Kanban board (<https://github.com/orgs/blinklabs-io/projects/9>). Our engineering team has weekly meetings on status updates. Discord is used for day to day communication and engaging contributors.
This project is a stepping stone to further work in providing data services using implementations other than the Haskell reference implementation.