funded
Hlabs: Mutexo - an UTxO coordination layer
Current Project Status
In Progress
Amount
Received
₳24,000
Amount
Requested
₳200,000
Percentage
Received
12.00%
Solution

A centralized server and client implementation, that connects to a cardano-node and keeps track of utxos that are “about to be spent” (via a virtual mutex on a utxo: mutexo)

Problem

Utxo contention. The thing that doesn’t allow Cardano devs to build parallel applications.

Impact Alignment
Feasibility
Value for Money

Team

1 member

Hlabs: Mutexo - an UTxO coordination layer

Please describe your proposed solution

UTxO contention is that thing that happens when 2 or more transactions want to use the same UTxO as input.

This scenario is particularly relevant when designing parallel dApps, where the contract has many utxos, and the user may choose any of them for their purpose.

two clients that are not aware of each other may end up choosing the same UTxO, and hence, only one will have their transaction accepted.

The solution proposed is to allow the clients to be aware of what is going on on the dApp in order to coordinate the utxos to use.

This can be done via a centralized server (most probably a dApp has one somewhere, even just to query data for the blockchain) and websockets.

The centralized server would keep track of a subset of the ledger state (only the utxos of the contract as an example) and send events to the clients that are looking to use those utxos.

When a client is building a transaction it will request to "lock" some utxos to the server, and if the utxo is not already locked, the server sends an "OK" response and emits an event for other clients, otherwise it just sends an "Error" response to the client that requested in the first place, so that an other utxo can be tried.

This solution does not prevent the utxos to be spent by someone that is not connected to the server, but it will handle most of the realistic scenarios.

Please define the positive impact your project will have on the wider Cardano community

The development of parallel dApps will allow developers to truly leverage the power of the eUTxO model, increasing the throughput and efficiency of the protocols developed on Cardano.

This will likely translate into a smother user experience, on top of improved performance of dApps.

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 beginning 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 specification.

And more recently actively developing an alternative implementation of the cardano-node, thanks to previous catalyst funding.

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

Milestone 1: Public repository setup,

Initial implementation based on the ouroboros mini-protocols;

comunications with the cardano-node, following the tip of the chain and mempool.

Milestone 2: server implementation

keep a copy of a subset of ledger state in the server memory;

Update utxos based on the cardano-node events

client interface implementation (requests to lock utxos and responses)

Milestone 3: client implementation

request infos on specific utxos.

request permission to "lock" utxos and handle possible responses.

receive updates on utxo being locked or spent.

Milestone 4: demo and documentation on how to use the tool.

Final Milestone: close out report and video.

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

1) Michele Nuzzi

Additionally, Hlabs is looking to expand the team to better handle the various ongoing projects.

New personnel working on this proposal in case of approval would meet the following requirements:

Senior Typescript developer, 5 years experience, deep understanding of computer science fundamentals and with solid understanding of the different Javascript runtimes and relative main APIs

Please provide a cost breakdown of the proposed work and resources

Assuming 2 engineers working on the first usable prototype in the first 4 months and improving from there for the remaining 4 months for a production-ready component to use, for a wage of 5750 $/month

at the current rate of exchange of about 0.46 USD per 1 ADA

we have

2 x 5750 x 8 / 0.46 = 200000 ADA.

No dependencies (on external organizations). exsisting modules, still developed and maintained by HLabs, will be reused.

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

The UTxO contention is scaring developers by building parallel decentralized applications, truly leveraging the powerful eUTxO model.

an offchain coordination layer would represent a concrete solution for those developers, who would then start thinking more about how to parallelize the design of their contracts.

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