Skip to content
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

Directly open heads #1329

Open
ch1bo opened this issue Feb 26, 2024 · 5 comments
Open

Directly open heads #1329

ch1bo opened this issue Feb 26, 2024 · 5 comments
Assignees
Labels
L1 Affects the on-chain protocol of Hydra 💭 idea An idea or feature request
Milestone

Comments

@ch1bo
Copy link
Collaborator

ch1bo commented Feb 26, 2024

Why

After the incremental de/commits are implemented we noticed there is room for the protocol simplification. There is no need to have the commit, collect and abort transactions if the Head protocol would start immediately in the Open state and then parties could start committing (and decommit) funds to a directly open head.

Not having an initialization phase will avoid issues of "non-abortable heads" #699, remove the bottleneck of collectCom and abort transactions (they are limiting how many parties we can support right now) and an overall simpler state machine, at the cost of potential congestion if multiple participants want to commit at the same time.

Image

What

Init-ing a head used to mean all participants get the inital output they need to spend in the commit transaction which then get collected in order to open a Head. If we are in the Open state right after initializing the protocol we can just directly commit funds to a running Head in order to be able to transact on L2.

In the same manner while the head is open we can also choose to decommit some funds.

This means we can get rid of code and tests related to the init, commit and collect transactions and observations. This should slim down the code and make it easier to maintain but also make the Head protocol a bit easier to reason about.

Before doing these changes we need to talk to researchers and see if they see any potential flaws in this new design.

Open questions:

  • Previously init tx was producing outputs that contain the PT tokens for the users to spend into commit. How would the workflow look like without this step? We would need to produce the vHead output with all of the needed tokens so probably we would need to re-purpose the vInit script (or create a new one) to do that on start of the protocol.

How

We need to remove:

  • Client inputs that are no longer needed
  • Server outputs that are no longer needed
  • Off-chain transaction creation and observation for init, commit and collect
  • vInitial and vCommit scripts
  • Related tests
  • Related benchmarks and tx-cost calculations
@ch1bo ch1bo added the 💭 idea An idea or feature request label Feb 26, 2024
@ch1bo ch1bo changed the title Partial fanout & no commit phase Directly open heads Feb 29, 2024
@ch1bo
Copy link
Collaborator Author

ch1bo commented Feb 29, 2024

Changed title and edited the description as fanout is not avoided and still required in this model. So this is really only about removing the commit phase at the cost of forced sequencing of commits.

Writing about this, I realize this could be avoided as well by having n head outputs per head, i.e. one for each participant. However this would complicate close transactions as they would then need to collect all those outputs (like the collect does now).

@GeorgeFlerovsky
Copy link

GeorgeFlerovsky commented Mar 1, 2024

@ch1bo
This is a really cool idea. If I understand it correctly, it would remove the CollectCom bottleneck from Hydra and make opening/committing much more flexible. Very beneficial for L2 dapps IMO.

Question: I don't see a contestation mechanism in the diagram for Direct Open; how do you deal with the scenario of L2 consensus breaking down?

@ch1bo
Copy link
Collaborator Author

ch1bo commented Mar 4, 2024

Question: I don't see a contestation mechanism in the diagram for Direct Open; how do you deal with the scenario of L2 consensus breaking down?

@GeorgeFlerovsky That's actually a typo in the tikz I used to throw together that slide. It's also indicated by the crossed out sentence.

So this feature would not change anything on the closing/contestation procedure and only get rid of the commit phase.

@GeorgeFlerovsky
Copy link

Question: I don't see a contestation mechanism in the diagram for Direct Open; how do you deal with the scenario of L2 consensus breaking down?

@GeorgeFlerovsky That's actually a typo in the tikz I used to throw together that slide. It's also indicated by the crossed out sentence.

So this feature would not change anything on the closing/contestation procedure and only get rid of the commit phase.

Right, that's what I thought it was. 👍

@ch1bo ch1bo added the L1 Affects the on-chain protocol of Hydra label Apr 2, 2024
@ch1bo ch1bo mentioned this issue Jul 8, 2024
11 tasks
@ch1bo ch1bo added this to the 1.0.0 milestone Jul 23, 2024
@ch1bo
Copy link
Collaborator Author

ch1bo commented Jul 29, 2024

@noonio Updated the Why and mention how this is an alternative to #699, which I'm superseding now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L1 Affects the on-chain protocol of Hydra 💭 idea An idea or feature request
Projects
Status: Later
Development

No branches or pull requests

3 participants