2

As I understand the Raiden network a smart contract is set up between two addresses, and loaded by each participant with tokens, and this instance of the smart contract sits in the blockchain. At this point we are all standard blockchain. Normally a write type operation in the contract would be called by creating a standard ethereum transaction targeting the contract address, and the mining process would result in the write operation being called in the contract. Again, this is all standard ethereum blockchain (as far as I know).

So my question is, what is the mechanism to call a write operation (e.g. Balance transfer) in the Raiden network? It can't go through the blockchain/miners as that would defeat the point of the Raiden network.

3

Raiden operates channels between participants. To set up a channel between two nodes requires interaction with the blockchain (a netting contract is created), and closing a channel requires interaction with the blockchain (accounts are settled, tokens balances are sent, the netting contract self-destructs). But everything in between happens off-chain solely between Raiden clients.

Each participant runs a Raiden client that maintains a record of transfers, balances and (crucially) the cryptographic balance proofs. The current client is Python based and runs independently of any Ethereum node. It sets up its own communication channels with other Raiden nodes. Since none of this involves the blockchain, transfers can be very fast. Transfers are made by RPC API calls into the Raiden client.

To make this "safe", participants lodge tokens in the netting contract when the channel is created (and can top it up subsequently - this does require a blockchain transaction). You can't send more than you've lodged. The only way to get tokens out is to close the channel, at which point your net balance is sent to you.

There's an overview of all this in the Raiden documentation.

| improve this answer | |
  • 1
    Ah, I see, I had read some of the Raiden docs, but I had come to the conclusion that the netting contract was adjusting the balance, but in fact I think you are saying that the values in the contract don't change with each transaction, but only when it is created, topped up or closed. – Slicc Dec 27 '17 at 8:13
  • 1
    Yes, exactly. I'm now wondering about what happens if a Raiden client decides to lie about its net balance... I'm sure they've thought about this! Will have to look into it :-) – benjaminion Dec 27 '17 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.