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

Non-initiator channels #8093

Open
ecdsa opened this issue Dec 6, 2022 · 3 comments
Open

Non-initiator channels #8093

ecdsa opened this issue Dec 6, 2022 · 3 comments

Comments

@ecdsa
Copy link
Member

ecdsa commented Dec 6, 2022

One of the reasons why we do not accept channels initiated by a remote node, is we want to be able to recover a backup from seed. Client-initiated channels funding transactions have an OP_RETURN that contains the encrypted remote node_id. However, allowing remote parties to open channels to us would have major usability advantages (see phoenix).

Here is a suggestion: Assume the channel opener creates an OP_RETURN output, that contains our encrypted node_id. Assume that we know how the encrypted node_id looks like, without knowing the remote node_id (encryption can be performed with a nonce that we give to the remote during the negotiation phase).

If we subscribe to the corresponding scripthash, then we can learn about the existence of this channel, without being the initiator. The only thing we need is the remote node_id, in order to contact them. That node_id could be encoded in another OP_RETURN, like we do currently.

This requires a modification of the channel negotiation protocol, but it potentially allows any party to open a recoverable channel to us.

@SomberNight
Copy link
Member

SomberNight commented Dec 10, 2022

Several remarks:

@SomberNight
Copy link
Member

  • also note that if we use tx_add_output, we need to pay for those outputs by adding an input of our own

Note that if we need to add our own input anyway, then the marker OP_RETURN is not needed.
We can simply tx_add_output the OP_RETURN we are already adding (encoding the first 16 bytes of the remote node id) and add a UTXO of our own (, and likely add another tx_add_output for a change output). When restoring from seed we will find the funding tx in the onchain history because of having contributed an input.

But again, this assumes that nodes implementing channel v2 will allow adding an OP_RETURN output.

@ecdsa
Copy link
Member Author

ecdsa commented Dec 13, 2022

Thanks for the clarification.

Keep in mind that the main UX reason to support non-initiator channels is to let users receive LN payments on startup, when their wallet does not have any coins. In that scenario it is not possible to contribute an input to the funding transaction.

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

No branches or pull requests

2 participants