Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
lnrpc+lncli: add send support for custom data records #3900
With the introduction of custom record sending and receiving, it became possible to attach arbitrary data to a payment. One obvious use case is attaching a human-readable message to a payment. Especially in the case of spontaneous key send payments, this can give the receiver some context on the payment.
For example: tipping. Usually people sending a tip would want to include some information on who they are or what the tip is for. For Lightning this may be even more desired than for other payment methods, because payments are anonymous by default.
Attaching and retrieving the message was already possible before, but this PR makes it easier to do so by introducing an additional
To specify a string value, the standard command line tool
Note: The available onion blob space of 1300 bytes is used for routing info and custom records. The bigger the size of the custom records, the fewer bytes remain for routing info and the shorter the maximum route length will be.
cfromknecht left a comment
I'm not convinced this should happen within lnd until there is some actual standardization, especially a field that knowingly collides with whatsat.
Message record id updated to a different random number.
My thought was that if we don't pick a field and provide a few hooks to make it easy to use (string flag on lncli and string type invoice htlc field), payment messages are less likely to be used. The payment message functionality can serve as a demonstrator of everything else that is possible using custom records. it seemed nice to me to get people thinking about that.
But as @Roasbeef suggests, we can also generalize this to just a new
It gets complicated with the spaces and special chars. Also not sure what different shells do there. In my bash, at least the data argument comes through as one block, but the quotes have disappeared.