funded
Cardano Lightning Network (Phase 1) - Payment Gateways
Current Project Status
In Progress
Amount
Received
₳11,664
Amount
Requested
₳97,200
Percentage
Received
12.00%
Solution

We will build Cardano Lightning Network step-by-step, guided by real use cases. The Phase 1 features protocol specs for a base layer to prototype a Payment Gateways connecting customers and merchants.

Problem

Cardano lacks a lightweight L2 payment solution which has fast settlement and finality, is easy to integrate, has incentive mechanism with adjustable fees and composes well so it can grow organically.

Value for Money
Impact Alignment
Feasibility

Team

3 members

Cardano Lightning Network (Phase 1) - Payment Gateways

Please describe your proposed solution

Like it says in the name, this is Cardano's answer to Bitcoin's Lightning Network.

It's an L2 optimised to be scalable and instant.

Scope Overview

Good protocols are critical but only a part of the adoption story. Without users, protocols die.

That is why we will start with clear specs, design and basic proof of concept implementation in this proposal and next in the "Product" proposal we will build the production software, SDKs and integration tools around it to further facilitate adoption.

Lightning Network in Two Steps

The Cardano Lightning Network is not simply a protocol; it is an end-to-end solution.

It will be delivered in two phases. Both are attractive from a business perspective in their own right.

Phase 1 - Payment Gateways

This will deliver the specs, smart contracts, and its implementation as a hub and spoke network with related SDKs. This phase consists of two proposals (this one and the next "Product" one).

Phase 2 - Routing & Discoverability

It will extend the hub and spoke network to be fully decentralised with optimal channel routing.

This will deliver the SDKs and full software suite. The SDKs will enable third parties to integrate and build on top of CLN.

So we will have two phases with two proposal each ("Concept" and "Product").

Phase 1 - Payment Gateways

This phase lays the foundations of the full CLN, but will also result in a network addressing a real world use case.

We will create a solution for merchants and customers to connect via "Payment Gateways".

This will allow them to transact instantly and securely through the CLN.

A single purchase in this scenario is a composition of two channels: one from customer to the gateway and the second from the gateway to the merchant. The Payment Gateway is to connect to all participating merchants and consumers. It handles all routing and the liquidity between channels.

Users have all the guarantees of the L1 via the secure payment flow with low fees and instant finalisation. The full implementation (Product proposal) will provide a basis for integration with mobile devices where payment applications will be disconnected from the wallets.

(Note that once the channel is charged by the wallet the app can operate independently).

The critical technical goal en route to full CLN is to demonstrate channel hopping between bidirectional channels.

Digital Cheques or How Lightning Really Works

Bitcoin Lightening provides us great inspiration, but Cardano has some significant benefits that we can leverage. Namely, the clean UTxO model and powerful scripting capabilities. As a result CLN is a simpler protocol involving the exchange of tiny messages - we call them cheques.

These are easily encoded/decoded by everyones' favourite languages, by mobile, web, wallets, backend, cloud, embedded, you get the idea. Portability - it can be sometimes surprising how this detail can delay adoption!

Cheques are signed intentions to make a transfer. At any time, a user can decide they want to cash the cheque on the L1. Just like an old school paper cheque - just in crypto. For a given channel, cheques are in a sense cumulative, only the latest one matters. But while the receiver holds a check, they are guaranteed what they're owed by the L1.

What is also really interesting it is pretty easy to make them bidirectional (we are leaving this as an exercise to the reader :-P).

"Why not hydra?" we hear some of you ask.

Any secure, decentralised, system rubs up against the blockchain trilemma.

A blockchain's design choices are trade-offs between security, scalability, and decentralisation. There is not a one size fits all solution.

Cardano Lightening Network focuses on secure instant settlement, but also scalability.

And not just in TPS, but in the number of independent participants.

What is Cardano Lightening Network not? It’s not "isomorphic".

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

We don’t use “Lightning Network” in the title of this proposal because it is catchy. We use it because we really will deliver efficient and scalable L2 for payments inspired by the original protocol.

Cardano shares bitcoin’s laggy finality issue - the key issue that Lightning addresses. The popularity of Bitcoin Lightning is demonstrable of how an L2, with deliberate design choices, meets a real world use case.

This project will be well founded on cryptographic best practice, but it is not a research project. We will deliver Cardano ergonomic tools to utilise and infrastructure to allow for cheap, instant transacting en masse.

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?

This proposal could is categorized as "Concept" but it will also deliver POC implementation. At the same time we are building other prototypes related to micropayments in other projects:

  • Dominic Algernon Wallis already prototyped in Aiken subbit.xyz which is related to this design phase but an independent micropayments proposal.
  • Tomasz Rybarczyk and Nicolas Henin are core maintainers of Marlowe. We have designed a micropayments capability and the implementation is in the Marlowe Roadmap (see Marlowe 2025 Proposal / Milestone 2 : Micropayments).

We have already fleshed out most of the protocol level design on paper and have many years of experience in smart contracts on Cardano (both PlutusTx and Aiken).

We want to drive the development in an open manner and allow people to join this Open Source team as we move forward.

Development process will be public and open-source

Both the output and the development process will be public and open-source. This approach provides an easy way for the Catalyst team and the Cardano community to evaluate the progress at each step of the process.

We will form a working group around the idea and facilitate the discussion so everything will be transparent and easy to track on our pages: https://github.com/cardano-lightning-network and https://cardano-lightning-network.org

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

Milestone 1: Protocol Specification

Rationale:

  • Even though we have a pretty clear picture of how to efficiently translate and enhance ideas from Bitcoin Lightning we want to dedicate a moment to do an extra pass over the Bitcoin spec and possibly explore and report other solutions as well.
  • During that process we should transfer these ideas to diagrams and docs which we can turn into the final spec.

Outputs:

  • Full spec of the protocol for payment channels and composition of them with clear explanation and reasoning (some proofs on the paper) behind it. This will include the API of the smart contract.
  • Architectural Decision Records which will sum up the discussions and conclusions.

Acceptance Criteria:

  • All the requirements for implementation of this product phase are delivered.

Evidence of Milestone Completion:

Milestone 2: Smart Contract(s)

Rationale:

  • Smart contract is the critical piece of the system.

Outputs:

  • Well documented smart contract(s) implementation.
  • Test suite and benchmark for execution and cash outs batching.

Acceptance Criteria:

  • Smart contracts implements the protocol spec.

Evidence of Milestone Completion:

  • Script passes the test suite for all possible steps of the contract lifecycle (cash outs with variations, recharging, optimistic closure, contestation).
  • Implementation available on project github: https://github.com/cardano-lightning-network.

Milestone 3: Detailed System Architecture

Rationale:

  • Protocol and smart contract won’t live in the vacuum. We aim to provide detailed architecture of the system components outlining the APIs involved, transactions builders, indexer requirements and SDKs.

Outputs:

  • Full breakdown of core software components and their APIs. Some of them we want to quickly prototype in the next milestone but most of them will be implemented in the next “Product” phase.
  • Architectural Decision Records which will sum up the discussions and conclusions.

Acceptance criteria:

  • Designed components cover the whole protocol requirements for an off-chain application including mobile and web clients.

Evidence of Milestone Completion:

  • All specs including “System Architecture Overview” available on our project website: <https://cardano-lightning-network.org>
  • All the discussions can be tracked on our github project page: https://github.com/cardano-lightning-network

Milestone 4: POC implementation

Rationale:

  • Even though the script implementation would cover the feasibility of execution on-chain because it will include execution budget benchmarking it seems natural that we want to provide a POC which proves that we can build all the transactions and execute the protocol on-chain. We won’t plan to cover indexers here but rather stick to simple in memory or in file UTxO caching and pretty rudimentary transaction build up (no batching etc.).

Outputs:

  • POC of concept implementation of a CLI tool(s) which allow to deploy and interact with payment channel(s).

Acceptance criteria:

  • Implementation covers all the protocol operations over the payment channel (opening, cash out, recharging, closure) together with key composition primitives related to HTL unlocking.

Evidence of Milestone Completion:

Final Milestone: Project Close-out Report and Video

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

We are a team of highly experienced developers. We formed our team to solve a particular problem on Cardano during the last Cardano Buidler Fest:

Tomasz Rybarczyk

  • Professional experience:
  • Nearly 20 years of coding and software design.
  • Tons of open source.
  • Cardano experience:
  • 2.5 years
  • Member of Marlowe Team
  • Profiles:
  • Github Profile
  • LinkedIn Profile

Dominic Algernon Wallis

  • Professional experience:
  • Phd in geometric topology. Former Data scientist/ ML eng.
  • 10 years in software development.
  • Cardano experience:
  • 2.5 years
  • Runs artisan dapp dev house, Kompact.io.
  • Profiles:
  • Github Profile
  • LinkedIn Profile

Nicolas Henin

  • Professional experience:
  • 15 years in software development.
  • North American Start-ups operating in Health/Wearable, Ad and Fin Tech industry.
  • Cardano experience:
  • More than 3 years
  • Delivered on Cardano Mainnet: ICO Mechanism, an audited Smart Contract for World Mobile
  • Member of Marlowe Team
  • Profiles:
  • Github Profile
  • LinkedIn Profile
  • Core Maintainer of Marlowe

Please provide a cost breakdown of the proposed work and resources

27 weeks, 3 developers, $80/hour, 2.5 ADA/$, 6h/week

TOTAL : 97200 ADA

HOURS: 486

Overlapping workflows are scheduled to run as follows

Milestone 1:

> Weeks [1, 4]

> Hours 72

Milestone 2:

> Weeks [5, 12]

> Hours 84

Milestone 3:

> Weeks [5, 18]

> Hours 144

Milestone 4:

> Weeks [13, 27]

> Hours 186

No

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

We picked this project because we like Cardano and like the problem at hand. We are focused, experienced and motivated to solve it and deliver lightweight and scalable L2 for Cardano. No BS.

We believe that it is good value for money combination.

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