Lightning Labs announces the open-source tool for the Lightning Network L402 protocol "AI Agent Payment," compatible with mainstream AI frameworks.

Lightning Labs officially released the open-source toolkit “lightning-agent-tools” on February 12, enabling AI agents to autonomously send and receive payments over the Bitcoin Lightning Network without manual approval, account login, or API keys.
(Background: Bitcoin Lightning Network convergence: Breez, Lightspark, Tether, Plan ₿ promote “Time2Build” to bind developers and mainstream applications)
(Additional context: U.S. first case: Digital bank SoFi integrates Bitcoin Lightning Network for instant, low-cost cross-border remittances)

Table of Contents

  • Seven modular skills + lnget tool
  • Security mechanism with least privilege principle
  • Business cycle mechanism between AI agents
  • Compatibility with mainstream AI frameworks

According to Lightning Labs’ official blog, the core of this new payment toolkit is the L402 protocol. L402 is built on the HTTP 402 “Payment Required” status code, a standard that has existed for decades but has rarely been used in practice.

It works by having an AI agent send a request to a website or API, which responds with a Lightning invoice. After the AI agent automatically completes the payment, it receives an encrypted credential called a “macaroon” as an access key, unlocking the service or data. The entire process requires no account registration, no credit card, and no API key management.

Lightning Labs states: “AI agents require real-time, programmatic, large-scale transactions, which are fundamentally incompatible with traditional financial infrastructure.”

Seven Modular Skills + lnget Tool

This open-source toolkit includes seven composable skill modules:

  • Node Operations: AI agents can deploy and manage their own Lightning nodes
  • Remote Key Isolation: Private keys are stored separately from the agent process to prevent leaks
  • Scoped Credentials: Permissions are limited via macaroon mechanisms (payment only, invoice only, read-only)
  • Node State Querying: Integrates MCP (Model Context Protocol) to monitor balances
  • Invoice Management: Automates Lightning invoice handling
  • Payment Processing: Executes transactions
  • Account Management: Manages agent wallets

It also includes a command-line tool called lnget. When an AI agent encounters a resource requiring payment, lnget automatically parses the L402 challenge, pays the invoice over the Lightning Network, and retrieves the encrypted payment credential—all seamlessly in the background.

Security Mechanism with Least Privilege Principle

Security is paramount when allowing AI to spend money autonomously. Lightning Labs employs a Remote Signer Architecture, where the signing device holds the private keys offline, and the agent only performs transaction operations. Even if the agent is compromised, attackers cannot access the private keys.

For permission control, the toolkit supports encrypted “macaroon” tokens, allowing developers to set fine-grained permissions for AI agents: pay-only, invoice-only, read-only, with optional spending limits to prevent AI from draining wallets.

Business Cycle Mechanism Between AI Agents

Another key component is Aperture, a reverse proxy tool that converts standard APIs into pay-per-use services.

Lightning Labs explains that lnget (client) combined with Aperture (server) forms a complete AI business cycle. One AI agent can set up a paid service, while another consumes it, with Lightning Network settling instantly in the background.

For example, a market data collection AI agent could purchase analysis reports from an analysis AI agent, with all micro-payments settled via Bitcoin, requiring no human intervention. This is what Lightning Labs calls “Machine Commerce.”

Compatibility with Mainstream AI Frameworks

Notably, the toolkit already supports integration with Claude Code (Anthropic), OpenAI Codex, and other custom AI applications that support shell command execution. This means the most popular AI agent frameworks on the market can directly incorporate Lightning Network payment capabilities.

View Original
Disclaimer: The information on this page may come from third parties and does not represent the views or opinions of Gate. The content displayed on this page is for reference only and does not constitute any financial, investment, or legal advice. Gate does not guarantee the accuracy or completeness of the information and shall not be liable for any losses arising from the use of this information. Virtual asset investments carry high risks and are subject to significant price volatility. You may lose all of your invested principal. Please fully understand the relevant risks and make prudent decisions based on your own financial situation and risk tolerance. For details, please refer to Disclaimer.

Related Articles

Vitalik Buterin proposes building Ethereum with a "cypherpunk" approach

Vitalik Buterin is developing a cypherpunk-inspired version of Ethereum to enhance censorship resistance, optimize for zero-knowledge technology, and refine the consensus mechanism. He envisions a new system language for better performance and security within five years, along with upgrades to the state tree and ZK-EVM. This effort aims to further decentralize and strengthen Ethereum's technical foundation.

TapChiBitcoin30m ago

GoPlus Launches Token AI Auditing Platform — DeepScan

GoPlus's DeepScan platform, built on years of security technology expertise, enables automated auditing of Token contracts and supports OpenAI EVMbench testing. The platform employs an AI-driven multi-engine collaborative architecture to systematically identify contract vulnerabilities, marking a practical application of AI auditing technology.

GateNewsBot1h ago

10x Research: Altcoin Market Is Fragile and Bitcoin Is Oversold, but Positioning Structure Is Quietly Changing

The current crypto market is changing, with Bitcoin oversold and altcoins generally fragile. Optimism (OP) is under pressure, recently dropping by 24.4%. The partnership between the Base blockchain and OP Stack has ended, and Optimism has launched a token buyback program. Ether.fi has migrated its operations to the OP mainnet, providing fundamental support for OP.

GateNewsBot1h ago

BGD Labs stops supporting Aave DAO from April

BGD Labs will end its support for Aave DAO after four years, citing concerns about increasing centralization. They will complete ongoing projects and propose a $200,000 security support package for the transition. Following the announcement, AAVE's price dropped over 5%.

TapChiBitcoin1h ago

BNP Paribas Launches Ethereum Money Market Fund Tokenization Pilot Project

ChainCatcher message: BNP Paribas Asset Management recently announced the issuance of tokenized shares of a French domestic money market fund on the Ethereum blockchain through its AssetFoundryTM platform. The project adopts a "permissioned access model" to ensure that only qualified and authorized participants can hold and transfer assets, in compliance with relevant regulatory requirements. This is BNP Paribas's second issuance of a tokenized money market fund, aimed at testing the complete end-to-end process from issuance and transfer agency to tokenization and connection to public blockchains.

GateNewsBot2h ago

Robinhood Layer 2 Testnet Hits 4 Million Transactions in Week One

Robinhood's new Ethereum Layer 2 testnet, Robinhood Chain, processed four million transactions in its first week. Designed for tokenized assets, it aims to reshape finance infrastructure and compete with traditional markets.

Coinpedia6h ago
Comment
0/400
No comments
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate App
Community
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)