funded

HLabs: typescript cardano-node / ledger - cardano-ledger-ts and cbor multi ledger support

₳300,000.00 Requested
Ideascale logo View on ideascale
Solution

cardano-ledger-ts is already solving this problem, this proposal covers some more work to integrate past cardano ledgers and future new ones keeping compatibility with other projects (such as plu-ts).

Problem:

The Ledger layer is responsable of the data types and respective encodings of all the data present on the blockchain; with the goal of light nodes in mind we are missing any js-friendly definitions.

Yes Votes:
₳ 203,237,743
No Votes:
Votes Cast:
548

This proposal was approved and funded by the Cardano Community via Project F11: Cardano Use Cases: Solution Catalyst funding round.

[SOLUTION] Please describe your proposed solution.

The final goal of this proposal is to have the necessary ledger module that can be re-used for different, purpose-specific, nodes; and (alongside the network and node prototype proposals) eventually a fully functional alternative implementation of the haskell cardano-node.

The (already exsisting) library DOES NOT depend on any runtime-specific functionality; however we are considering to use the dependecy injection pattern to allow to utilize runtime-specific functionalities for critical parts of the code (such as hash calculation); this would allow for more performant nodes when used properly.

Primary target of the project are both developers and stake pool operator, and through them any possible user that interacts, directly or indirectly with the Cardano protocol.

[IMPACT] Please define the positive impact your project will have on the wider Cardano community.

Client diversity is crucial for the long term security of the protcol.

Every user of Cardano is relying, directly or indirectly, on a cardano-node in order to interact with the blockchain (submitting transactions, querying data, etc…)

So far the only aviable implementation is the Haskell one by IOG, making the node a potential single point of failure, and often accessed via centralized servers (because there is not really an alternative).

This module, alongside the network and consensus ones, will play an important role in the creation of alternative clients and light clients, with the goal of improving the network and end user securtiy.

[CAPABILITY & FEASIBILITY] What is your capability to deliver your project with high levels of trust and accountability? How do you intend to validate if your approach is feasible?

Michele Nuzzi has been part of the Cardano ecosystem at the beginnign as a single stake pool operator and later as developer. In this time he wrote and still maintains numerous dependecy free typescript libraries that require a low level understanding of the Cardano protocol.

A non-exhaustive list list of some of the projects would be:

  • plu-ts: a typescript framework for the creation of Cardano Smart contracts

  • plutus-machine: typescript library for the evaluation of contracts off-chain

  • cardano-ledger-ts: collection of classes and functions for Cardano specific data types and respective serialization and deserialization in CBOR format.

  • ouroboros-miniprotocols-ts: library for low level interactions with the cardano-node based on the ouroboros mini protocols specificaiton.

    [Project Milestones] What are the key milestones you need to achieve in order to complete your project successfully?

Introduce all the missing classes required for a node (Block, BlockInEra, etc..)

>Extend the CBOR dependency functionalities so that CBOR can be parsed without altering the structure.

This step is <u>crucial</u> as there is no specification on the format CBOR encoding/decoding should follow, so the <u>only</u> way to correctly calculate the hash of certain data types is to hash the same exact CBOR received.

The above can be tricky especially in the case the part to hash is nested in a bigger CBOR, therefore requires parsing.

>A complete cardano-ledger implementation in typescript to be reused where necessary.

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

1) Michele Nuzzi

In the event multiple proposals will be approved qualified personale will be hired to guarantee the successful delivery of all of the approved proposals.

The profile required for such postion will be of a Senior Typescript developer with solid understanding of the different Javascript runtimes and relative main APIs (Web Workers, WebSockets, etc. for Browsers and worker_threads, os, fs, etc. for Node as well as other possible runtimes such as Bun.js or Deno)

[BUDGET & COSTS] Please provide a cost breakdown of the proposed work and resources.

At a price of 0.3828 USD per ADA the estimated cost corresponds to roughly 300'940 ADA, so we round down to 300'000 ADA to meet the challenge requirement.

The expected time to completion of the project is of 8 months considering 1 engineer for 8 hours per day for 30 days per month

60 $/h x 8h/d x 30d/mo x 8mo = 115200 $

that converted to ADA is roughly 300'940 ADA (rounded down to meet the challenge requirements)

[VALUE FOR MONEY] How does the cost of the project represent value for money for the Cardano ecosystem?

The software generated by this proposal will likely run as part of the critical infrastructure that powers Cardano as a protocol.

The skills and knowledge required for the realization of this project are highly specialized hence the value for money should be fair.

Comments

Monthly Reports

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