* . *
  • About
  • Advertise
  • Privacy & Policy
  • Contact
Sunday, June 8, 2025
Earth-News
  • Home
  • Business
  • Entertainment
    Ceramic Dalmatian Entertainment is WLAF’s Business of the Week – WLAF

    Spotlight on Success: Ceramic Dalmatian Entertainment Shines as This Week’s Featured Business!

    Brass Lion Entertainment unveils co-op action RPG Wu-Tang: Rise of the Deceiver – VentureBeat

    Unleash Your Inner Warrior: Discover the Co-Op Action RPG Wu-Tang: Rise of the Deceiver!

    Entertainment lineup released for 2025 Mississippi State Fair – WAPT

    Exciting Entertainment Lineup Unveiled for the 2025 Mississippi State Fair!

    After Denzel Washington Said He Would Be In Black Panther 3, Ryan Coogler Explained Why He’s ‘Fine’ With That Information Being Revealed So Early – Yahoo

    Ryan Coogler Shares Why He’s Cool with Denzel Washington’s Black Panther 3 Reveal!

    Traveling Tacos and Tequila Festival to stop at Florence Yall’s stadium this October – Cincinnati Enquirer

    Get Ready for a Flavor Fiesta: Traveling Tacos and Tequila Festival Hits Florence Y’all’s Stadium This October!

    9 things to do this weekend in Lake County plus a look ahead – Leesburg Daily Commercial

    Discover 9 Exciting Weekend Adventures in Lake County and What’s Coming Up!

  • 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
    Drag racer survives frightening airborne crash at World Wide Technology Raceway – FOX 2

    Drag racer survives frightening airborne crash at World Wide Technology Raceway – FOX 2

    Apple Watch and the future of wearable technology in healthcare – MSN

    Revolutionizing Healthcare: The Future of Wearable Technology with Apple Watch

    ECS Professor Pankaj K. Jha Receives NSF Grant to Develop Quantum Technology – Syracuse University News

    Unlocking the Future: ECS Professor Pankaj K. Jha Secures NSF Grant for Groundbreaking Quantum Technology Development

    Fire Tech Brief: 5 Fire Apparatus Technology Upgrades – firehouse.com

    Revving Up Safety: 5 Innovative Upgrades for Fire Apparatus Technology

    U.S. FDA Grants Platform Technology Designation to the Viral Vector Used in SRP-9003, Sarepta’s Investigational Gene Therapy for the Treatment of Limb Girdle Muscular Dystrophy Type 2E/R4 – Sarepta Therapeutics

    Breakthrough for Gene Therapy: FDA Designates Viral Vector in Sarepta’s SRP-9003 for Limb Girdle Muscular Dystrophy Treatment

    Waunakee Fifth-Graders Dive into the Future at Exciting Tech Day!

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
  • Home
  • Business
  • Entertainment
    Ceramic Dalmatian Entertainment is WLAF’s Business of the Week – WLAF

    Spotlight on Success: Ceramic Dalmatian Entertainment Shines as This Week’s Featured Business!

    Brass Lion Entertainment unveils co-op action RPG Wu-Tang: Rise of the Deceiver – VentureBeat

    Unleash Your Inner Warrior: Discover the Co-Op Action RPG Wu-Tang: Rise of the Deceiver!

    Entertainment lineup released for 2025 Mississippi State Fair – WAPT

    Exciting Entertainment Lineup Unveiled for the 2025 Mississippi State Fair!

    After Denzel Washington Said He Would Be In Black Panther 3, Ryan Coogler Explained Why He’s ‘Fine’ With That Information Being Revealed So Early – Yahoo

    Ryan Coogler Shares Why He’s Cool with Denzel Washington’s Black Panther 3 Reveal!

    Traveling Tacos and Tequila Festival to stop at Florence Yall’s stadium this October – Cincinnati Enquirer

    Get Ready for a Flavor Fiesta: Traveling Tacos and Tequila Festival Hits Florence Y’all’s Stadium This October!

    9 things to do this weekend in Lake County plus a look ahead – Leesburg Daily Commercial

    Discover 9 Exciting Weekend Adventures in Lake County and What’s Coming Up!

  • 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
    Drag racer survives frightening airborne crash at World Wide Technology Raceway – FOX 2

    Drag racer survives frightening airborne crash at World Wide Technology Raceway – FOX 2

    Apple Watch and the future of wearable technology in healthcare – MSN

    Revolutionizing Healthcare: The Future of Wearable Technology with Apple Watch

    ECS Professor Pankaj K. Jha Receives NSF Grant to Develop Quantum Technology – Syracuse University News

    Unlocking the Future: ECS Professor Pankaj K. Jha Secures NSF Grant for Groundbreaking Quantum Technology Development

    Fire Tech Brief: 5 Fire Apparatus Technology Upgrades – firehouse.com

    Revving Up Safety: 5 Innovative Upgrades for Fire Apparatus Technology

    U.S. FDA Grants Platform Technology Designation to the Viral Vector Used in SRP-9003, Sarepta’s Investigational Gene Therapy for the Treatment of Limb Girdle Muscular Dystrophy Type 2E/R4 – Sarepta Therapeutics

    Breakthrough for Gene Therapy: FDA Designates Viral Vector in Sarepta’s SRP-9003 for Limb Girdle Muscular Dystrophy Treatment

    Waunakee Fifth-Graders Dive into the Future at Exciting Tech Day!

    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

designing for ‘abundance,’ with ecological landscaper kelly norris – A Way To Garden

Embracing Abundance: Insights from Ecological Landscaper Kelly Norris

June 8, 2025
How to take photos on your phone via remote control – Popular Science

How to take photos on your phone via remote control – Popular Science

June 8, 2025
Opinion | RFK Jr.’s Deadly War on Science – Common Dreams

RFK Jr.’s Dangerous Assault on Science: A Call to Action

June 8, 2025
The Worst Bonne Maman Preserves Flavor Leaves A Lot To Be Desired – Yahoo

The Worst Bonne Maman Preserves Flavor Leaves A Lot To Be Desired – Yahoo

June 8, 2025
D.C. Hosts WorldPride Parade in the Shadow of Trump – The New York Times

Celebrating Love and Unity: D.C. Lights Up for WorldPride Parade Amidst Political Tensions

June 8, 2025
This New England state has the best economy in the country, according to WalletHub – Boston.com

Discover the New England State Boasting the Strongest Economy in the Nation!

June 8, 2025
Ceramic Dalmatian Entertainment is WLAF’s Business of the Week – WLAF

Spotlight on Success: Ceramic Dalmatian Entertainment Shines as This Week’s Featured Business!

June 8, 2025
Billy Joel jokes about aging, cremation after brain disorder diagnosis – Fox News

Billy Joel Shares Hilarious Takes on Aging and Life After a Health Scare

June 8, 2025
Supreme Court restores DOGE’s access to sensitive Social Security data and says it doesn’t have to turn over documents – CNN

Supreme Court Grants DOGE Access to Sensitive Social Security Data, Protects Confidential Documents!

June 8, 2025
Drag racer survives frightening airborne crash at World Wide Technology Raceway – FOX 2

Drag racer survives frightening airborne crash at World Wide Technology Raceway – FOX 2

June 8, 2025

Categories

Archives

June 2025
MTWTFSS
 1
2345678
9101112131415
16171819202122
23242526272829
30 
« May    
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 (676)
  • Economy (689)
  • Entertainment (21,595)
  • General (15,271)
  • Health (9,731)
  • Lifestyle (693)
  • News (22,149)
  • People (690)
  • Politics (697)
  • Science (15,908)
  • Sports (21,192)
  • Technology (15,675)
  • World (674)

Recent News

designing for ‘abundance,’ with ecological landscaper kelly norris – A Way To Garden

Embracing Abundance: Insights from Ecological Landscaper Kelly Norris

June 8, 2025
How to take photos on your phone via remote control – Popular Science

How to take photos on your phone via remote control – Popular Science

June 8, 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