Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

feat: add ldk custom tlvs to metadata custom records #445

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

rolznz
Copy link
Collaborator

@rolznz rolznz commented Jun 14, 2024

This enables NWC apps that display transactions to show podcasting 2.0 details

See getAlby/lightning-browser-extension#3172 for how it is consumed.

Note: this is inconsistent with how the TLVs are passed in https://github.com/nostr-protocol/nips/blob/master/47.md#pay_keysend

In retrospect I think this should actually be changed to be metadata.tlv_records and have the same format as pay_keysend

for _, tlv := range spontaneousPaymentKind.CustomTlvs {
customRecords[strconv.FormatUint(tlv.Type, 10)] = b64.StdEncoding.EncodeToString(tlv.Value)
}
metadata["custom_records"] = customRecords
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering if we should put it in custom_records or on the root level?

in custom_records it's more clear but at the same time more technical?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be under custom_records. It's already technical because all the keys are random numbers 😅

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about we call it tlv_records - then it is more consistent with the pay_keysend nip?

@bumi
Copy link

bumi commented Jun 14, 2024

@im-adithya can you do the same for LND - if the transaction in LND has custom records add those to the metadata field.

@rolznz
Copy link
Collaborator Author

rolznz commented Jun 14, 2024

@im-adithya can you do the same for LND - if the transaction in LND has custom records add those to the metadata field.

Issue here: getAlby/hub#60

@bumi bumi merged commit 65f334b into master Jun 14, 2024
7 checks passed
@bumi bumi deleted the feat/ldk-read-custom-tlvs branch June 14, 2024 16:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants