Assuming Alice (Maker) and Bob (Taker) want to engage in an exchange of red (R-Token) and blue (B-Token). Alice is offering three R-Token in exchange for three B-Token. Both have a direct channel within the Red Token Network and a Blue Token Network and they deposited their respective amount of token into the their channels.
##Roles
Commitment Service (CS)
Furthermore, it exists a Commitment Service which is also listening to incoming offers and comes into play at contract signing (Commitment Phase).


Describe mechanism of hash and multilocked payments
1) Offering
Alice broadcasts the offer which is a description of a receiving transfer and an outgoing transfer to the public chatroom. Commitment Service (CS), as well as traders, are listening to that chatroom.
| id |
sell_token |
sell_amount |
buy_token |
buy_amount |
secrethash |
signature |
| orderhash |
Red |
3 |
Blue |
3 |
secrethashAlice |
sigAlice |
Bob creates an offer what is called an inverse offer.
| id |
sell_token |
sell_amount |
buy_token |
buy_amount |
secrethash |
signature |
| orderhash |
Blue |
3 |
Red |
3 |
secrethashBob |
sigBob |
Bob wants to accept this offer and contacts the CS. Commitment Service accepts to be the chosen CS.
Bob sends an offer acceptance to CS with orderID.
2) Offer match
CS has found the match and will initiate the trade by starting the Commitment Phase

2.1) CS initiates trade. Sends commitment request to both. Initiates time out.
CS sends the commitment request to Alice and to Bob.
To Alice
| id |
opponent |
secrethash |
signature |
| orderhash |
addressBob |
secrethashBob |
sigCS |
To Bob
| id |
opponent |
secrethash |
signature |
| orderhash |
addressAlice |
secrethashAlice |
sigCS |
2.2) Alice's and Bob's Raiden Nodes create a commitment by generating the next balance proof ### Describe Balance Proof (BP) (=Commitment) ... containing a multilocked payment for the opponent. What is a multilocked payment and pass it back to their Raidex Node which passes it back to CS. Optionally to guarantee privacy it can be encrypted by the opponents public key. Both BPs contain the locked transfer with both secret hashes of Alice and Bob.
Encryped Message = ...
Enc(PubBob, [(BalanceProofAlice)sigAlice]
Enc(PubAlice, [(BalanceProofBob)sigBob]
2.3) CS collects encrypted BPs.
3) Commitment

3.1) CS send encrypted messages to Alice and Bob.
3.2) Alice and Bob decrypt the messages. They verify the Balance Proofs. They blindfold the message details
3.3) They send the signed Balance Proof for monitoring services to CS + the secret.
Commitment is now final.
4) Settlement

4.1) CS sends secret pair to Alice and Bob. secret pair - was ist das?
4.2) CS sends blindfolded BPs to Monitoring Service
4.3) Alice and Bob will unlock the payment.
Alice sends unlocked payment of 3 R-Token.
Bob sends unlocked payment of 3 B-Token.
Commitment Service could cooperate with a Monitoring service to guarantee the binding.
Assuming Alice (Maker) and Bob (Taker) want to engage in an exchange of red (R-Token) and blue (B-Token). Alice is offering three R-Token in exchange for three B-Token. Both have a direct channel within the Red Token Network and a Blue Token Network and they deposited their respective amount of token into the their channels.
##Roles
Commitment Service (CS)
Furthermore, it exists a Commitment Service which is also listening to incoming offers and comes into play at contract signing (Commitment Phase).
Describe mechanism of hash and multilocked payments
1) Offering
Alice broadcasts the offer which is a description of a receiving transfer and an outgoing transfer to the public chatroom. Commitment Service (CS), as well as traders, are listening to that chatroom.
Bob creates an offer what is called an inverse offer.
Bob wants to accept this offer and contacts the CS. Commitment Service accepts to be the chosen CS.
Bob sends an offer acceptance to CS with orderID.
2) Offer match
CS has found the match and will initiate the trade by starting the Commitment Phase
2.1) CS initiates trade. Sends commitment request to both. Initiates time out.
CS sends the commitment request to Alice and to Bob.
To Alice
To Bob
2.2) Alice's and Bob's Raiden Nodes create a commitment by generating the next balance proof ### Describe Balance Proof (BP) (=Commitment) ... containing a multilocked payment for the opponent. What is a multilocked payment and pass it back to their Raidex Node which passes it back to CS. Optionally to guarantee privacy it can be encrypted by the opponents public key. Both BPs contain the locked transfer with both secret hashes of Alice and Bob.
Encryped Message = ...
Enc(PubBob, [(BalanceProofAlice)sigAlice]
Enc(PubAlice, [(BalanceProofBob)sigBob]
2.3) CS collects encrypted BPs.
3) Commitment
3.1) CS send encrypted messages to Alice and Bob.
3.2) Alice and Bob decrypt the messages. They verify the Balance Proofs. They blindfold the message details
3.3) They send the signed Balance Proof for monitoring services to CS + the secret.
Commitment is now final.
4) Settlement
4.1) CS sends secret pair to Alice and Bob. secret pair - was ist das?
4.2) CS sends blindfolded BPs to Monitoring Service
4.3) Alice and Bob will unlock the payment.
Alice sends unlocked payment of 3 R-Token.
Bob sends unlocked payment of 3 B-Token.
Commitment Service could cooperate with a Monitoring service to guarantee the binding.