Distributed-Ledger Architecture (general)
Generalizes the Bitcoin-specific bitcoin/* skills into engine-agnostic ledger
design. For deep Bitcoin/Lightning specifics, defer to those skills.
First question: do you actually need a ledger?
A ledger is an append-only, replicated, tamper-evident log agreed by
mutually-distrusting parties. Use one only when you genuinely have:
multi-party lack of trust, a need for shared auditable state, and no
acceptable trusted intermediary. If a single org controls the data, a normal
(possibly append-only/audited) database is simpler, faster, and cheaper — most
"blockchain" projects should be databases.
Consensus family (builds on distributed-consensus)
| Family |
Sybil resistance |
Trade-off |
| PoW |
Burn energy |
Robust, slow, energy-heavy, probabilistic finality |
| PoS |
Stake capital |
Efficient, fast finality, weak-subjectivity/validator-set concerns |
| BFT (PBFT/Tendermint) |
Known validator set |
Fast deterministic finality, bounded validators → more permissioned |
Permissionless (open validator set) favors PoW/PoS; permissioned/consortium
favors BFT.
Layering: L1 vs L2
- L1 = base chain (security + data availability). Scaling it directly hits
the trilemma.
- L2 moves execution off L1 while inheriting its security:
- Rollups post compressed data + proofs to L1. ZK rollups (validity
proofs, fast finality, harder to build) vs optimistic rollups (fraud
proofs, challenge window/withdrawal delay).
- State/payment channels (e.g. Lightning) — off-chain bilateral updates,
on-chain settlement; great for high-frequency payments.
- Sidechains — own security, bridged; weaker guarantees.
Other decisions
- Permissioned vs permissionless: trust model + regulatory needs.
- State model: UTXO (parallelizable, privacy, harder smart contracts) vs
account (stateful contracts, simpler, sequential nonces).
- Trilemma: decentralization / security / scalability — you optimize two;
L2s are the usual escape valve.
- Finality: probabilistic (PoW) vs deterministic/instant (BFT) — affects UX
and bridge safety.
Guidance
Single trust domain → database. Multi-party, open → permissionless L1 + L2 for
scale. Known consortium → permissioned BFT chain. High-frequency payments →
channels. Always justify the ledger over a database first.
1---2name: distributed-ledger3description: |4 Distributed-ledger / blockchain architecture in general (engine-agnostic):5 when a ledger beats a database, consensus families (PoW/PoS/BFT), L1 vs L26 (rollups, channels, sidechains), permissioned vs permissionless, UTXO vs7 account models, and the scalability trilemma. Architect-level, not coin-specific.89 USE WHEN: designing/evaluating a blockchain or DLT system in general, "L2",10 "rollup", "zk vs optimistic", "PoS vs PoW", "permissioned ledger", "consortium11 chain", "UTXO vs account", "do we even need a blockchain", token/state design.1213 DO NOT USE FOR: Bitcoin-specific work (use the `bitcoin/*` skills); raw14 consensus internals (use `distributed-consensus`); ordinary app data (use15 database / data-intensive skills).16allowed-tools: Read, Grep, Glob17metadata:18 source: https://skillmd.com/skills/claude-dev-suite/distributed-ledger19---2021# Distributed-Ledger Architecture (general)2223Generalizes the Bitcoin-specific `bitcoin/*` skills into engine-agnostic ledger24design. For deep Bitcoin/Lightning specifics, defer to those skills.2526## First question: do you actually need a ledger?2728A ledger is an **append-only, replicated, tamper-evident** log agreed by29mutually-distrusting parties. Use one only when you genuinely have:30multi-party **lack of trust**, a need for **shared auditable state**, and no31acceptable trusted intermediary. **If a single org controls the data, a normal32(possibly append-only/audited) database is simpler, faster, and cheaper** — most33"blockchain" projects should be databases.3435## Consensus family (builds on `distributed-consensus`)3637| Family | Sybil resistance | Trade-off |38|--------|------------------|-----------|39| **PoW** | Burn energy | Robust, slow, energy-heavy, probabilistic finality |40| **PoS** | Stake capital | Efficient, fast finality, weak-subjectivity/validator-set concerns |41| **BFT (PBFT/Tendermint)** | Known validator set | Fast deterministic finality, bounded validators → more permissioned |4243Permissionless (open validator set) favors PoW/PoS; permissioned/consortium44favors BFT.4546## Layering: L1 vs L24748- **L1** = base chain (security + data availability). Scaling it directly hits49 the trilemma.50- **L2** moves execution off L1 while inheriting its security:51 - **Rollups** post compressed data + proofs to L1. **ZK rollups** (validity52 proofs, fast finality, harder to build) vs **optimistic rollups** (fraud53 proofs, challenge window/withdrawal delay).54 - **State/payment channels** (e.g. Lightning) — off-chain bilateral updates,55 on-chain settlement; great for high-frequency payments.56 - **Sidechains** — own security, bridged; weaker guarantees.5758## Other decisions5960- **Permissioned vs permissionless**: trust model + regulatory needs.61- **State model**: **UTXO** (parallelizable, privacy, harder smart contracts) vs62 **account** (stateful contracts, simpler, sequential nonces).63- **Trilemma**: decentralization / security / scalability — you optimize two;64 L2s are the usual escape valve.65- **Finality**: probabilistic (PoW) vs deterministic/instant (BFT) — affects UX66 and bridge safety.6768## Guidance69Single trust domain → database. Multi-party, open → permissionless L1 + L2 for70scale. Known consortium → permissioned BFT chain. High-frequency payments →71channels. Always justify the ledger over a database first.