not approved
rewrite it in Zig - ouroboros mini protocols
Current Project Status
Unfunded
Amount
Received
₳0
Amount
Requested
₳142,132
Percentage
Received
0.00%
Solution

We propose the realization of such tools in the modern language of Zig (interoperable with C/C++ codebases), which will serve as a base for performance-focused applications.

Problem

Onboarding new developers is easier when they have tools they can use in their favorite language.

Feasibility
Value for money
Impact / Alignment

Team

2 members

rewrite it in Zig - ouroboros mini protocols

Please describe your proposed solution.

The ouroboros-network stack is the component that allows some program to directly communicate with any cardano-node implementation, either locally (on the same machine) or over the network (node-to-node communications).

A Zig implementation would allow for one of the most efficient implementations of the node communications, which can then be used to build (or improve) new (or existing) extremely efficient tools; such as indexers, cli interfaces, databases, etc…

the intent of the project is to be the base tool on top of which new incredible tools will be built.

Why Zig?

The choice of Zig as a language is mostly due to the incredible performances it can achieve (often comparable to C) with a strong focus on memory safety and best practices (errors as values, no hidden control flow, etc.);

Despite being a relatively young language (Zig development started in 2017) the characteristics of the language are allowing it to easily be adopted by the industry with lots of exciting projects, including the blazingly fast javascript runtme "Bun" with over 42k stars on GitHub.

TL;DR: adopting Zig means making sure that Cardano stays at the forefront of industry standards.

How does your proposed solution address the challenge and what benefits will this bring to the Cardano ecosystem?

In the challange description, one of the "possible directions" specified is;

> Developing common tools, frameworks, core infrastructures, or proof of concepts

which matches the idea of the proposal to create a tool that can work as a base for any other project who intends to use the library.

How do you intend to measure the success of your project?

The final goal is to have an open-source library to be reused across the ecosystem.

As an open-source project, the most direct way would be the number of stars the project will receive on GitHub; indicative of the people interested in it.

As a library, the number of dependents projects (directly or indirectly) will be an incredibly useful metric.

Please describe your plans to share the outputs and results of your project?

So far Twitter has been mainly used to communicate the progress of the various projects.

Mainly the (personal) MicheleHarmonic account will be alongside the HarmonicLabs account where appropriate.

Twitter has proven itself a useful tool to share the progress and it will still be used.

for any unreported progress, the project itself has always been open source, and anyone interested should be able to use GitHub to stay updated; the repository can be found at: ( TODO insert link of repo )

What is your capability to deliver your project with high levels of trust and accountability?

We are already working on the implementation of the Ouroboros mini protocols in Typescript while the implementation has its use cases it is definitely inconvenient to be used in a scope where resources are limited, hence this proposal.

What are the main goals for the project and how will you validate if your approach is feasible?

The approach is very simple; just follow the standard.

The main goal of the project (and also the main deliverable) is a Zig library that allows to talk to any cardano-node implementation.

Please provide a detailed breakdown of your project’s milestones and each of the main tasks or activities to reach the milestone plus the expected timeline for the delivery.

as per specification The Shelley Networking Protocol consists of:

  1. multiplexer
  2. node to node handshake
  3. node to client handshake
  4. chain-sync (blocks for n2c and headers for n2n)
  5. node to node tx submission
  6. node to client local tx submission
  7. keep alive (n2n only)
  8. local state query (n2c only) (with numerous possible queries)

for a total of 8 milestones; each including:

  • implementation (CBOR serialization, CBOR deserialization, data types, utility funcitons)
  • testing (both program logic and protocol logic (against running node))

Please describe the deliverables, outputs and intended outcomes of each milestone.

As mentioned above, the main deliverable is a Zig library that allows to talk to any cardano-node implementation.

Everything will be open source, hence the outputs of the project will include the repository, where eventually everyone will be able to verify the work done.

Please provide a detailed budget breakdown of the proposed work and resources.

The total cost of the project is estimated to be 142,132 ADA;

The amount has been calculated as follows:

The total amount of ADA allocated to the challenge is 3,158,500 ADA.

To operate with a price that is not subject to volatility over time we are assuming that corresponds to an allocation of 1,000,000 $

that would roughly correspond to a price of 1,000,000 / 3,158,500 = 0,316605984 $/ADA

or equivalently 3,158,500 / 1,000,000 = 3,1585 ADA/$

At a cost of 45 $/h (after taxes);

Since the legal entity operates in Italy we'll consider a 22% standard tax due to VAT (see source on agenzia delle entrate)

45 · (100 / (100 - 22)) =

45 · 100 / 78 =

4500 / 78 ~= 57.692 $/h

The estimated timeline for the final product is of 6 months.

assuming 6h of work a day; for 5 days a week, for 26 weeks in a 6 months period, the following should be the total cost for the project (in dollar value):

57.692 · 6 · 5 · 26 = 44999,76 $

At a rate of exchange of 3,1585 ADA/$ it becomes:

44999,76 $ · 3,1585 ADA/$ = 142131,74196 ADA

Who is in the project team and what are their roles?

Michele (main proposer) will be mainly responsible for the implementation.

Michele is also the founder of the Harmonic Laboratories, which has been working (and is still working) on several projects on Cardano.

If necessary, and if possible, the workload will be distributed between the developers at Harmonic Laboratories.

How does the cost of the project represent value for money for the Cardano ecosystem?

The extension of Cardano as an ecosystem to a modern programming language like Zig will allow for greater diversity and inclusivity in the developer community, allowing people with different backgrounds and educations to contribute to the protocol.

Allowing for the emerging Zig language to be part of Cardano will be a great entry point for some of the greatest engineers and brilliant minds looking for innovation.

close

Playlist

  • EP2: epoch_length

    Authored by: Darlington Kofa

    3m 24s
    Darlington Kofa
  • EP1: 'd' parameter

    Authored by: Darlington Kofa

    4m 3s
    Darlington Kofa
  • EP3: key_deposit

    Authored by: Darlington Kofa

    3m 48s
    Darlington Kofa
  • EP4: epoch_no

    Authored by: Darlington Kofa

    2m 16s
    Darlington Kofa
  • EP5: max_block_size

    Authored by: Darlington Kofa

    3m 14s
    Darlington Kofa
  • EP6: pool_deposit

    Authored by: Darlington Kofa

    3m 19s
    Darlington Kofa
  • EP7: max_tx_size

    Authored by: Darlington Kofa

    4m 59s
    Darlington Kofa
0:00
/
~0:00