长推:简单理解闪电网络所涉资金丢失风险问题

MarsBitPublished on 2023-10-24Last updated on 2023-10-27

Abstract

Antoine 在去年年底发现了一种闪电网络的“All your mempool are belong to us”攻击,并在今年4月份发布的 lnd v0.16.1-beta中“mitigate”了这种攻击。目前为止,没有在主网上观察到此类攻击,但Antoine计划在30号再开始在公开邮件列表上进行回复,并且之后会专注在 Core 的开发上。

注:原文来自@hu_zhiwei发布长推。
“All your mempool are belong to us”,上周的闪电网络这个问题得到了很多关注。我也去学习了一下,但发现很多理解似乎并不准确,在这里做一个整理。
1-到底什么问题?
简单来说,是攻击者利用 RBF(手续费替换)使得闪电网络上的受害者没办法在主网上提交 timeout 交易,使其损失了转发的资金。
2-大体的流程是:
- 共谋的攻击者 A 和 C,分别和受害者 B 建立了闪电网络通道,然后 A 通过受害者 B 转发付款给 C。
- 攻击者在这里利用了两次 RBF(手续费替换),第一次是阻止 B 去 timeout B<>C的通道;第二次是隐藏HTLC的原像,阻止B去向 A claim 收款。
具体的:
- 在第一次 RBF 前,攻击者要提前准备了一系列低费率的链式交易
- 第一次RBF是C利用这个交易作为其中一个输入加上自己的原像把 B 的 timeout 交易替换掉
- 还要再做第二次 RBF 是因为B看到原像后,就可以向A去claim收款。所以这时候,C会立即再做一笔替换,把这个链式交易中的最后一笔替换掉
因为原像的交易依赖于这笔链式交易,因此这时候也会被替换掉,也就无法从 mempool 里观察到了。
C 重复这两个 RBF 过程,让B无法在B<>C的通道上发送timeout(如果受害者 B 不关注 mempool,无法注意到C短暂发出的原像),直到 A<>B 的通道也过期,让 B 彻底无法获得这笔转发的资金。
这里涉及到两个概念:timeout 交易和RBF(手续费替换)
1)timeout 交易。闪电网络为了转发交易,设置了HTLC 来协调通道间的转发付款。当有一笔付款的每一跳在付款人(如上例中的 B)发给收款人(如 C)时,通道会在原有基础上增加一个 HTLC 的条件,要求必须在限定时间内给出原像,以此“结算”这笔付款。
如果超时后收款人(C)还给不出原像,可能存在欺诈行为,需要将当前的通道状态发布到主链上来把转发的资金收回来;如果能给出原像,就可以结算当前的付款(通道也不必关闭),同时还可以和上一跳的付款人(A)来结算。
2)RBF(手续费替换)。这个其实不是像以太坊链上 MEV 用更高 gas 去抢跑,但也是在 mempool 里的操作。RBF 的设计背景是用户发送了一个低费率(BTW 请不要把比特币链上的费率称为“gas”)交易,可能会在mempool里一直未得到确认;RBF 允许用户重新发一个新的高费率交易来替换掉原交易。
具体的攻击过程可以参考,这个非常直观的解释: https://twitter.com/mononautical/status/1715736832950825224…
这里也有原报告者的Paper: https://github.com/ariard/mempool-research/blob/2023-10-replacement-paper/replacement-cycling.pdf
3-会有哪些影响?
值得注意的是,这个问题不是上周才发现的,而报告者 Antoine 已经在去年年底发现,告知了 Core 的维护者和闪电网络主要实现的开发团队。报告过程和其他开源项目都类似,都是通过“负责任的披露过程”,而不是在发现的当时就在公开渠道里对所有人直接说。
因此在过去的闪电网络主要版本里已经“mitigate”了这种攻击,例如在今年4月份发布的 lnd v0.16.1-beta。 根据和 LN 的开发者交流:“现在lnd会一直观察mempool,所以一旦preimage出现了,B可以直接从mempool里拿到preimage然后settle;另外是lnd会一直rebroadcast,防止tx从mempool里消失”。
不过,想完全解决,可能要依赖于 Core 等协议层面的实现,例如把 mempool 里的信息保存更久一些等等。
目前为止,没有在主网上(包括 Bitcoin 网络和闪电网络)观察到此类攻击。 但并不意味着以后不会出现,因为可能有更高级的攻击者会更精心策划攻击,例如和矿工合谋从而让更细心的节点也会遭受攻击。
4-开发者因此感到失望、退出开发了?
Antoine 关注到目前一些媒体报道上出现偏差后,还专门又写了一封邮件说,这不是"intentional backdoor",并且建议媒体可以等更专业的报告者提供更多信息后再发布报道…… https://lists.linuxfoundation.org/pipermail/lightning-dev/2023-October/004157.html…
尽管不知道他个人的未来计划,但 Antoine 在之前的邮件里也提到他计划在30号再开始在公开邮件列表上进行回复,并且之后会专注在 Core 的开发上。
可以在邮件列表看到更详细的讨论:
https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-October/021999.html…
如果没时间的话,每周中更新的 Bitcoin Optech 在本周会有汇总:
https://bitcoinops.org
因为讨论还在进行中,我也没有读完所有的邮件。如有错误或不准确的地方,请指正。

Related Reads

Silicon Valley 'Startup Guru' Steve Hoffman: Web3 + AI Could Be a Trap

Silicon Valley investor and "Godfather of Startups" Steve Hoffman warns that combining Web3 with AI is likely a trap, not a promising venture. In an interview, Hoffman argues that while AI is a foundational technology touching all industries, Web3 adds complexity, friction, and regulatory risk without solving mainstream consumer or business needs. He advises founders to focus on deep, specialized applications where startups can out-iterate giants, rather than on generic features easily replicated by large tech companies. Hoffman observes that Silicon Valley will lead foundational AI research, while China excels at rapid, large-scale application and commercialization, particularly in robotics. He stresses that AI-driven autonomous agents capable of collaborative, multi-step tasks are 2-4 years away, which will cause significant job displacement. The solution is not to slow AI but to redesign business models around human-AI collaboration and reform social systems like education and retraining. For startups, Hoffman recommends focusing on vertical, expertise-heavy domains to build defensibility. He sees major opportunities in AI fraud detection and cybersecurity. Key founder mindsets include systemic thinking over feature-focus, relentless customer centricity, building adaptive teams, and deeply understanding AI's capabilities and limits. Hoffman is also leading a non-profit initiative to establish university centers aimed at training future leaders in responsible, human-value-aligned AI innovation.

marsbit48m ago

Silicon Valley 'Startup Guru' Steve Hoffman: Web3 + AI Could Be a Trap

marsbit48m ago

Token Inefficient, Economy Tokenless

The article "Tokens Aren't Economical, Economics Aren't Tokenized" analyzes a pivotal shift in the AI industry from a technology-driven narrative to one dominated by capital efficiency. It highlights two concurrent trends: a severe capital shortage due to the exorbitant and recurring costs of compute (e.g., OpenAI's high burn rate) and a wave of corporate spin-offs where major tech companies are separating their AI units (like Kuaishou's Kling and Baidu's Kunlunxin). The core argument is that AI's "anti-internet" business model, where user growth increases costs rather than profits, has created a disconnect between high valuations and actual cash flow. Spin-offs address this by allowing AI assets to be valued independently. Within a parent company, they are seen as cost centers, but as standalone entities, they are priced based on their growth potential and scarcity in the primary market, leading to massive valuation premiums (e.g., Kling's estimated value tripling post-spin-off). The industry is at an inflection point, moving from "model worship" to "value realization." The competition is evolving from a pure compute (GPU) race to a broader focus on systemic efficiency and full-stack engineering (involving CPUs and orchestration) to achieve viable commercialization. The year 2026 is framed as a critical moment where the industry must definitively answer how to economically translate AI capability into tangible business value, reshaping the sector's future power structure.

marsbit53m ago

Token Inefficient, Economy Tokenless

marsbit53m ago

Crossing the 'Memory Wall': The Wafer-Level Revolution and Computing Power Routes in the AI Inference Era

In 2026, a historic shift occurred in AI as major cloud providers' inference spending surpassed training spending for the first time, signaling a move from "building large models" to "using large models." This shifts the core challenge from computing power to the "memory wall"—the bottleneck of data movement (model weights, activations, KV Cache) between external DRAM and processors, where energy and latency from data transfer far exceed computation itself. Companies like Nvidia face GPU idle time due to bandwidth limits. In contrast, Cerebras Systems adopts a radical "wafer-scale" approach with its Wafer-Scale Engine (WSE). Instead of cutting a silicon wafer into many chips, Cerebras uses almost the entire wafer as one massive chip (WSE-3). This design provides 44GB of on-chip SRAM, delivering memory bandwidth thousands of times higher than traditional HBM (e.g., 21 PB/s vs. Nvidia B200). For LLM inference, weights are streamed layer-by-layer from external MemoryX storage to the chip, avoiding HBM bottlenecks. This results in token generation speeds 1.5–5 times faster than Nvidia's B200 in some models and significant advantages in first-token latency and long-context tasks. Additionally, Cerebras's architecture offers much lower interconnect power consumption (0.15 pJ/bit vs. GPU's ~10 pJ/bit). However, Cerebras faces challenges: SRAM scaling has slowed with advanced nodes, limiting future capacity gains; the chip requires specialized liquid cooling and custom software stacks; and its external I/O bandwidth (150 GB/s) is low compared to NVLink, hindering multi-system scaling for very large models. Competition is intensifying. Major players are pursuing three paths: 1) Developing proprietary inference ASICs (e.g., Google TPU, Microsoft Maia), 2) Leveraging advanced packaging (e.g., TSMC's SoW) to democratize wafer-scale-like integration, potentially eroding Cerebras's process advantage within a few years, and 3) Exploring optical interconnects for ultimate bandwidth. Commercially, Cerebras is transitioning from a hardware vendor to a service provider, facing the immense challenge of building high-power, specialized data centers to meet large contracts (e.g., 250MW/year from 2026–2028). In conclusion, the AI inference era presents a fundamental architectural trade-off. Cerebras opts for extreme physical optimization for low-latency, single-task performance, while Nvidia prioritizes versatility and massive cluster throughput. The path forward remains uncertain, with technology and business models still evolving in the race toward advanced AI.

marsbit59m ago

Crossing the 'Memory Wall': The Wafer-Level Revolution and Computing Power Routes in the AI Inference Era

marsbit59m ago

Has Bitcoin's 'Rebound Ended', Officially Entering the Late Bear Market Phase?

**Title: Has Bitcoin's Rebound Ended, Entering the Late Bear Market Phase?** **Summary:** Bitcoin's price has declined by 13% this week, signaling a potential return to late-stage bear market conditions. The price fell to around $67k, positioned between the Realized Price and Realized Cap Weighted Average. For the first time since early 2022, the Short-Term Holder cost basis has dropped below this key average, confirming a hallmark of late-cycle bear markets. Profitability metrics have collapsed sharply. The 7-day average of the Realized Profit/Loss ratio plummeted from a local high of 3.16 to 0.29, mirroring the February panic sell-off. Critically, the 90-day average never breached the threshold of 2, indicating the recent rally to $82k was a bear market bounce, not a structural shift. Realized losses surged to $1.35 billion daily, with $770 million coming from Long-Term Holders selling at a loss. This accelerating redistribution of supply from weak to strong hands is a necessary but ongoing process for a market bottom. The rally stalled almost precisely at the aggregate cost basis (~$83k) of US spot Bitcoin ETF investors, turning that level into strong resistance and leaving the average ETF holder underwater again. Spot market flows have turned decisively negative, showing sellers are dominating order books despite the price drop. While a significant futures long liquidation event cleared over $400 million in leverage, providing a potential reset, sustained spot demand is yet to materialize. Options markets continue to price in higher future volatility (Implied Volatility) than recent price action (Realized Volatility) has shown, with a persistent skew towards put options, indicating ongoing demand for downside protection. In conclusion, multiple metrics point to a fragile market structure. Resistance at the ETF cost basis, accelerating realized losses, dominant spot selling, and cautious options pricing all suggest the bear market trend persists. A sustainable recovery likely requires a resurgence of spot demand, ETF holders returning to profit, and a clear reduction in selling pressure.

marsbit59m ago

Has Bitcoin's 'Rebound Ended', Officially Entering the Late Bear Market Phase?

marsbit59m ago

TechFlow Intelligence Agency: Anthropic Calls for Global Pause in AI Development While Preparing for Trillion-Dollar IPO; SpaceX IPO Roadshow Heats Up, But S&P 500 Rejects Fast-Track Inclusion

In today's TechFlow Intelligence Briefing, several major tech stories highlight a growing theme of trust and credibility gaps across AI, crypto, and finance. AI company Anthropic has publicly called for a global pause in AI development, citing risks from Claude's "recursive self-improvement." Ironically, this coincides with reports the company is preparing for a massive IPO targeting a near $1 trillion valuation. This perceived hypocrisy, coupled with widespread user complaints about Claude's declining performance, is sparking debate over whether the safety warning is genuine or a competitive tactic. Meanwhile, in a substantive security move, Anthropic open-sourced a framework for AI-powered vulnerability discovery. In the crypto market, Bitcoin's price drop below $61,000 triggered over $1.16 billion in liquidations, flipping the market into a state where more BTC is held at a loss than at a profit, a historical bearish signal. On the corporate front, SpaceX's highly anticipated IPO is generating immense Wall Street excitement, with Goldman Sachs projecting 100x revenue growth by 2030. However, the S&P 500 has refused to fast-track the company's inclusion post-IPO, potentially limiting immediate institutional demand. Separately, ByteDance's AI app Doubao lost over 6 million monthly active users after introducing a subscription model, highlighting the challenges of AI monetization. Other notable developments include Nvidia certifying HBM4 memory from Samsung, SK Hynix, and Micron; Cloudflare's acquisition of front-end tooling company VoidZero; and its CEO warning that bot traffic now exceeds human traffic online. The underlying narrative connects these events: a trust crisis. From AI firms' contradictory actions and crypto volatility to the clash between SpaceX's hyped narrative and institutional rules, a pattern is emerging where stated intentions and actual practices are increasingly misaligned.

marsbit1h ago

TechFlow Intelligence Agency: Anthropic Calls for Global Pause in AI Development While Preparing for Trillion-Dollar IPO; SpaceX IPO Roadshow Heats Up, But S&P 500 Rejects Fast-Track Inclusion

marsbit1h ago

Trading

Spot
Futures

Hot Articles

What is $BITCOIN

DIGITAL GOLD ($BITCOIN): A Comprehensive Analysis Introduction to DIGITAL GOLD ($BITCOIN) DIGITAL GOLD ($BITCOIN) is a blockchain-based project operating on the Solana network, which aims to combine the characteristics of traditional precious metals with the innovation of decentralized technologies. While it shares a name with Bitcoin, often referred to as “digital gold” due to its perception as a store of value, DIGITAL GOLD is a separate token designed to create a unique ecosystem within the Web3 landscape. Its goal is to position itself as a viable alternative digital asset, although specifics regarding its applications and functionalities are still developing. What is DIGITAL GOLD ($BITCOIN)? DIGITAL GOLD ($BITCOIN) is a cryptocurrency token explicitly designed for use on the Solana blockchain. In contrast to Bitcoin, which provides a widely recognized value storage role, this token appears to focus on broader applications and characteristics. Notable aspects include: Blockchain Infrastructure: The token is built on the Solana blockchain, known for its capacity to handle high-speed and low-cost transactions. Supply Dynamics: DIGITAL GOLD has a maximum supply capped at 100 quadrillion tokens (100P $BITCOIN), although details regarding its circulating supply are currently undisclosed. Utility: While precise functionalities are not explicitly outlined, there are indications that the token could be utilized for various applications, potentially involving decentralized applications (dApps) or asset tokenization strategies. Who is the Creator of DIGITAL GOLD ($BITCOIN)? At present, the identity of the creators and development team behind DIGITAL GOLD ($BITCOIN) remains unknown. This situation is typical among many innovative projects within the blockchain space, particularly those aligning with decentralized finance and meme coin phenomena. While such anonymity may foster a community-driven culture, it intensifies concerns about governance and accountability. Who are the Investors of DIGITAL GOLD ($BITCOIN)? The available information indicates that DIGITAL GOLD ($BITCOIN) does not have any known institutional backers or prominent venture capital investments. The project seems to operate on a peer-to-peer model focused on community support and adoption rather than traditional funding routes. Its activity and liquidity are primarily situated on decentralized exchanges (DEXs), such as PumpSwap, rather than established centralized trading platforms, further highlighting its grassroots approach. How DIGITAL GOLD ($BITCOIN) Works The operational mechanics of DIGITAL GOLD ($BITCOIN) can be elaborated on based on its blockchain design and network attributes: Consensus Mechanism: By leveraging Solana’s unique proof-of-history (PoH) combined with a proof-of-stake (PoS) model, the project ensures efficient transaction validation contributing to the network's high performance. Tokenomics: While specific deflationary mechanisms have not been extensively detailed, the vast maximum token supply implies that it may cater to microtransactions or niche use cases that are still to be defined. Interoperability: There exists the potential for integration with Solana’s broader ecosystem, including various decentralized finance (DeFi) platforms. However, the details regarding specific integrations remain unspecified. Timeline of Key Events Here is a timeline that highlights significant milestones concerning DIGITAL GOLD ($BITCOIN): 2023: The initial deployment of the token occurs on the Solana blockchain, marked by its contract address. 2024: DIGITAL GOLD gains visibility as it becomes available for trading on decentralized exchanges like PumpSwap, allowing users to trade it against SOL. 2025: The project witnesses sporadic trading activity and potential interest in community-led engagements, although no noteworthy partnerships or technical advancements have been documented as of yet. Critical Analysis Strengths Scalability: The underlying Solana infrastructure supports high transaction volumes, which could enhance the utility of $BITCOIN in various transaction scenarios. Accessibility: The potential low trading price per token could attract retail investors, facilitating wider participation due to fractional ownership opportunities. Risks Lack of Transparency: The absence of publicly known backers, developers, or an audit process may yield skepticism regarding the project's sustainability and trustworthiness. Market Volatility: The trading activity is heavily reliant on speculative behavior, which can result in significant price volatility and uncertainty for investors. Conclusion DIGITAL GOLD ($BITCOIN) emerges as an intriguing yet ambiguous project within the rapidly evolving Solana ecosystem. While it attempts to leverage the “digital gold” narrative, its departure from Bitcoin's established role as a store of value underscores the need for a clearer differentiation of its intended utility and governance structure. Future acceptance and adoption will likely depend on addressing the current opacity and defining its operational and economic strategies more explicitly. Note: This report encompasses synthesised information available as of October 2023, and developments may have transpired beyond the research period.

363 Total ViewsPublished 2025.05.13Updated 2025.05.13

What is $BITCOIN

Discussions

Welcome to the HTX Community. Here, you can stay informed about the latest platform developments and gain access to professional market insights. Users' opinions on the price of BTC (BTC) are presented below.

活动图片