* . *
  • About
  • Advertise
  • Privacy & Policy
  • Contact
Friday, September 19, 2025
Earth-News
  • Home
  • Business
  • Entertainment
    Congress Bill Spotlight: Make Entertainment Great Again (MEGA) Act, Renaming Kennedy Center to Trump Center – The Fulcrum

    Congress Proposes MEGA Act to Rename Kennedy Center as Trump Center and Revitalize Entertainment

    Massive Attack Say They’ll Remove Music From Spotify – yahoo.com

    Massive Attack Announces Plans to Pull Their Music from Spotify

    REO to return for UI homecoming – The News-Gazette

    REO Gears Up to Ignite the Stage at UI Homecoming Celebration!

    Gen V Season 2: What is The Odessa Project? – yahoo.com

    Gen V Season 2: Unlocking the Secrets of The Odessa Project

    PENN Entertainment stock rating reiterated at Market Outperform by JMP – Investing.com

    PENN Entertainment Stock Rated a Market Outperformer by Experts

    Here’s how NJ’s once-vibrant nightclub scene was born and why it died – Bergen Record

    The Rise and Fall of New Jersey’s Once-Vibrant Nightclub Scene: What Happened?

  • 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
    Huawei Unveils New AI Chip Tech to Challenge Nvidia’s Lead – Bloomberg.com

    Huawei Unveils New AI Chip Tech to Challenge Nvidia’s Lead – Bloomberg.com

    China says US TikTok deal a ‘win-win’, will review app’s technology and IP transfers – Reuters

    China Hails US TikTok Deal as a ‘Win-Win’ While Launching Review of App’s Technology and IP Transfers

    Bucking the Odds: Why Technology Companies Should Embrace Software Patents Today – Crowell & Moring LLP

    Bucking the Odds: Why Technology Companies Should Embrace Software Patents Today – Crowell & Moring LLP

    City IT presented Best of North Carolina Technology Award – RaleighNC.gov

    City IT Honored with Best of North Carolina Technology Award

    LELO Releases 2025 Futurist Report: Intergenerational Views on Relationships, Sex, and Technology – PR Newswire

    Exploring the Future: How Different Generations View Relationships, Sex, and Technology in 2025

    Will New Big Technology Engagements Reshape Innodata’s Growth Path? – Yahoo Finance

    Could New Major Tech Partnerships Propel Innodata to Unprecedented Growth?

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
  • Home
  • Business
  • Entertainment
    Congress Bill Spotlight: Make Entertainment Great Again (MEGA) Act, Renaming Kennedy Center to Trump Center – The Fulcrum

    Congress Proposes MEGA Act to Rename Kennedy Center as Trump Center and Revitalize Entertainment

    Massive Attack Say They’ll Remove Music From Spotify – yahoo.com

    Massive Attack Announces Plans to Pull Their Music from Spotify

    REO to return for UI homecoming – The News-Gazette

    REO Gears Up to Ignite the Stage at UI Homecoming Celebration!

    Gen V Season 2: What is The Odessa Project? – yahoo.com

    Gen V Season 2: Unlocking the Secrets of The Odessa Project

    PENN Entertainment stock rating reiterated at Market Outperform by JMP – Investing.com

    PENN Entertainment Stock Rated a Market Outperformer by Experts

    Here’s how NJ’s once-vibrant nightclub scene was born and why it died – Bergen Record

    The Rise and Fall of New Jersey’s Once-Vibrant Nightclub Scene: What Happened?

  • 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
    Huawei Unveils New AI Chip Tech to Challenge Nvidia’s Lead – Bloomberg.com

    Huawei Unveils New AI Chip Tech to Challenge Nvidia’s Lead – Bloomberg.com

    China says US TikTok deal a ‘win-win’, will review app’s technology and IP transfers – Reuters

    China Hails US TikTok Deal as a ‘Win-Win’ While Launching Review of App’s Technology and IP Transfers

    Bucking the Odds: Why Technology Companies Should Embrace Software Patents Today – Crowell & Moring LLP

    Bucking the Odds: Why Technology Companies Should Embrace Software Patents Today – Crowell & Moring LLP

    City IT presented Best of North Carolina Technology Award – RaleighNC.gov

    City IT Honored with Best of North Carolina Technology Award

    LELO Releases 2025 Futurist Report: Intergenerational Views on Relationships, Sex, and Technology – PR Newswire

    Exploring the Future: How Different Generations View Relationships, Sex, and Technology in 2025

    Will New Big Technology Engagements Reshape Innodata’s Growth Path? – Yahoo Finance

    Could New Major Tech Partnerships Propel Innodata to Unprecedented Growth?

    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

Scientists say they’ve found the world’s oldest mummies, and they’re far from Egypt – NBC News

Scientists say they’ve found the world’s oldest mummies, and they’re far from Egypt – NBC News

September 19, 2025
The growing chasm between MAGA and non-MAGA Republicans on Trump’s economy – Axios

The growing chasm between MAGA and non-MAGA Republicans on Trump’s economy – Axios

September 19, 2025
Congress Bill Spotlight: Make Entertainment Great Again (MEGA) Act, Renaming Kennedy Center to Trump Center – The Fulcrum

Congress Proposes MEGA Act to Rename Kennedy Center as Trump Center and Revitalize Entertainment

September 19, 2025
CHOP researchers unveil framework for boosting children’s oral health – News-Medical

Revolutionary New Framework Set to Transform Children’s Oral Health

September 19, 2025
‘We will not allow politics or outside forces to rewrite the story of Wisconsin’s public schools’: Underly delivers her fifth State of Education Address – Spectrum News

Underly Pledges to Shield Wisconsin’s Public Schools from Political Interference in Impactful Education Speech

September 19, 2025
Simons Collaborations in Ecology and Evolution – Simons Foundation

Innovative Breakthroughs in Ecology and Evolution Through Collaborative Research

September 19, 2025
Michigan Science Center’s vertical wind tunnel demonstration – CBS News

Experience the Thrill of Michigan Science Center’s Vertical Wind Tunnel Demonstration!

September 19, 2025
Roane State and TCAT Knoxville celebrate ‘Countdown to Grand Opening’ for Knox Regional Health Science Education Center – WVLT

Roane State and TCAT Knoxville Kick Off Exciting Countdown to Grand Opening of Knox Regional Health Science Education Center

September 19, 2025
Huawei Unveils New AI Chip Tech to Challenge Nvidia’s Lead – Bloomberg.com

Huawei Unveils New AI Chip Tech to Challenge Nvidia’s Lead – Bloomberg.com

September 19, 2025
Klutch Sports Group Signs Maria Taylor – Variety

Klutch Sports Group Scores Big with Star Broadcaster Maria Taylor Joining the Team

September 18, 2025

Categories

Archives

September 2025
MTWTFSS
1234567
891011121314
15161718192021
22232425262728
2930 
« Aug    
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 (826)
  • Economy (846)
  • Entertainment (21,725)
  • General (17,118)
  • Health (9,891)
  • Lifestyle (859)
  • News (22,149)
  • People (850)
  • Politics (856)
  • Science (16,056)
  • Sports (21,345)
  • Technology (15,828)
  • World (830)

Recent News

Scientists say they’ve found the world’s oldest mummies, and they’re far from Egypt – NBC News

Scientists say they’ve found the world’s oldest mummies, and they’re far from Egypt – NBC News

September 19, 2025
The growing chasm between MAGA and non-MAGA Republicans on Trump’s economy – Axios

The growing chasm between MAGA and non-MAGA Republicans on Trump’s economy – Axios

September 19, 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