-
Notifications
You must be signed in to change notification settings - Fork 86
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
Only sign closable snapshots #370
Comments
Other implementation idea: We could use a specially configured ledger, with specific rules preventing application of transactions leading to unclosable UTxO. This would have the nice property of encapsulating this filtering logic inside the |
FWIW, one use-case for Hydra Head is micro-payments which could very easily lead to UTxO that cannot be committed back on-chain. How are we supposed to handle this problem if we implement this feature? |
I expect these UTxOs preventing snapshots to be signed until they are aggregated again. Maybe we could generalize #358 to also exclude these outputs from signing snapshots to have more confidence on unrelated outputs? |
The more I think about it, the more I view this feature as problematic for quite a large number of use cases, to the point of making the Hydra Head protocol pretty much useless but for only a small subset of the usages we envisioned initially. If we don't sign snapshots that are not "fannoutable":
More precisely, we can post one such transaction but it will never get confirmed, and because new transaction (received through It seems to me we are facing a contradiction, which might or might not be a fundamental limitation of Hydra Head protocol, between broadening the use cases space and maintaining security properties of the protocol. Given the Hydra Head nodes have to know each other in advance to form a head (they are supposed to communicate through pairwise authenticated channels as per Rather than doing some filtering inside the Head, another option would be to modify the protocol to not limit the contestation period until FanOut is posted and finalised, eg. Head stays open until FanOut: Should a FanOut tx fail because it's invalid on L1, it's still possible to create a new snapshot, sign it, and "Contest" the latest one. |
@abailly-iohk I think you are right and I shall think about this a bit more as well. One thing which struck my mind when reading your comment: If we would be using MPTs, we could fan out the parts of the Head which are sound, even though the Head is closed. However this would open up again "attacks" where a party says "yeah.. i'm not going to close the head while you have all your money in coin dust" .. and then they do it. |
In any case, this seems a hot topic to discuss with research team. |
To add to this discussion, as @abailly-iohk mentioned, since participants know each other, there is more trust than on the layer 1. That said, if all parties commit the same amount to the head as collateral (e.g. bigger than the value that is transferred in the head), no party has the incentive to close a head that cannot fan out. This leverages the mutual assured destruction (MAD) principle. Another additional idea, inspired by the kaleidoscope paper
In that protocol, cards are shuffled using a |
We realized that reference scripts make the head unclosable as well (since Babbage of course). When committing a UTxO with a reference script, the head can be opened (if it fits), but a fanout done by the We could craft a fanoutTx by hand if needed and given we have all the necessary information.. but this can be seen as a similarly unsupported feature like byron addresses or growing the UTxO set too bit on the L2. |
@ch1bo @Quantumplation
You can guarantee that your L2 snapshots are always closeable if your fan-out mechanism interprets snapshots as follows:
The continuation utxo allows the L2 parties to insert the L1-invalid utxos in the L2 ledger of a new Hydra Head instance, if they decide to launch one, via a special kind of commit (commit merkle tree). This would allow the L2 parties to recover from any L2 consensus breakdown without losing any L2 information, if they decide to communicate/cooperate again. Recovering the L1-invalid utxos in the new L2 ledger would allow the parties to convert some of those utxos into L1-valid utxos. Examples:
|
After considering this alongside other alternatives: #1468,, #190, we would rather aim for #1468. The main reason is that only signing L1-compatible snapshots is still an all-or-nothing approach that prevents applications which require partial departure from L1 compatibility, i.e. using very small UTxO values. Partial fanouts, on the other hand, allow individual recovery of UTxOs and would be much more flexible. We might want to consider the re-opening of heads ( i.e. your comment @GeorgeFlerovsky ) in a seperate feature. |
What & Why
We want Hydra Heads to be secure. This means that we can close & fan out the L2 state at any point throughout the life-cycle of a Hydra Head.
There are however some situations which make the Head "unclosable", because our validator would fail. For example, if assets are minted in a Hydra Head, the UTxO set including the new assets would not be closable because the L1 would require the minting policy to mint the same tokens, but that might not even make validate anymore at the point of closing the Head. Another example is the current limitation on the maximum number of UTxOs supported (#190), or the fact that Byron addresses are not visible to Plutus scripts.
Hence, the goal of this is that our
hydra-node
is not signing any transaction/snapshot which cannot be fanned out.As a consequence, if a user submits a transaction leading to such an unclosable UTxO, she will not se a
SnapshotConfirmed
message anymore. To notify clients about this more directly we want to have a server output when a snapshot was not signed because of an unclosable UTxO.Requirements
hydra-node
does not sign snapshots requests including transactions which arefanoutTx
that is invalid on the L1NewTx
client API are checked to be supported and a friendly warning is sent in case it makes the Head unclosableReqSn
was not signed because the head would be unclosableImplementation ideas
fanoutTx
Tasks
The text was updated successfully, but these errors were encountered: