Skip to content

Lightning Monetization meta tag

Moritz Kaminski edited this page Feb 15, 2022 · 2 revisions

Lightning Meta Tag

The Lightning meta tag gives websites a way to receive direct payments from their visitors. It allows websites to describe how and where they would like to receive payments. Utilizing the open Lightning Network protocol payments can be sent in real-time from the visitor to the creator without the need for a third-party.

The goals is to bring the #value4value ideas to the web and make value4value transactions possible on any website.

What is value4value?

The value for value system is a way for content creators to receive direct payments from consumers. Consumers can reward creators by sending payments based on their perceived value of the content. The concept originated from the podcasting world but can be applied to any digital content.

Thanks to the open nature of the Lightning Network protocol value can be transferred directly from the consumer to the creator without the need to rely on a third-party.

Specification

Websites can specify one or more Lightning meta tags.

Meta tag format

The metadata name attribute must be set to lightning.

The metadata content attribute contains data as key-value pairs separated by a semi-colon and, optionally, a space for legibility. The value may or may not be wrapped in double- or single-inverted commas, which should be removed from the value if found at the beginning and end of the value.

Possible attributes

  • lnurlp: LNURL-pay URL or internet identifier.
  • keysend: The destination's node pubkey
  • bolt11: A bolt11 invoice
  • bolt12: A bolt12 offer
  • suggested: The suggested amount in Satoshi

Extensibility

As the standard evolves more attributes might be added in the future.

Examples

Receive payments through an LNURL-pay specified lightning address with a suggested amount of 100 Satoshi.

<meta name="lightning" content="lnurlp=your@lightning.address; suggested=100;">

Receive payments through keysend payments with a suggested amount of 100 Satoshi.

<meta name="lightning" content="keysend=0235s1df8b244dc91adclo8d1b1a3cp7fue31cee4r7e819e15bef9174d31d07154; suggested=100;">

Receive payments through a bolt11 invoice

<meta name="lightning" content="bolt11=lnbc100n13qjf26pp5k2zpzvnahqesv9xnk5sgfuxc7v9r0y4hvh86vx8lnqmupz74e6sqhp">

Payment notifications

JavaScript events can be triggered for successful payment notifications.

Events are triggered as CustomEvent and can contain lightning payment details in the detail event property:

{
  preimage: string
}

Example

document.addEventListener('lightning:transaction', function (event) {
  console.log(event.type);
  console.log(event.detail);
  console.log(event.detail.preimage);
});
Clone this wiki locally