Understanding code of AE state channel

Hi Guys,

So now I have gone through the code base of state channel fully (or at least the update channel part). Based on that I came up with these two diagram. It would be really helpful if someone can validate this. I am also planning to write a blog post on the implementation.

Sequence Diagram of channel update

Untitled(1)

A       ----Tx data--->        FSM A
FSM A   ----rawTx--->          A
A       ----halfSignedTx--->   FSM A // FSM A updates its state (half)

FSM A   ----halfSignedTx--->   FSM B // NOISE

FSM B   --- halfSignedTx--->   B
B       ----fullSignedTx--->   FSM B // FSM B updates its state

FSM B   ----fullSignedTx--->   FSM A // NOISE: FSM A updates its state (full)
  • Here: A and B: JavaScript sdk

FSM - RPC state table

Understanding the code flow

2 Likes