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

Sign snapshots including the initial UTxO set #688

Closed
ch1bo opened this issue Jan 31, 2023 · 2 comments
Closed

Sign snapshots including the initial UTxO set #688

ch1bo opened this issue Jan 31, 2023 · 2 comments
Labels
amber ⚠️ Medium complexity or partly unclear feature L1 Affects the on-chain protocol of Hydra 💬 feature A feature on our roadmap superseded An item that may get superseded by related feature.

Comments

@ch1bo
Copy link
Collaborator

ch1bo commented Jan 31, 2023

Why

Users would like to have their funds not be locked up and be inaccessible, even if a rollback past the "opening" happens.

When a Head is open and snapshots have been signed, but then a collectCom and one or more commit transactions were rolled back, a bad actor could choose to commit a different UTxO and open the Head with a different initial UTxO set, while the already signed snapshots would still be (cryptographically) valid. This is problematic as the old snapshots would still be valid to close the head with a not agreed or even invalid (= not fanoutable) UTxO set.

To mitigate this, all signatures on snapshots need to incorporate the initial UTxO set by including η0.

What

  • Replays of snapshots are prevented
  • Specifically this scenario is avoided:
    • Open a head with two commits
    • Do some transactions, such that a snapshot S1 is created
    • Rollback the collectCom and one of the commit transactions
    • Redo (by adversary) the commit transaction with a different UTxO
    • Redo (by adversary) the collectCom transaction
    • Closing the head with snapshot S1 should not be possible, but right now it would
    • Fanout will be impossible as the UTxO to fanout is not in the Head

How

  • Signing a snapshot should incorporate
    • its snapshot number,
    • its utxo hash
    • the original utxo hash (η0 a.k.a. H(U0))
  • Keep the η0 around in the datum to be able to check the signature on-chain
  • For writing an acceptance test, we need a test suite which can instrument rollbacks, but also see a transaction be invalid because the close validator does not accept the old signature

Context

https://nvd.nist.gov/vuln-metrics/cvss/v2-calculator?vector=(AV:L/AC:H/Au:M/C:N/I:P/A:C/E:U/RL:ND/RC:ND/CDP:L/TD:L/CR:ND/IR:ND/AR:ND)

@ch1bo ch1bo changed the title Sign snapshots including the original H(u_0) Sign snapshots including the initial UTxO set Jan 31, 2023
@ch1bo ch1bo added 💬 feature A feature on our roadmap amber ⚠️ Medium complexity or partly unclear feature labels Jan 31, 2023
@ch1bo ch1bo added this to the Mainnet milestone Feb 9, 2023
@ch1bo ch1bo removed this from the 0.10.0 milestone Mar 21, 2023
@ch1bo ch1bo added the L1 Affects the on-chain protocol of Hydra label Jun 20, 2023
@ch1bo ch1bo modified the milestone: 0.12.0 Jun 21, 2023
@ch1bo ch1bo mentioned this issue Nov 16, 2023
16 tasks
@ch1bo
Copy link
Collaborator Author

ch1bo commented Mar 27, 2024

It seems like #199 and #1057 will include this.

@ch1bo
Copy link
Collaborator Author

ch1bo commented Jul 29, 2024

As we are shooting for #1329 and #199 is versioning open head states, referencing the collected utxo hash (U0) is not required anymore -> superseded.

@ch1bo ch1bo closed this as not planned Won't fix, can't repro, duplicate, stale Jul 29, 2024
@ch1bo ch1bo added the superseded An item that may get superseded by related feature. label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
amber ⚠️ Medium complexity or partly unclear feature L1 Affects the on-chain protocol of Hydra 💬 feature A feature on our roadmap superseded An item that may get superseded by related feature.
Projects
Archived in project
Development

No branches or pull requests

1 participant