completed

Perun Channels for Cardano

$300,000.00 Received
$300,000.00 Requested
Ideascale logo View on ideascale
Community Review Results (1 reviewers)
Addresses Challenge
Feasibility
Auditability
Solution

We implement Perun Channels for Cardano and thereby enable P2P transactions at unlimited scalability and with cross-chain potential.

Problem:

Cardano does not have a deployed state channel framework, yet. The Hydra protocol is still WIP.

Yes Votes:
₳ 106,961,962
No Votes:
₳ 28,898,827
Votes Cast:
626

This proposal was approved and funded by the Cardano Community via Project F8: Cardano scaling solutions Catalyst funding round.

  • download
  • download
  • download
  • download
  • download
  • download
  • download

[IMPACT]

[Disclaimer: This is a dual proposal to "Erdstall". "Perun" and "Erdstall" are two different scaling solutions developed by the PolyCrypt team. As we have limited resources, we would prioritize one project over the other depending on the interest from the community.]

Perun protocol: The Perun channel protocol is an instance of a state channel protocol that results from a series of renowned research papers (EUROCRYPT, CCS, S&P). The protocol allows a fixed group of participants to open a channel between each other such that the deposited funds can then be transferred within the group with a local consensus at zero cost and nearly zero latency using off-chain transactions. The Perun protocol guarantees the security of the funds at all times. If a dispute arises (for example, one party goes offline) the protocol provides a way for honest participants to receive a payout according to the most recently agreed off-chain state.

Custom transaction logic: The Perun protocol also allows for imposing arbitrary logic on a channel so that transactions can be made even without full off-chain consensus. For example, this allows for realizing atomic off-chain swaps with complex transaction logic.

Cross-chain transactions: Due to the local consensus mechanism, the Perun protocol can be extended to supporting cross-chain channels, where the deposited assets may lie on different blockchain networks (e.g., ETH and ADA). Implementing this functionality is work in progress but we eventually plan to bring it to all supported blockchain backends.

Implementation: The Go-Perun library implements the Perun protocol in an abstract sense so that it can be used with arbitrary blockchain backends given an implementation of the corresponding backend module. We currently offer backends for Ethereum, Cosmos, and Polkadot.

Roadmap overview: In order to bring Perun channels to Cardano, several steps are necessary.

  1. We need to evaluate how we can integrate our Perun channel protocol and implementation with the interfaces provided by Cardano. For that we require the following:
    1. We need to understand how our account-based protocol translates to the eUTXO model.
    2. We need to be able to encode arbitrary information in the off-chain client and then decode that information in the smart contract logic.
    3. We need to be able to generate signatures in the off-chain client for arbitrary states, pack these signatures in the transaction data, and then verify these signatures in the smart contract on-chain.
  2. We implement the on-chain smart contract that handles the logic for opening, closing, and disputing a channel on-chain.
  3. We implement the off-chain client connector that enables the go-perun library to send transactions to the Cardano network.

Remarks on roadmap and scope: The following should be taken into account.

  • Focus on simple payment functionality first: In order to keep the complexity low at the start, we plan to focus on simple payment channel functionality first, meaning we will leave the implementation of state channels with custom transaction logic to a later point in time.
  • Steep learning curve expected: We are used to working in the account-based model and with imperative smart contract programming languages. Therefore, we expect a steep learning curve at the start.

Update (March 9, 2022):

  • Synergies with Hydra team: We have discussed possible synergies with the Hydra team and plan to look into that further while the project is running. Potentially we can build on Hydra as a whole or reuse existing components of Hydra. We were also made aware that we might have underestimated the required effort and therefore adjusted our timeline and budget accordingly.

If the project is successful, there will be a state-channel-based scaling solution available for Cardano. State channels are particularly viable for use cases that require low latency transactions as, for example, in gaming or micropayment solutions.

Moreover, Perun channels will potentially enable cross-chain transactions in the future.

Challenge 1: Steep learning curve. We anticipate a steep learning curve and technological challenges on the way to bringing Perun channels to Cardano. So far we are used to working in the account-based model and with imperative programming languages.

Mitigation. We aim to mitigate the challenge of a steep learning curve by putting in a corresponding buffer in our project plan estimation. Furthermore, we will focus on the most simple version of Perun channels on Cardano first before aiming at implementing the full Perun feature set.

Challenge 2: Availability of Go client. Our library is written in Go and we typically rely on the availability of a Go client to send transactions to the blockchain and monitor the blockchain for corresponding events. However, such a client does not seem to be available for Cardano so far.

Mitigation. We aim for an implementation of our protocol first in a Cardano-native way using the respective native programming languages. We then may look into building an adapter between Go and the Cardano native environment.

Challenge 3: Availability of external libraries. Our smart contract logic must support some form of serialization that is also available to our off-chain client in Go. Furthermore, the smart contract must be able to verify signatures, meaning we require the availability of a signature verification function within a smart contract.

Mitigation. We will investigate the availability of libraries and ways to serialize information and verify signatures in a smart contract in the first phase of our project. In principle, we know that smart contracts on Cardano are powerful enough to provide the required functionality. However, if none of it is readily available, this may in fact put the whole project at risk.

[FEASIBILITY]

  1. Familiarize with Cardano smart contract framework and create detailed concept for porting the Perun protocol to Cardano and integrating it within the Perun Framework. (3 months)
  2. Smart contract and client off-chain part in Cardano environment (including test suite). (3 months)
  3. Integration with go-perun, which is the core library of the Perun Framework (including test suite). (3 months)

Total estimate: 9 months

We expect 2 developers, 1 project manager, and 1 researcher to work on the project.

We request a budget of roughly $30k USD / month.

The team includes the following members, which will potentially be assigned to the project.

Prof. Dr. Sebastian Faust (Head of research): Co-founder of PolyCrypt and co-inventor of the Perun Protocols. Head of research group for applied cryptography at TU Darmstadt, Germany. Numerous publications at renowned cryptography and computer security conferences such as CRYPTO, EUROCRYPT, S&P, CCS.

Hendrik Amler (Head of business and project management): Co-founder and CEO of PolyCrypt. Leads the business development. Will support the project management.

Dr. Matthias Geihs (Head of development): PhD in computer science with a focus on cryptography and computer security. Leads the development of the Perun Framework since the beginning of 2021. Proven track record of successfully leading projects for integrating Perun with Cosmos and Polkadot. Skilled in a variety of programming languages, research and project management.

Steffen Rattay (Core developer): Core developer of the Perun Framework since its beginning in 2019. Skilled in a variety of programming languages including Go and Rust. Main developer of the upcoming Perun integration with the Dfinity Internet Computer network.

Norbert Dzikowski (Core developer): Core developer of the Perun Framework since mid 2020. Experienced in a variety of programming languages including Go and Haskell.

[AUDITABILITY]

We will push our progress to a public repository, and track major features in issues as best we can (keeping a reasonable trade-off between efficiency and transparency). Work-in-progress code will be visible in the commits of merge requests.

The minimum requirement for success is that we can demonstrate the feasibility of Perun channels on Cardano, thereby opening up the space for applications that require scalable and low-fee peer-to-peer transactions, for example, games or micropayment solutions.

Ideally, we will be able to integrate the developed components directly within the Perun Framework and thereby enable the portability of existing applications and potentially cross-chain functionality in the future.

This is a new project.

Community Reviews (1)

Comments

Monthly Reports

This is the first progress report. We started onboarding our team and getting ourselves familiar with Plutus and Haskell.

Disbursed to Date
$300,000
Status
Still in progress
Completion Target
3/31/2023
Comments 0

Login or Register to leave a comment!

-

Disbursed to Date
$300,000
Status
Still in progress
Completion Target
3/31/2023
Attachment(s)
Comments 0

Login or Register to leave a comment!

Disbursed to Date
$300,000
Status
Still in progress
Completion Target
4. After 6 months
Attachment(s)
Comments 0

Login or Register to leave a comment!

Disbursed to Date
$300,000
Status
Still in progress
Completion Target
4. After 6 months
Attachment(s)
Comments 0

Login or Register to leave a comment!

We have worked on testing our Application Script on a local testnet. This is more tricky than expected as there does not seem to exist much official documentation on that. We managed to get a local testnet environment working and setup a PAB instance. However, calls to the PAB instance are failing at the moment, which we are currently investigating.

Disbursed to Date
$300,000
Status
Still in progress
Completion Target
4. After 6 months
Attachment(s)
Comments 0

Login or Register to leave a comment!

The details can be found in: https://github.com/perun-network/perun-cardano-contract/tree/perun-pab The high level explanation is located in the report.

Disbursed to Date
$300,000
Status
Still in progress
Completion Target
3. In the next 6 months
Attachment(s)
Comments 0

Login or Register to leave a comment!

Disbursed to Date
$300,000
Status
Still in progress
Completion Target
3. In the next 6 months
Attachment(s)
Comments 0

Login or Register to leave a comment!

Disbursed to Date
$300,000
Status
Still in progress
Completion Target
3. In the next 6 months
Attachment(s)
Comments 0

Login or Register to leave a comment!

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