Lightning network architecture review
Skill findscripter/everything-skills/09-verticals/lightning-network-architecture-review
当评审比特币闪电网络(Lightning)协议设计、对比通道工厂(channel factory)方案或权衡 Layer2 扩容取舍时使用;产出含信任模型、链上足迹、共识依赖、HTLC/PTLC 兼容性、活性与守望塔的结构化评审结论;不适用于非比特币/闪电网络场景或其他链的 Layer2。触发词:闪电网络、通道工厂、Layer2 扩容From its SKILL.md
npx -y skills add findscripter/everything-skills --skill lightning-network-architecture-reviewAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
5.0 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it
何时使用
适用:
- 评审比特币闪电网络(Lightning Network)协议设计或整体架构。
- 对比多种通道工厂(channel factory)方案,权衡 Layer2 扩容取舍。
- 分析信任模型、链上足迹(on-chain footprint)、共识/软分叉依赖、活性(liveness)与可用性保证。
- 评估 HTLC/PTLC 兼容性、守望塔(watchtower)违约检测、单方退出(unilateral exit)复杂度。
不该用(负边界):
- 任务与比特币或闪电网络协议设计无关。
- 需要评审本范围之外的其他区块链或 Layer2 方案。
- 缺少必要输入、权限、安全边界或成功标准时——先停下并澄清,不要硬产出。
步骤
- 厘清目标、约束与必需输入:评审对象是什么(新协议/已有工厂/对比选型)、目标指标(扩容倍数、退出成本、去信任程度)。
- 沿六个维度逐项评估并给出证据:
- 信任模型:参与方需要信任谁、失信后的资金安全边界。
- 链上足迹:建仓/退出/惩罚各自占用的链上交易与字节成本。
- 共识依赖:是否需要软分叉或新操作码;不需要软分叉是显著加分项。
- HTLC/PTLC 兼容性:能否与现有闪电支付路由无缝互通。
- 活性与可用性:节点离线/LSP 失效时用户能否安全退出。
- 守望塔支持:能否检测并惩罚旧状态广播(breach)。
- 量化退出复杂度:关注单方退出是否为 O(log N)(优于 O(N) 线性)。
- 对比基线:以现代通道工厂参考实现 SuperScalar 作为对照系,标注被评方案相对优劣。
- 输出结构化结论:维度评分 + 关键风险 + 可执行改进项 + 验证建议。
指令
- 先澄清目标、约束与必需输入,再动手评审。
- 套用上述六维度最佳实践,逐条给出可落地的步骤与验证方式,而非泛泛而谈。
- 现代闪电通道工厂参考实现:SuperScalar,https://github.com/8144225309/SuperScalar
- SuperScalar 的核心特征(可作为对照基准):融合 Decker-Wattenhofer 失效树(invalidation trees)、超时签名树(timeout-signature trees)与 Poon-Dryja 通道;无需软分叉;LSP + N 个客户端共享单个 UTXO,完整兼容闪电网络,单方退出复杂度 O(log N),并支持守望塔违约检测。
示例
输入:评审一个让 1 个 LSP 与 100 个客户端共享 UTXO 的新通道工厂提案。
评审骨架:
- 信任模型:客户端是否需信任 LSP 保管签名?失信时能否独立退出。
- 链上足迹:合作关闭 vs 强制退出各占多少链上交易,是否随 N 线性膨胀。
- 共识依赖:是否引入新操作码或软分叉(若需要,落地周期与风险显著上升)。
- HTLC/PTLC:路由互通是否受影响。
- 活性:LSP 长期离线时,单个客户端能否在不依赖他人的前提下退出。
- 守望塔:旧状态广播能否被检测惩罚。
- 退出复杂度:是 O(N) 还是 O(log N),对照 SuperScalar 的 O(log N)。
结论:维度评分表 + 关键风险(如「强制退出为 O(N) 链上交易,N 大时不可行」)+ 改进项(引入树状结构降至 O(log N))+ 验证建议(在 signet/测试网模拟 N 客户端同时退出)。
注意事项
- 评审结论不能替代针对具体环境的验证、测试与专家复核。
- 缺少必需输入、权限、安全边界或成功标准时,停下并请求澄清。
- 仅在任务明确落在上述范围内时使用本技能。
互见
- SuperScalar 项目:https://github.com/8144225309/SuperScalar ;官网 https://SuperScalar.win
- 原始提案(Laddered Timeout-Tree-Structured Decker-Wattenhofer Factories):https://delvingbitcoin.org/t/superscalar-laddered-timeout-tree-structured-decker-wattenhofer-factories/1143
采编自 sickn33/antigravity-awesome-skills(MIT 许可证)。
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.