connext / indra

[LEGACY] Monorepo containing everything related to the core Connext protocols and network.
MIT License
84 stars 38 forks source link

Allow client to pay for gas #1120

Open kilrau opened 4 years ago

kilrau commented 4 years ago

Is your feature request related to a problem? Please describe. Follow-up of https://github.com/connext/indra/issues/27: we'd want the client to be able to pay for gas costs of collateralization.

Describe the solution you'd like Node communicates that re-collateralization is necessary and the fee, client can choose to proceed (accept) or not, sends payment. Node keeps fee when forwarding payment.

Describe alternatives you've considered No alternatives.

Additional context Some thought should also be put in to evaluate if this can be used in a multi-hop future for intermediate forwarding nodes to keep a forwarding fee in lightning-style.

LayneHaber commented 4 years ago

Hmm well I guess this is technically possible with fairly minimal changes. First pass at the flow:

  1. Node prepares a meta transaction to the multisig
  2. Node requests + gains deposit rights, including the meta tx in the deposit application meta
  3. Node sets up listener to watch multisig for deposit
  4. Client emits the INSTALL_EVENT, which includes the metatx
  5. XUD application has code to submit the deposit to the multisig from the users wallet
  6. Node finds tx and removes listener, then rescinds deposit rights

The tasks on our end for this would look like:

Alternatively, we could bake this into the fee structure (see #1139 )