Skip to content

Instantly share code, notes, and snippets.

@pavanjoshi914
Last active April 12, 2023 03:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavanjoshi914/e2c88bb2a85d1dbe44f3f37c6642e032 to your computer and use it in GitHub Desktop.
Save pavanjoshi914/e2c88bb2a85d1dbe44f3f37c6642e032 to your computer and use it in GitHub Desktop.

Proposal: Adding contentMetadata and contentMetadataUri Fields in PayerData for Lud-18

Abstract

The current PayerData record of LUD-18 only includes fields such as PayerId, PayerName, PayerEmail, and PayerAddress. However, there is no provision for including metadata about the content for which the payment is made. This lack of provision for content metadata can lead to a lack of clarity regarding the content being paid for. To address this issue, we propose to add two fields to the PayerData record, namely contentMetadata and contentMetadataUri.

By including the contentMetadata and contentMetadataUri fields in the PayerData record of LUD-18, LNURL-supported wallets can display information about the content being paid for to their users. This information can include details such as the content type, title, author, and any other relevant information. This can help users make informed decisions about the content they are paying for, and can also help content creators to promote their content more effectively. Additionally, this metadata can be used to facilitate content discovery, analytics of payment-sources and thus allowing users to search and filter content based on their preferences. Overall, the inclusion of contentMetadata and contentMetadataUri fields in LUD-18 can greatly enhance the user experience and improve the efficiency of payment processing.

Introduction:

LNURL is a widely adopted protocol for facilitating payments over the Lightning Network. It has enabled seamless and efficient payments for a variety of use cases. The payerData field is an essential component of the Lud-18 standard. However, the current Lud-18 standard does not include any fields to store information about the content for which the payment is being made. This information, known as content metadata, is important for tracking and analysing the different payment sources, give better user experience and a meaning to transaction history.

Objectives:

The primary objective of adding these new fields is to facilitate widespread adoption of LUD-18 and provide a more comprehensive and standardized way of tracking and analysing different payment sources, provider better user experience for transaction history. The proposed fields will enable LNURL supported wallets to store relevant metadata associated with the digital content for which the payment is made.

Proposal Details:

The proposed fields are as follows:

contentMetadata: This field will contain the metadata associated with the digital content for which the payment is made. The metadata could include information such as the title, author, publisher, date of publication, and other relevant details. Metadata is directly attached in the PayerData in form of JSON object

contentMetadataUri: This field will contain a URI that points to the location of the metadata associated with the digital content. This URI could be a link to an API endpoint, or any other location where the metadata is stored and can be retrieved from the Uri using a simgle GET request.

The reason for introducing two fields is to provide flexibility in how content metadata is managed and stored. Any of them or both the fields can be included.

The contentMetadata field will allow for direct association of metadata with the payment transaction, which can be useful in cases where the metadata is relatively small or the metadata changes frequently. On the other hand, the contentMetadataUri field will allow for referencing metadata stored externally, which can be useful in cases where the metadata is large or more complex, and requires a separate storage and management system

Implementation:

The content metadata can be included in the payerData field as a JSON object. The JSON object can contain different key-value pairs to represent various aspects of the content, such as title, description, author, genre, duration, format, and so on. The proposed fields, contentMetadata or contentMetadataUri, can be added to the JSON object to store the content metadata and the URI where the metadata can be accessed, respectively. The format of the JSON object remains same while using any of the field.

For example, the payerData field could contain the following JSON object:

"payerData": {
  "contentMetadata": {
    "title": "The Great Gatsby",
    "author": "F. Scott Fitzgerald",
    "genre": "Classic Literature",
    "duration": "5 hours",
    "format": "Audiobook",
    "language": "English"
  },

OR
  "contentMetadataUri": "https://example.com/great-gatsby-metadata.json"
}

Use Cases:

Adding content metadata to the payerData field can have several use cases. Some of them are:

  • Better Payment Management: By including content metadata, payment processors(wallets) can have better visibility into the nature of the content for which payments are being made. This can help in better payment management and creation of clean transaction history using filters

  • Improved User Experience: Users can benefit from having access to content metadata, as it provides additional information about the content they are paying for. This can help them make more informed decisions and enhance their overall experience.

  • Recommendation/Marketing: The content metadata can also be used for marketing purposes, such as promoting new releases, providing personalized recommendations, or creating targeted advertising campaigns.

  • Analytics: analysing different payment sources using content metadata to give better insights to the users about the payment a user is receiving

Conclusion:

The proposed addition of the contentMetadata and contentMetadataUri fields in the payerData field of the Lud-18 standard will provide a standardized and comprehensive way of tracking and analysing different payment sources giving more meaning to transaction history and many more. The inclusion of these fields will benefit content providers, payment processors, and end-users by providing improved tracking and a better user experience,

@rolznz
Copy link

rolznz commented Apr 7, 2023

In Proposal Details: the casing is wrong for ContentMetadata and ContentMetadataUri fields, could you make it match? Edit: also many fields in the abstract

@rolznz
Copy link

rolznz commented Apr 7, 2023

I believe LUD-18 is not currently well-adopted. Do you mean LNURL in general? we are hoping these changes will encourage LUD-18 adoption.

@rolznz
Copy link

rolznz commented Apr 7, 2023

"By including the contentMetadata and contentMetadataUri fields" - I think this should be "and/or" as either can be provided.

@rolznz
Copy link

rolznz commented Apr 7, 2023

I think you should mention the format of the content is the same, whether it is included in the contentMetadata or if it is accessible from a GET to the contentMetadataUri

@pavanjoshi914
Copy link
Author

made the required changes

@SiddheshKukade
Copy link

SiddheshKukade commented Apr 12, 2023

Hello @pavanjoshi914 Sir, I can see that there is already a metadata field available (before the payerData) which is of type string in LUD-18
Can we utilize that for storing payment metadata as a JSON string instead of creating a new property of contentMetadata?
image

/ cc @rolznz

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