-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSC yellow paper #382
VSC yellow paper #382
Conversation
I will withhold my review, since I was a co-author of the document. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excuse the lack of detail in my review as I'm still finding my way through SCs. Until then here is some high-level feedback.
The proposal reads more like a blog post and less like a specification / technical design. If that is not the intention it should be reworked to be more formal and structured.
I would like more step-by-step visuals for the explanations of setup and error cases. VSCs add another layer of complexity to the interaction between parties using SCs. Thus, visuals would really help making the processes clear.
Regarding the approach: VSCs are described as the means to realize soft-realtime use-cases using SCs. The proposal doesn't give a explanation how the use of VSCs would work end-to-end. This would be useful for an example use-case because lowers the abstraction level for the reader quite a bit.
Yes, as intention is to be shared to the community so it can be discussed there. Later on we will have a better more strict and technical documentation. Regarding the approach - the goal is to have a solid shared understanding regarding on-chain dispute mechanisms, so we can bake the in the on-chain protocol. The details of tthe off-chain protocol are not yet cleared out and are outside of the scope of this document. |
|
||
Each channel has an ever changing state. It is represented by a set of MPTrees | ||
that hold accounts, contracts and contract calls. This set of MPtrees can be | ||
treated as one big MPTree that has a root hash. This is what we call a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all trees like in full node state? (oracle, aens, etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but names and oracles are empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- There should be a TX dedicated for force progressing VSC operations - more info in devchat.
- The only case in which the VSC state should be exposed is when on-chain forcing a force_progress_tx inside the VSC - more info in devchat. Additionally the AI, IB offchain state can remain mostly private.
- Channel creation should sometimes be force progress-able - For instance Alice sends to Ivory a channel create TX and then Ivory applies the TX to the AI channel but not to the IB channel - In this case Bob or Alice should be able to perform a VSC force progress operation.
- Onchain VSC force progress operations could in some cases move the channel onchain(If Ivory cheated once then she may do it again). The proposed channel_vsc_force_progress_tx contains enough information to move the channel onchain - after a move was done we need to wait for disputes comming from Ivory as the channel_vsc_force_progress_tx may not be based on the latest state.
- Sometimes we may want to change the intermediary - this can be done if the parties cooperate. I'm not sure if this will be useful.
- I'm not sure how disputes should be handled in the multi-intermediary VSC, If we stick to the VSC in VSC model then I see how can we guarantee security.
- The off chain FSM should check if an VSC can be established - if so then while opening a channel the client should be able to chose between creating an onchain SC or a VSC - this would increase usability drastically.
This is true, I will amend the file with it.
In this case Ivory will have already commited some tokens to the VSC in Alice-Ivory SC, so Ivory has the financial incentive to open the same VSC in Ivory-Bob. If Bob rejects it - Ivory shall close the VSC in Alice-Ivory VSC. Until Bob gets the virtual channel creation in Bob-Ivory SC, then Bob can not proceed using the VSC in a safe manner.
I find this a cool optimization but it is debatable if it is needed for the initial version
Indeed useful and will make the netwok much more dynamic and resilient. Since it is outside of the scope of the on-chain protocol, it is outside of the scope of the document.
I think it would be the same as everyone can take care just for themselves.
FSM is out of the scope of this document. |
Co-Authored-By: AleksandarFilipov <aleksandar.f@gmail.com>
Co-Authored-By: AleksandarFilipov <aleksandar.f@gmail.com>
|
Co-Authored-By: AleksandarFilipov <aleksandar.f@gmail.com>
Co-Authored-By: AleksandarFilipov <aleksandar.f@gmail.com>
Yes, this makes sure the channel is not having more tokens off-chain than on-chain. Otherwise it would be undisputable on-chain.
The goal is Ingrid to be safe in any case, including the one where Alice and Bob are not cooperating and refuse closing the channel. Then Ingrid can initate a closing on-chain and let them provide newer states than the opening one. |
|
channels/VSC.md
Outdated
* a co-authenticated VSC snapshot | ||
* a co-authenticated VSC settle | ||
* a co-authenticated VSC mutual close | ||
* unilaterally authenticated dispute. Those also provide a context of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a unilaterally ...
context for ...
channels/VSC.md
Outdated
applied on top of the `poi` | ||
* `round`: SC's next round | ||
|
||
Note that this allows force progressing of both contracts in VSC and force |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
force-progressing
channels/VSC.md
Outdated
progressing a VSC inside a VSC. | ||
|
||
From now on we will use force progress in the context of VSC meaning a Virtual | ||
State Channel Force progress transaction - `channel_vsc_force_progress`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force Progress
channels/VSC.md
Outdated
##### Example | ||
|
||
Alice wants to close her Virtual State Channel with Bob, but Bob refuses. Alice | ||
produces a solo update in her on-chain State Channel with Ingrid initiating a | ||
solo-closing sequence of the Virtual State Channel. If Ingrid refuses this, | ||
Alice can force it on-chain. | ||
Alice can force it on-chain using `channel_vsc_force_progress. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing ending backtick.
channels/VSC.md
Outdated
next Ingrid-Bob off-chain state. The newly produced Ingrid-Bob state has in its | ||
state the VSC's. | ||
refuses to co-authenticate the next state, Alice can produce an off-chain | ||
`channel_vsc_force_progress` which is similar to force progress and bring it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..., which is similar to force progress, ... (commas)
Co-Authored-By: AleksandarFilipov <aleksandar.f@gmail.com>
Co-Authored-By: AleksandarFilipov <aleksandar.f@gmail.com>
Co-Authored-By: Ulf Wiger <ulf@wiger.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Tino's statement, that this doesn't read like a specification. So, I'd say that in the current form it does not belong into the protocol—at least not into the master branch.
Beyond that, with the earlier comments in mind, the approach seems fine but I'd to withhold final judgment until we have something closer to a specification.
software will run in different contexts. | ||
|
||
With this in mind, in order for us to explain in detail the nuts and bolts of | ||
Virtual State Channels we must first dive deep into on-chain State Channels. I |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching from we
to I
treated as one big MPTree that has a root hash. This is what we call a | ||
`state_hash` of a channel and it identifies the channel's state at a certain | ||
point of time. Since in essence the off-chain world is detached from the | ||
on-chain world - we don't measure points of time with blocks but rather with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/ -/,/
as to _when_ they were produced: we must be able to order state changes. Thus we | ||
also have an increment-only value we call `round`: it is the index of the round | ||
of updates, starting with [1 at channel creation | ||
time](https://github.com/aeternity/aeternity/blob/16ecd302e60f599bfe3cc5f5cf0f7ea5ea336874/apps/aechannel/src/aesc_create_tx.erl#L304-L306). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link to source code is irrelevant, imho
|
||
That would mean that no transaction is posted on-chain when opening the Virtual | ||
State Channel, and it is active and safe to use as soon as all three parties | ||
have agreed upon it. The proposed solution results in using Ingrid as on-chain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposed solution results in using Ingrid as on-chain State Channels use the on-chain.
This can probably go since the next sentence says the same thing
For some time now @uwiger and I had been describing our vision for Virtual State Channel.
This PR is the current view of it, once we all agree upon it, we will share it to the forum where people can discuss it even further.
The goal is defining the on-chain protocol.