lightningdevkit / ldk-node

A ready-to-go node implementation built using LDK.
Other
140 stars 71 forks source link

Allow to set node alias #304

Open tnull opened 2 months ago

tnull commented 2 months ago

We should add a Config field allowing to set the alias a node would use in its announcement.

For bindings, we'll need to make this a Vec<u8>. We could consider making this an Option<Vec<u8>> and refuse to a) open public channels if it's unset b) startup with public channels if it's unset or doesn't fit in the [u8; 32].

enigbe commented 1 month ago

Hi @tnull, I'd like to pick this up if no one is currently assigned to or working on it.

tnull commented 1 month ago

Hi @tnull, I'd like to pick this up if no one is currently assigned to or working on it.

Cool! Sure, go for it!

Note that in contrary to what I wrote above, we may want to expose this as an Option<String> and make sure we sanitize it before setting the alias. This will of course take away some degrees of freedom from our users, but also incentivize not to set some bogus/dangerous aliases that might be parsed wrongly by other network participants.

Moreover, we might want to consider only broadcasting node announcements if both the node alias and valid (public) socket addresses are set.

enigbe commented 1 month ago

Hi @tnull, I have a draft PR ready for a cursory look. I am still figuring out how binding generation works but didn't want that to hold up progress especially if you disagree with the direction this is taking. Please share some feedback when you can.