Skip to content

Allow custom data fields in the htlc payload #3670

@joostjager

Description

@joostjager

With the introduction of the new tlv payload format in lightning/bolts#619, it has become possible to deliver arbitrary data to intermediate hops and/or the final destination in a standardized way.

This enables several new use cases. Some examples:

  • When depositing into an exchange account, attach the account number to the final hop payload so the exchange knows where to credit the funds.
  • Send a chat message to the recipient and add IM capabilities to the Lightning Network

Most of the code that is required for this on the sender side was already added in #3362. In this PR, the rpc interface was extended to pass in a generic type-value map with a payment request.

However, this functionality was disabled in #3575 before the release of lnd 0.8. At the time, we wanted to take a bit more time to finalize the database serialization format. PR #3744 re-enables it again.

The receiver also needs to process custom records when they arrive. Custom data should be written to the invoice database and rpc clients should be able to query for it and/or receive it as part of the invoice notifications. PR #3742 is implementing this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    HTLCdatabaseRelated to the database/storage of LNDpaymentsRelated to invoices/payments

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions