nomad-xyz / awesome-interop

A curated list of awesome resources and projects that concern blockchain interoperability
Creative Commons Zero v1.0 Universal
105 stars 20 forks source link

Add Perun project #8

Closed matthiasgeihs closed 2 years ago

matthiasgeihs commented 2 years ago

The go-perun state channel library recently added support for multi-chain channels (i.e., channels whose assets may reside on different chains). These can be used, for example, to realize trustless cross-chain swaps.

odyslam commented 2 years ago

It doesn't sound like an optimistic protocol, you should put it under the correct project category (or create a new one).

How does it make cross-chain work? I

matthiasgeihs commented 2 years ago

Let's take the example of a cross-chain swap. We have two actors, the customer, and the liquidity provider.

The Perun multi-ledger protocol works as follows. Both parties lock their funds on their chain into something which you could see as a multi-sig contract with some extra functionality. It is an optimistic protocol in the sense that if both behave honestly, then they will just exchange a multi-sig on the off-chain swap transaction, and thereby obtain the right to withdraw the funds on the other chain.

Of course, the liquidity provider could try to cheat and pretend to one chain that the off-chain swap transaction has been performed, while on the other chain he pretends that the swap did not happen and he just tries to recover its original funds. However, we prevent this through a watcher protocol that basically allows anybody to check for such inconsistencies across chains and ensure (due timelocks) that there is enough time to resynchronize the state across chains. Thereby we can guarantee that either the swap happens on both sides, or it does not happen at all.

This is very much an extension of payment channels to multiple networks. You can read about the concept here: https://labs.hyperledger.org/perun-doc/concepts/multi_ledger.html.

From my perspective it fits under Optimistic protocol. But of course you could also create a new category, e.g., State Channel. What do you think?

matthiasgeihs commented 2 years ago

Any reason why this got closed without comment? @odyslam