This proposal aims to integrate Perun payment channels with CKB. This will foster fast and secure payment settlement on Nervos. In a future proposal, these payment channels can be extended to payment channel networks of higher degrees.
Structure. We start with a general overview of the Perun project and an architectural overview of the proposed solution. We then set the scope of the current proposal.
Background. Perun channel technology enables fast and cheap transactions on and across blockchains. The technology is based on peer-reviewed research that has been published at top conferences and is being implemented in the form of the open-source library go-perun written in Go. One of its main features is its blockchain-agnostic design, which means that most parts of the library do not depend on concrete blockchain implementation, but are rather implemented against abstract blockchain backend components. Currently, we have backends for Ethereum, Cosmos, Polkadot and Hyperledger Fabric.
Proposal. We propose to adapt the go-perun framework so that two-party single-asset state channels between users on Nervos can be created, processed, closed and disputed.
We propose to release this work open-source under the Apache 2.0 license.
Outlook. Please refer to the ”Future Roadmap towards Payment Channel Network” section for future extensions.
Go-Perun is the core library of the Perun project. It is a toolkit for developers to integrate state channels within their applications. The library is written in Go and it implements the client protocols against a set of abstract interfaces for blockchain communication, off-chain communication, persistence, and so on. To the developer, it exposes an easy enough interface to integrate Perun channels within their application.
Figure 1. Package structure of Go-Perun.
An overview of the packages of Go-Perun is given in Figure 1. At the library’s core lies the client package, which holds the channel client type and implementation of the channel protocols. For communication with other clients, the client package uses the wire package, which is an abstract definition of the communication layer that is to be instantiated with a concrete implementation suitable for the given application context. Furthermore, the client package interfaces with the wallet package and the channel package. The wallet package and the channel package lie at the core of any blockchain backend implementation. The wallet package provides functionality for account management and signature generation. The channel package provides the core data structures and functionality for interacting with the blockchain. Besides that, the library contains the persistence package and the log package, which are abstractions for persistence and logging functionality which can be instantiated suitable to the application environment.
The focus of this proposal is to provide basic integration of Perun channels within CKB that can serve as a foundation for future projects and enhancements. This will include the following:
- Protocol research: As Nervos is UTXO-like, we need to adopt our protocols accordingly. Most of our work so far has been focused on blockchains with an account-based model. However, we recently also gathered some experience with building Perun for Cardano, which is a project in progress, where we also came up with a UTXO-based set of protocols for channel funding and settlement. Therefore, we are confident that this is an achievable goal.
- On-chain contract: A Go-Perun blockchain backend consists of an on-chain contract running on the blockchain and an off-chain connector that integrates the on-chain contract with the off-chain Go-Perun core. Here the focus will be on delivering a basic contract implementation that provides payment channel functionality (funding, settlement, dispute).
- Off-chain integration: For the off-chain integration with Go-Perun, we will need to connect the Go-Perun core with the on-chain contract written in the previous step. This means translating the calls of the core client against the abstract interface into concrete calls to the Perun contract deployed on a Nervos network. We plan to use the library ckb-sdk-go for that.
- Demonstrator (optional): It has been shown in the past that it is useful to have a basic demonstrator delivered with the core components, which is capable of demonstrating the new functionality in a way that end users can experience it directly in a small sample application. This is an optional milestone.
More details can be found in the Development Roadmap further down below.
Developer Engagement. It is our goal to increase developer and user activity within Nervos. By allowing Nervos’ users to use payment channel networks and potentially app channels and cross-chain channels in the future, we hope to open up blockchain ecosystems to each other and allow their users a greater degree of flexibility and mobility in their application of blockchain technology.
Synergies. As a L2-friendly ecosystem, CKB is willing to actively use innovative solutions to supplement DLTs. Especially payment channel networks are something that has been up and coming lately. PolyCrypt started developing and researching channels and channel networks in 2017.
Who is your target audience? What need(s) does your project meet?
We target the following user groups:
- Retail investors
- General users
The PolyCrypt/Perun team consists of leading academic researchers in the off-chain space and experienced software developers of blockchain and cryptographic software. The team members include:
- Prof. Sebastian Faust (Co-founder, research lead) is a full professor at the Computer Science department of the Technical University of Darmstadt, where he leads the applied cryptography and blockchain lab. He has published more than 60 academic papers in cryptography and blockchain technologies at leading venues for research in IT Security and Cryptography. His main scientific contributions to the blockchain space are the co-invention of the concept of Proofs of Space (on which the cryptocurrency Chia is based), the first formal analysis of BIP32 wallets, and extensive work on off-chain protocols. The latter includes the development of the Perun off-chain protocols published in a series of works at IEEE S&P, Eurocrypt and ACM CCS.
- Hendrik Amler (Co-founder, Co-CEO, team management, @tinnendo) will be responsible for project management.
- Norbert Dzikowski (Developer, @ndzik): Core developer of the Perun Framework since mid-2020. Experienced in a variety of programming languages, including Go and Haskell. Our Nervos & UTxO expert who already worked on Perun Channels in different blockchain ecosystems.
- Jan Bormet (Developer, @janbormet) Core developer of Perun since 2022. Jan is already experienced in programming Perun Channels on UTxO-like chains as well.
- Steffen Rattay (Developer, @RmbRT)
- Philipp Lehwalder (Developer, @cryptphil)
- Marcel Kaiser (Business Developer) is responsible for social media activity and will support the project management.
- Sasan Safai (Co-founder, business development)
- Prof. Stefan Dziembowski (Co-inventor of Perun, Head of Cryptography Research Group at University of Warsaw)
The Perun team has extensive experience in applied cryptography and blockchain research as well as in software development. Our team members include the leading researchers on the Perun state channel research papers, which have been published at renowned conferences. Furthermore, our team includes experienced developers. Our team members are the main developers of the go-perun library and therefore provide over 3 years of experience specifically in developing software in the blockchain space.
Please see the section Team members for more details.
Team Code Repos
Team LinkedIn Profiles
Our company LinkedIn profile is available at https://www.linkedin.com/company/perun-network/.
The foundation for Perun State Channels was laid in “Perun: Virtual Payment Hubs over Cryptocurrencies”, published at IEEE S&P 2019, Perun: Virtual Payment Hubs over Cryptocurrencies | IEEE Conference Publication | IEEE Xplore, also available at Perun: Virtual Payment Hubs over Cryptocurrencies. This is one of the most prestigious academic conferences in IT Security. An overview and summary of the research results is given in our white paper at https://perun.network/wp-content/uploads/Perun2.0.pdf.
The main repository of the go-perun library is at GitHub - hyperledger-labs/go-perun: 🌔 Perun's Blockchain-Agnostic State Channels Framework in Go.. It currently features an Ethereum blockchain backend and supports generalized state channels on a single backend. In 2020, we joined the hyperledger foundation together with our industry partner BOSCH, with the goal of growing an open-source community around the Perun project.
Milestone 1: Protocol research
This milestone focuses on adapting our account-based protocols to the UTXO-like model of Nervos CKB.
Duration: 1 month
|1||Protocol specification||A document that describes how funding, settlement, and dispute protocols for Perun channels will be implemented on CKB.|
Milestone 2: On-Chain contract
Duration: 2 months
|1||Contract||The implementation of the on-chain contract that will be deployed on a CKB network.|
|2||Tests||Rigorous testing of the on-chain contract, usually aiming at near 100% test coverage.|
Milestone 3: Off-Chain backend
Duration: 2 months
|1||Wallet implementation||The CKB-specific implementation of the wallet package interfaces. This includes the implementation of the following types: Account, Address, Wallet.|
|2||Channel implementation||The CKB-specific implementation of the channel package interfaces. This includes the implementation of the following types: Funder, Adjudicator, AdjudicatorSubscription.|
|3||Tests||Integration tests of the newly developed components.|
Milestone 4: Demonstrator
Duration: 1 month
|1||CLI demo client||We develop a CLI demo client that showcases the newly developed functionality. The idea is to have a simple payment client that can connect with other clients, open a payment channel, and send payments off-chain.|
We are more than happy to answer your questions here or on our Discord server!
Feel free to join us here: PolyCrypt