The Raiden Light Client SDK is a Raiden Network compatible client written in JavaScript/Typescript, capable of running in modern web3-enabled browsers, wallets and Node.js environments.
The Raiden CLI is a reference implementation that provides a HTTP REST server which is fully compatible with the Raiden API specification.
The Raiden dApp is a reference implementation of the Raiden Light Client SDK, which can be used with web3 wallets like Metamask (Desktop) or imToken (mobile).
INFO: The Light Client SDK, CLI and dApp are all work in progress projects. All three projects have been released for mainnet and all code is available in the Light Client repository. As this release still has its limitations and is a beta release, it is crucial to read this readme including the security notes carefully before using the software.
The Raiden Network is an off-chain scaling solution, enabling near-instant, low-fee and scalable payments. It’s complementary to the Ethereum blockchain and works with any ERC20 compatible token.
The Raiden client code is available here and has been released for mainnet.
The goal of the Raiden Light Client SDK is to provide an easy-to-use framework, which can be integrated by any JavaScript developer. The SDK simplifies the process for developers to embed and use the Raiden Network for token transfers in decentralized applications
The SDK aims to make the life of dApp developer easier by:
The Raiden Light Client SDK is a standalone TypeScript library which contains all the low level machinery to interact with the Ethereum blockchain and the Raiden Network.
Its target audience is blockchain and dApp developers looking to perform transfers in the Raiden Network from their dApps.
By targeting browsers and Node.js as initial platforms, the SDK can reach a majority of the current and in-development dApps, as well as providing a common language reference implementation for re-implementations in other languages and environments.
Look at the Raiden Light Client SDK folder of this repository for more information and a technical deep dive into the SDK architecture, technologies and details on the design goals and decisions.
Reading the documentation is highly recommended for anyone who wishes to better understand how the Raiden Light Client works under the hood or wants to contribute to its development.
+-------------------+
| |
| Raiden dApp |
| |
| vue/vuex/vuetify |
| |
+---------+---------+
| |
| Raiden SDK |
| |
+----+----+----+----+
| | | +--------------+
+---+ redux + epics +------+ Matrix.org / |
| | | | | WebRTC |
| +---------+-----+---+ +-------+------+
| | |
+-------+--------+ +------+------+ +------+------+
| pouchDB | | ethers.js | | Raiden |
+----------------+ +------+------+ | Network |
| +-------------+
+------+------+
| ethereum |
+-------------+
If you are new to Raiden, we recommend:
Before trying out the dApp, make sure that you've read and understood the requirements for safe usage
The Raiden dApp is a demo and the first dApp to be built on the SDK. It's a single page application (SPA) built on top of Vue.js, vuex and uses vuetify Material Design as UI framework.
These step-by-step instructions will guide you through the process for trying out the Raiden demo dApp.
The dApp is hosted on https://lightclient.raiden.network and in this quick start guide we will be making a transfer using the Light Client on both mainnet and the Goerli testnet with the MetaMask wallet.
For a more in depth user guide, see the Light Client documentation.
For these step-by-step instructions the MetaMask browser extension will be used. Make sure MetaMask is installed on your browser. the plugin can be downloaded from their website. Alternatively WalletConnect can be used for connecting with supported wallets, note that this is an experimental feature limited to how well any of the external wallets integrate with WalletConnect.
An ETH balance is also needed. For mainnet you'll have to purchase ETH, for the Goerli testnet you can acquire some test ETH by:
Connect to the dApp
Connect using the Browser Extension
Connect using WalletConnect
Select a Hub and Open a Channel
Make a Transfer
Connect to the dApp
When redirected to the Light Client choose to connect by using either:
Browser Extension
WalletConnect
Select a Hub and Open a Channel
Make a Transfer
Receiving of transfers will be disabled if the utility token (RND on mainnet and SVT on testnet) balance is too low.
To enable receiving again, make sure to add a utility token balance by either making an exchange and deposit if using the Light Client on mainnet or by minting and depositing if using the Light Client on testnet.
You should store a backup of your state to avoid losing tokens in case:
You use another browser.
If you want to continue using the dApp with a specific account after switching browser or changing computer, you'll need to make sure that the dApp is connecting with the most recent state.
This is important because the state contains all off-chain information needed for making transactions in the Raiden Network.
The state is stored in the browser across sessions and therefore needs to be downloaded and uploaded whenever you switch browser or computer.
You can download and upload the state from the General Menu.
If you lose or delete your state you will also lose your token.
Example of a part of the JSON state file:
[
{
"_id": "_meta",
"version": 2,
"network": 5,
"registry": "0x9b0c8C8C75904CEf5B7a8dbF59c3459Ea85c6526",
"address": "0x2a23F385d32dcce35824D4498Bb10f9B6575B2de",
"blockNumber": 2561973
}
]
To run the code in this repository, you must have Node.js 14+ and Yarn installed as well as a web3-enabled browser (e.g. Firefox with Metamask extension), with some ETH on the account.
Go to the SDK Documentation for more information on how to install and use the SDK.
Go to the CLI README for installation instructions and the current status of the API.
Clone repository
git clone --recurse-submodules https://github.com/raiden-network/light-client.git
cd light-client
Install dependencies
yarn install
Update the sdk submodules
yarn workspace raiden-ts update-submodules
Build the Raiden SDK
yarn workspace raiden-ts build
Run the dApp locally
yarn workspace raiden-dapp serve
After the development server starts, navigate to http://localhost:8080
to use the Raiden dApp.
In order to use Raiden correctly and safely there are some things that need to be taken care of by the user:
Layer 1 works reliably: That means that you have got a web3 provider (eg. MetaMask) that is always synced and working reliably. If there are any problems or bugs on the client then Raiden can not work reliably.
Persistency of local DB: Your local state database is stored in your browser storage (IndexedDB). This data should not be deleted by the user or tampered with in any way. Frequent backups are also recommended. Deleting this storage could mean losing funds.
We are working in 2 weekly iterations. Priorities are managed within the Product Backlog.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Also have a look at the Raiden Light Client Development Guide for more info.
The Raiden team has undertaken several risk mitigation measures to limit any potential damage caused by bugs or misuse of the software. In addition, a bug bounty is run in order to make sure the software lives up to the highest standards possible. For more information and to participate visit the Raiden Bug Bounty website.
Distributed under the MIT License.
Dev Chat: Gitter
Twitter: @raiden_network
Website: Raiden Network
Mail: contact@raiden.network
Project Link: https://github.com/raiden-network/light-client