Skip to content

Ability to add custom TLV to update_add_htlc message #6663

Description

@JssDWt

The LSPS2 specification requires the LSP to add a custom extra_fee TLV to the update_add_htlc message. An LSP run on top of CLN will intercept htlcs using the htlc_accepted hook. For some htlcs, LSP fees will be deducted from the outgoing amount, by modifying the onion payload.

  • It will modify the next hop id record (6)
  • It will modify the amount to forward record (2)
  • It has to add an extra_fee record. (65537)

I tried adding the extra_fee record to the returned payload in the htlc_accepted hook, but I get an error: Failing HTLC because of an invalid payload. I assume this is because the TLV is not recognized. The only option currently available appears to be to enable all unknown TLVs on the node, but that is not what I want.

Relevant section in LSPS2: https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/a1d8ca8439e730d6a097585f7e1d091f12f9afb0/LSPS2/README.md?plain=1#L950-L966

So: Add support for custom TLVs for the update_add_htlc message.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions