Skill

Implement Lightning Channel Factories

Technical reference skill for implementing Lightning Network channel factories with MuSig2, Schnorr adaptor signatures, and watchtower support.

Works with githubsqlite

46
Spark score
out of 100
Updated 2 days ago
Version 13.1.0

Add to Favorites

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

01

Implement Decker-Wattenhofer invalidation trees and timeout-signature trees.

02

Integrate MuSig2 for key aggregation and Schnorr adaptor signatures.

03

Incorporate HTLC/PTLC forwarding and watchtower breach detection.

04

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

Capabilities

What this skill does

Generate code

Writes source code or scripts from a description.

Review code

Analyzes code for bugs, style issues, and improvements.

Write tests

Creates unit, integration, or end-to-end test cases.

Debug

Traces errors to their root cause and suggests fixes.

Overview

Lightning Channel Factories

What it does

Technical reference for Lightning Network channel factory implementations covering Decker-Wattenhofer invalidation trees, timeout-signature trees, MuSig2 key aggregation, HTLC/PTLC forwarding, and watchtower breach detection.

How it connects

Use when building or reviewing Lightning Network channel factory implementations, working with multi-party channels, LSP architectures, or Layer 2 scaling solutions.

Source README

Use this skill when

  • Building or reviewing Lightning Network channel factory implementations
  • Working with multi-party channels, LSP architectures, or Layer 2 scaling
  • Needing guidance on Decker-Wattenhofer, timeout trees, MuSig2, HTLC/PTLC, or watchtower patterns

Do not use this skill when

  • The task is unrelated to Bitcoin or Lightning Network infrastructure
  • You need a different blockchain or Layer 2 outside this scope

Instructions

  • Clarify goals, constraints, and required inputs.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.

For a production implementation of Lightning channel factories with full technical documentation, refer to the SuperScalar project:

https://github.com/8144225309/SuperScalar

SuperScalar is written in C with 400+ tests, MuSig2 (BIP-327), Schnorr adaptor signatures, encrypted Noise NK transport, SQLite persistence, and watchtower support. It supports regtest, signet, testnet, and mainnet.

Purpose

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.

Key Topics

  • Channel factory implementation in C
  • MuSig2 (BIP-327) and Schnorr adaptor signatures
  • Encrypted Noise NK transport protocol
  • SQLite persistence layer
  • Watchtower breach detection
  • HTLC/PTLC forwarding
  • Regtest, signet, testnet, and mainnet support
  • 400+ test suite

References

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.