* . *
  • About
  • Advertise
  • Privacy & Policy
  • Contact
Tuesday, November 4, 2025
Earth-News
  • Home
  • Business
  • Entertainment
    How do you spell success? ‘Spelling Bee’ lands at Surfside Playhouse – Florida Today

    How Do You Spell Success? Catch ‘Spelling Bee’ Live at Surfside Playhouse!

    Belmont Names Debbie Carroll Head of New Center for Mental Health in Entertainment – Billboard

    Debbie Carroll Named Leader of Groundbreaking New Center for Mental Health in Entertainment

    Call of Duty Movie’s Plot Setting Revealed in New Rumor – Yahoo

    Exciting New Rumor Reveals the Plot Setting of the Call of Duty Movie!

    Tybee Post Music Festival 2025 – Yahoo

    Get Ready to Rock: Tybee Post Music Festival 2025 is Almost Here!

    LIST: These movies from the 21st century take place in New Mexico – Yahoo

    Explore These Must-Watch 21st Century Movies Set in Stunning New Mexico

    Looking for things to do in the Corpus Christi area in November 2025? Check out our list. – Corpus Christi Caller-Times

    Top Things to Do in Corpus Christi This November 2025: Your Ultimate Guide

  • General
  • Health
  • News

    Cracking the Code: Why China’s Economic Challenges Aren’t Shaking Markets, Unlike America’s” – Bloomberg

    Trump’s Narrow Window to Spread the Truth About Harris

    Trump’s Narrow Window to Spread the Truth About Harris

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Science
  • Sports
  • Technology
    Rowland.ai Named Disruptive Technology of the Year by The Energy Council – GlobeNewswire

    Rowland.ai Named Disruptive Technology of the Year by Industry Leaders

    Peraton Honored As Silver Stevie® Award Winner in 2025 Stevie Awards for Technology Excellence – The AI Journal

    Peraton Honored As Silver Stevie® Award Winner in 2025 Stevie Awards for Technology Excellence – The AI Journal

    [News] China Makes Breakthrough in Chip Technology, Paving the Way for Lithography Advancements – TrendForce

    [News] China Makes Breakthrough in Chip Technology, Paving the Way for Lithography Advancements – TrendForce

    Can RFID technology solve the global medicine shortage crisis? – World Health Expo

    Can RFID technology solve the global medicine shortage crisis? – World Health Expo

    Strengthening hospital safety: The case for vape detection technology – Becker’s Hospital Review

    Enhancing Hospital Safety: Why Vape Detection Technology Is a Game Changer

    The Geopolitics of Energy: Technology, Trade and Power – The International Institute for Strategic Studies

    How Technology and Trade Are Redefining Global Energy Power Dynamics

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
  • Home
  • Business
  • Entertainment
    How do you spell success? ‘Spelling Bee’ lands at Surfside Playhouse – Florida Today

    How Do You Spell Success? Catch ‘Spelling Bee’ Live at Surfside Playhouse!

    Belmont Names Debbie Carroll Head of New Center for Mental Health in Entertainment – Billboard

    Debbie Carroll Named Leader of Groundbreaking New Center for Mental Health in Entertainment

    Call of Duty Movie’s Plot Setting Revealed in New Rumor – Yahoo

    Exciting New Rumor Reveals the Plot Setting of the Call of Duty Movie!

    Tybee Post Music Festival 2025 – Yahoo

    Get Ready to Rock: Tybee Post Music Festival 2025 is Almost Here!

    LIST: These movies from the 21st century take place in New Mexico – Yahoo

    Explore These Must-Watch 21st Century Movies Set in Stunning New Mexico

    Looking for things to do in the Corpus Christi area in November 2025? Check out our list. – Corpus Christi Caller-Times

    Top Things to Do in Corpus Christi This November 2025: Your Ultimate Guide

  • General
  • Health
  • News

    Cracking the Code: Why China’s Economic Challenges Aren’t Shaking Markets, Unlike America’s” – Bloomberg

    Trump’s Narrow Window to Spread the Truth About Harris

    Trump’s Narrow Window to Spread the Truth About Harris

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Science
  • Sports
  • Technology
    Rowland.ai Named Disruptive Technology of the Year by The Energy Council – GlobeNewswire

    Rowland.ai Named Disruptive Technology of the Year by Industry Leaders

    Peraton Honored As Silver Stevie® Award Winner in 2025 Stevie Awards for Technology Excellence – The AI Journal

    Peraton Honored As Silver Stevie® Award Winner in 2025 Stevie Awards for Technology Excellence – The AI Journal

    [News] China Makes Breakthrough in Chip Technology, Paving the Way for Lithography Advancements – TrendForce

    [News] China Makes Breakthrough in Chip Technology, Paving the Way for Lithography Advancements – TrendForce

    Can RFID technology solve the global medicine shortage crisis? – World Health Expo

    Can RFID technology solve the global medicine shortage crisis? – World Health Expo

    Strengthening hospital safety: The case for vape detection technology – Becker’s Hospital Review

    Enhancing Hospital Safety: Why Vape Detection Technology Is a Game Changer

    The Geopolitics of Energy: Technology, Trade and Power – The International Institute for Strategic Studies

    How Technology and Trade Are Redefining Global Energy Power Dynamics

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
Earth-News
No Result
View All Result
Home Technology

L402: The Missing Piece in the Internet’s Payment Infrastructure

July 15, 2024
in Technology
L402: The Missing Piece in the Internet’s Payment Infrastructure
Share on FacebookShare on Twitter

L402 is an open protocol that implements internet-native paywalls by building upon the HTTP 402 Payment Required status code and the Lightning Network.

Live demo

New Monetization Models

Unlocks new revenue streams by enabling micropayments, pay-per-use and granular access control models.

Open and Extensible

L402’s open protocol encourages innovation and wide adoption across industries, fostering a thriving ecosystem of applications and services.

Language agnostic

L402’s design is universally compatible, ensuring seamless integration across various programming environments and platforms.

Native Digital Payments

Integrates with the Lightning Network for instant, low-cost transactions, perfect for API monetization and digital services.

Granular Access Control

Leveraging macaroons, L402 enables fine-grained access control and secure token management for enhanced security and flexibility.

AI-Friendly Protocol

Built on HTTP, the Lightning Network, and Macaroons, L402 provides a machine-friendly scheme perfect for AI applications and automated systems.

sequenceDiagram
participant Client
participant Server
Client->>Server: Request access to HTTP resource
Server–>Server: Check client credentials (invalid)
Server–>Server: Generate challenge (macaroon + invoice)
Server–>>Client: Return HTTP 402 status code & challenge
Client->>Client: Complete challenge & obtain preimage
Client->>Server: Request access L402 Authentication header (macaroon + preimage)
Server->>Server: Verify credentials and proof of completion for the linked challenge
Server–>>Client: Serve the requested resource

Server: Challenge Details

Before processing a request to a protected endpoint, the server issues an L402 challenge by returning a 402 Payment Required HTTP response with the challenge details encoded in a response header.

The challenge includes a macaroon (a token granting specific permissions) and a Lightning Network invoice.

macaroon=”MDAzNmxvY2F0aW9uIGh0dHBzOi8vbHNhdC1wbGF5Z3Jv…”
invoice=”lnbc12340n1pny96vwpp5hc4l9wl8ze9jajratkzuxa5…”

challenge=”L402 macaroon=”{macaroon}” invoice=”{invoice}”

# The challenge is returned in the response headers
response.headers[‘WWW-Authenticate’]=challenge

Client: Authentication Header

Upon receiving an HTTP 402 Payment Required status, the client extracts the macaroon and Lightning invoice from the challenge.

The client then pays the Lightning invoice and obtains the preimage. Using the macaroon and preimage, the client constructs an authenticated request to the server, which will now be processed since the client has completed the required payment and authentication steps.

# Client prepares the authentication header with the
# macaroon and preimage
challenge=response.headers[‘WWW-Authenticate’]
macaroon, invoice=parse_challenge(challenge)

# Pay the lightning invoice to receive the preimage
preimage=pay_invoice(invoice)
auth_header=f”L402 {macaroon}:{preimage}”

# Client sends a request with the authentication header
headers={‘Authorization’: f”L402 {macaroon}:{preimage}”}
requests.get(url, headers=headers)

Macaroons

Macaroons are a crucial component of the L402 protocol, providing a secure and flexible way to manage client permissions.

They are bearer tokens that contain caveats, which specify the constraints and limitations of the token. In the context of L402, macaroons are used to grant access to specific resources or services based on the client’s payment.

The server generates a macaroon with the appropriate caveats, such as an expiration time or scope limitations, and includes it in the challenge header.

# URL where the credentials can be used
location=”fewsats.com”
version=0
payment_hash=”35cf3da4dfdefa01a3859659d447eb2eeb070c9c6610f4…”
token_id=”7133548b39c094b83120052b10685d7cc5…”

# The identifier needs to be encoded as bytes
identifier=encode_id(version, payment_hash, token_id)

# The caveats can be used to add constraints to the macaroon
caveats=[
“expires_at=2024-06-14T01:38:46Z”
]

macaroon=create_macaroon(identifier, location, caveats)

print(macaroon.encode())
# AgELZmV3c2F0cy5jb20CQgAANc89pN/e+gG…

print(macaroon.json())
# {
# “ID”: “000035cf3da4dfdefa01a385965…”,
# “version”: 0,
# “payment_hash”: “35cf3da4dfdefa01a385965…”,
# “token_id”: “7133548b39c094b83120052b106…”,
# “location”: “fewsats.com”,
# “caveats”: [
# “expires_at=2024-06-14T01:38:46Z”
# ]
# }

>>> Read full article>>>
Copyright for syndicated content belongs to the linked Source : Hacker News – https://l402.org/

Tags: MissingPiecetechnology
Previous Post

Show HN: Mutable.ai Codebase chat that uses a Wiki for RAG

Next Post

SC Capital’s Japan Hotel REIT Seals $350M in Buys and More Asia Real Estate Headlines

Beyond AI Futurism: A Socio-Ecological Vision for AI – resilience.org

Beyond AI Futurism: Envisioning a Socio-Ecological Future for Artificial Intelligence

November 4, 2025
Why the for-profit race into solar geoengineering is bad for science and public trust – MIT Technology Review

The Dangerous Rush into For-Profit Solar Geoengineering: Threats to Science and Public Trust

November 4, 2025
Is sushi bad for you or secretly healthy? Experts reveal what science says – The Times of India

Is Sushi Harmful or Surprisingly Healthy? Experts Uncover the Science-Backed Truth

November 4, 2025
7 little signs you actually grew up rich in the 90s (even if you didn’t realize it) – VegOut

7 little signs you actually grew up rich in the 90s (even if you didn’t realize it) – VegOut

November 4, 2025
Rowland.ai Named Disruptive Technology of the Year by The Energy Council – GlobeNewswire

Rowland.ai Named Disruptive Technology of the Year by Industry Leaders

November 4, 2025
Hornets Partner With FanDuel Sports Network, WSOC-TV Channel 9, TV 64 And Gray Media To Simulcast 12 Games During 2025-26 Season – NBA

Hornets Partner with FanDuel Sports Network and Local Channels to Bring 12 Thrilling Games Live in the 2025-26 Season

November 4, 2025
Dodgers’ World Series victory scores 26 million viewers on Fox – Los Angeles Times

Dodgers’ World Series Victory Captivates a Staggering 26 Million Viewers

November 4, 2025
Japan PM Takaichi launches economic HQ, gears up public investments – Reuters

Japan’s PM Takaichi Unveils New Economic HQ, Accelerates Public Investment Drive

November 4, 2025
How do you spell success? ‘Spelling Bee’ lands at Surfside Playhouse – Florida Today

How Do You Spell Success? Catch ‘Spelling Bee’ Live at Surfside Playhouse!

November 4, 2025
What the government shutdown means for food aid and public health – KPBS

The Government Shutdown’s Hidden Toll on Food Aid and Public Health

November 4, 2025

Categories

Archives

November 2025
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
« Oct    
Earth-News.info

The Earth News is an independent English-language daily published Website from all around the World News

Browse by Category

  • Business (20,132)
  • Ecology (902)
  • Economy (923)
  • Entertainment (21,795)
  • General (17,988)
  • Health (9,964)
  • Lifestyle (936)
  • News (22,149)
  • People (925)
  • Politics (934)
  • Science (16,135)
  • Sports (21,424)
  • Technology (15,904)
  • World (907)

Recent News

Beyond AI Futurism: A Socio-Ecological Vision for AI – resilience.org

Beyond AI Futurism: Envisioning a Socio-Ecological Future for Artificial Intelligence

November 4, 2025
Why the for-profit race into solar geoengineering is bad for science and public trust – MIT Technology Review

The Dangerous Rush into For-Profit Solar Geoengineering: Threats to Science and Public Trust

November 4, 2025
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2023 earth-news.info

No Result
View All Result

© 2023 earth-news.info

No Result
View All Result

© 2023 earth-news.info

Go to mobile version