-
Notifications
You must be signed in to change notification settings - Fork 22
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
Flash layer: Implement path-finding algorithm #1528
Comments
Since currently the flash layer is WIP, there are still some parts missing:
But we can still proceed with research and even prototyping. You can think of the necessary data structures as being the following: struct Channel
{
// fee paid for routing through this specific channel
Amount fee;
// total capacity is owner_amount + dest_amount
Amount owner_amount;
Amount dest_amount;
Hash owner;
Hash dest;
}
struct FlashNode
{
Channel[Hash] known_channels;
} Then, consider an example channel layout:
If
Hopefully I'll finish #1419 soon and the actual data structures will be there for you to use. |
What does |
They are the current balances. Initially there is only one output which spends back to the founder. |
How does a node know the latest distribution of all the channels though? Would not that need every payment to be public and gossiped? Quoting the resources you posted here;
Or am I missing something? |
Yeah that's part of the problem. We only know the capacity for sure, but not necessarily the balance. So if we do have any balance information, it may not be up to date. Maybe the only thing we can do is attempt one path, and if there is not enough balance for a node to forward a payment then try a different path.. |
struct Channel
{
// fee paid for routing through this specific channel
Amount fee;
// total capacity is owner_amount + dest_amount
Amount owner_amount;
Amount dest_amount;
Hash owner;
Hash dest;
} Apparently, owner and dest nodes can request different amount of fees for routing a payment through the channel. So this structure would not quite work. See https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#routing-example |
Yeah I haven't gotten around to tackling fees yet. |
There are several well-known path-finding algorithms with 100% success rate (but may not be the most efficient).
This is a good starting point: https://medium.com/@renepickhardt/evaluating-path-finding-strategies-on-the-lightning-network-238fe2fdf3d6
Some of the algorithms mentioned are:
Please also consult this book for useful information (and also other chapters):
The text was updated successfully, but these errors were encountered: