input-output-hk / hydra

Implementation of the Hydra Head protocol
https://hydra.family/head-protocol/
Apache License 2.0
264 stars 86 forks source link

Allow committing internal wallet utxos #1442

Closed errfrom closed 3 weeks ago

errfrom commented 1 month ago

Why

The requirement that no internal wallet utxo should be committed to the head may be too restrictive for some use cases. For instance, hydra-node operators may need to provide some (ADA-only) utxos to serve as collateral and to cover utxo min ADA in L2 transactions.

In https://github.com/mlabs-haskell/hydra-auction-offchain, to bypass this restriction, we prepare 2 separate Cardano wallets, one of which is passed to hydra-node for internal operations and the other is used solely to provide collateral utxo, which results in more configuration and therefore more complexity.

What

One potential solution to the issue described above would be to make the "no internal wallet utxo" check less restrictive by preventing committing the last utxo into the head or checking that the total amount of ADA after committing remains above some estimated threshold necessary for subsequent Close, Contest, and Fanout transactions. However, it would still be possible to spend hydra-node utxos externally, rendering the check ineffective.

How

Based on the above considerations, it seems reasonable to completely remove the SpendingNodeUtxoForbidden requirement and shift the responsibility for maintaining enough fuel for Hydra operations to the users.