ElementsProject / ElementsProject/peerswap-spec

send a signature instead of a private key for cooperative closes

Open
#4 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
6
Forks
3
PR merge metrics
No merged PRs in 30d

Description

It seems odd at first that the `coop_close` message (sent by the swap taker) contains a private key.

This *should* be safe because the swap taker must create a random private key for each swap (not derived from an HD wallet). This simplifies the protocol because the swap maker can create the `claim_by_coop` transaction immediately without further communication with the swap taker.

An alternative approach would be for the swap taker to send a signature signed with `SIGHASH_NONE | ANYONECANPAY`. With this approach, the swap taker would not have to create a random private key for each swap, but could safely use an xpub scheme to derive their key. This could simplify backups because they do not need to synchronously backup a random private key for each swap; a derived key can be restored by iterating a predefined xpub branch. On the other hand, if the taker loses the `` or `` of a swap, it won't matter if they can recover their private key. The taker must always back up some information for each swap.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.