over budget
elm-cardano: Elm offchain framework for Cardano
Current Project Status
Unfunded
Amount
Received
₳0
Amount
Requested
₳46,250
Percentage
Received
0.00%
Solution

Build the friendliest and most productive Cardano frontend in Elm. It should be a perfect match to Aiken onchain code.

Problem

Current JS Cardano frontends are error-prone, not dev-friendly and not synergistic with Cardano’s functional style (Aiken, Haskell).

Impact Alignment
Feasibility
Value for money

Team

1 member

elm-cardano: Elm offchain framework for Cardano

Please describe your proposed solution.

At its core, Cardano is built on the principles of pure functional programming with concepts such as immutable data structures (UTxO) or deterministic computation without side effects (uplc VM). Just like for the blockchain space, these properties bring many advantages to programming languages leveraging them, such as Haskell.

In the frontend world, JavaScript is the main contender. However, I argue that this is a less-than ideal choice for Cardano dapps frontend for multiple reasons. JS is error-prone due to global mutability, omnipresent side effects, complex ecosystem and build tools. In addition, Cardano JS libraries have many issues too. Lucid is basically unmaintained, CSL & CML have a webassembly core with very unfriendly error messages (same for libraries building on these), cardano-js-sdk has no onboarding and guiding documentation.

Meanwhile, Elm is the simplest and friendliest pure functional language of the ML family (like Haskell). It is purpose-built for frontend web development. It has such good error messages that they explicitly served as inspiration for many other languages, such as Rust. Its foundation is well build and inspired major JS frontend frameworks such as redux. Basically, I think it is a perfect match for Cardano, especially when paired with Aiken or Haskell.

I have started working on the elm-cardano framework, and intends to cover the following:

  • Simple building, submission and watching of transactions
  • Simple interaction with Cardano wallets (CIP30, CIP45)
  • Simple interaction with Cardano infrastructure (ogmios, blockfrost, …)
  • Elm-cardano examples for the Aiken tutorials
  • Thorough guide and complete example project covering many aspects of a Cardano dapp
  • (if there is time) Time-travel simulator for end-to-end testing and interactive replay of contracts

The project is entirely open-source, coordinated in the #elm channel of txpipe discord, and has already attracted 4 independent contributors on subjects ranging from CBOR codecs to coin selection algorithms. Two of these contributors are KtorZ and rvcas from the Aiken team.

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

This project aims to be the friendliest and most productive way of handling an offchain Cardano frontend. It will therefore have an impact on all Cardano builders choosing it for their frontends. I'm convinced it will also mean much more robust Cardano dapps in general so will benefit to the whole Cardano community.

Impact may be measured quantitatively by the number of contributors to the repository and the number of projects deciding to use it.

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?

The work has already began and the repository is fully open-source. I have a deep knowledge of the Elm language, having used it for a long time. I generally build high quality tooling, such as elm-test-rs, a test runner for the elm language, or pubgrub-rs, a dependency solver in the Rust language. Finally, I have a passion for programming education and teaching subjects that interest me, so I think I'm well suited for making tools with care for developer growth. The main challenge will be building the low-level interop with Cardano constructs, such as CBOR encoding/decoding of various data structures. I already started and am confident in my ability to figure it out, with the help of other devs in the Cardano ecosystem, especially the friendly folks in TXPIPE discord. Members of the Aiken team (KtorZ, rvcas) are also very interested in this project so I expect it to be successful.

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

  • Being able to encode/decode any post-byron transaction

The proof of the milestone will consist of building a connection with Ogmios, and rolling forward the whole chain, while decoding all transactions that were ever submitted.

>- Providing reliable CIP30 wallet interactions

  • Explore CIP45 p2p wallets

Evaluation will be provided with an example dapp capable of handling all cip30-compatible wallets

>- Building examples for the Aiken tutorial

>- Building a complete and complex example project with a guide from A to Z.

>(if there is time) building a simulator for end-to-end validator testing and interactive transactions replay

Please provide a cost breakdown of the proposed work and resources.

I estimate approximately 2 months of work for the first milestone, then roughly 1 month for the following ones, considering 20h of work per week. With an estimate of 3K€ per month, this amounts to 18K€ for the 6 months period.

I estimate an additional 500€ for different cardano-related services for integration tests, like Demeter and other similar infrastructure services.

At an estimated price of 0.40€ per Ada, this amounts to 46250 Ada.

Light marketing will naturally happen through active communication with other Cardano builders on TXPIPE discord and other platforms such as Twitter. I expect the open source nature of the project to actively attract interest of the Cardano Dev community, leading to more awareness from the Cardano builders.

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

My estimate of 3K€/month for a half-time job correlates to experienced developer wages in my country (France). Blockchain positions would typically be much more expensive, so I consider this budget to be very competitive and excellent value for money.

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