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

Provide onchain UTXOs early (swap_in_request and swap_out_agreement) for early abort #11

Open
ZmnSCPxj-jr opened this issue Oct 15, 2022 · 0 comments

Comments

@ZmnSCPxj-jr
Copy link

ZmnSCPxj-jr commented Oct 15, 2022

In some cases, a node offering peerswap services may be located or under a jurisdiction which legally requires sanctioning particular UTXos or addresses. Such a node would, with the current protocol, reject such UTXOs "late", i.e. when the transaction spending such a UTXO has already been spent into the onchain HTLC, thus forcing the onchain HTLC maker to use an expensive funds recovery on abort.

By adding a list of UTXOs in the swap_in_request and swap_out_agreement, the receiver of the onchain funds can inspect the UTXOs before the onchain HTLC is instantiated. So while it has to still reject the swap, at least the rejection is "early", before the sender of the onchain HTLC has created and broadcasted a transaction that spends those UTXOs.

My proposal is to add an array of strings (if using JSON format still) or a variable-length field, planned_utxos, to both swap_in_request and swap_out_agreement.

The receiver of swap_in_request or swap_out_agreement would have:

  • MUST check that all planned_utxos are not UTXOs it cannot legally accept, if the receiver is in a jurisdiction that imposes legal sanctions on particular UTXOs.

Then, in the section "Doing the Swap", for the receiver of the opening_tx_broadcast message, we would add the clause:

  • MUST check that the transaction spends exactly the planned_utxos from the previous swap_in_request or swap_out_agreement. The transaction inputs MUST be validated in the same order as planned_utxos.

This feature affects forwardable peerswaps. If the node you are forwarding to is in a jurisdiction that requires legal sanctioning of particular UTXOs, then it is best to ask them early so you have an opportunity to select a different next hop that might accept the proposed UTXOs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant