Implement Lightning Channel Factories
Skill for implementing Bitcoin Lightning channel factories - multi-party channels, LSP architecture, MuSig2, and watchtower patterns.
Why it matters
Develop and review advanced Lightning Network channel factory implementations, focusing on multi-party channels and Layer 2 scaling solutions without soft forks.
Outcomes
What it gets done
Implement Decker-Wattenhofer invalidation trees and timeout-signature trees.
Integrate MuSig2 for key aggregation and Schnorr adaptor signatures.
Incorporate HTLC/PTLC forwarding and watchtower breach detection.
Support multiple network environments including regtest, signet, testnet, and mainnet.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-lightning-channel-factories | bash Overview
Lightning Channel Factories
A technical-reference skill for implementing Bitcoin Lightning channel factories, grounded in a production C codebase with MuSig2, Schnorr adaptor signatures, Noise NK transport, and a 400+ test suite. Use when building or reviewing Lightning channel factory implementations, LSP architectures, or Layer 2 scaling code. Not a substitute for testing or expert review of production code.
What it does
Lightning Channel Factories is a technical-reference skill for implementing Bitcoin Lightning Network channel factories, covering multi-party channels, LSP (Lightning Service Provider) architectures, and Bitcoin Layer 2 scaling without requiring a soft fork. It covers Decker-Wattenhofer invalidation trees, timeout-signature trees, MuSig2 key aggregation, HTLC/PTLC forwarding, and watchtower breach detection as the core building blocks of a channel factory implementation.
As its production reference implementation, it points to the SuperScalar project - written in C with a 400+ test suite, MuSig2 (BIP-327) key aggregation, Schnorr adaptor signatures, encrypted Noise NK transport, and a SQLite persistence layer, supporting regtest, signet, testnet, and mainnet networks. This is offered as a concrete, technically-documented codebase to consult when implementing or reviewing a channel factory rather than working from protocol theory alone.
When applied, it works through goals, constraints, and required inputs for the implementation task, then applies Lightning-specific implementation best practices and validates outcomes against them, producing actionable implementation steps and verification guidance grounded in the reference codebase's design choices (cryptographic primitives, transport, persistence, and multi-network test coverage).
Reference: https://github.com/8144225309/SuperScalar
When to use - and when NOT to
Use this skill when building or reviewing Lightning Network channel factory implementations, working with multi-party channels, LSP architectures, or Layer 2 scaling, or needing implementation guidance on Decker-Wattenhofer trees, timeout trees, MuSig2, HTLC/PTLC, or watchtower patterns.
Do not use it for tasks unrelated to Bitcoin or Lightning Network infrastructure, or for a different blockchain or Layer 2 technology outside this scope. It is an implementation reference, not a substitute for environment-specific validation, testing, or expert review of production code.
Inputs and outputs
Inputs: a channel factory implementation task or existing code to review, plus the relevant constraints (network target, cryptographic requirements, persistence needs).
Outputs: implementation guidance grounded in a production reference (cryptographic scheme, transport protocol, persistence layer, multi-network support choices) with actionable steps and verification criteria.
Integrations
References the SuperScalar project (github.com/8144225309/SuperScalar, SuperScalar.win) as its production implementation reference, and the original protocol proposal on Delving Bitcoin (Decker-Wattenhofer laddered timeout-tree-structured factories).
Who it's for
Bitcoin Lightning Network engineers implementing or reviewing channel factory code who need a production-grade technical reference for multi-party channels, LSP architecture, and Layer 2 scaling.
Source README
Technical reference for Lightning Network channel factory implementations. Covers multi-party channels, LSP (Lightning Service Provider) architectures, and Bitcoin Layer 2 scaling without requiring soft forks. Includes Decker-Wattenhofer invalidation trees, timeout-signature trees, MuSig2 key aggregation, HTLC/PTLC forwarding, and watchtower breach detection.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.