Bitcoin

Script – Detect closure with lightning force

    ┌────────────────────────────────────┐       ┌────────────────────────────┐
    │ outputs contain revocation script? ├──yes──► force close w/ penalty = 3 │
    └──────────────┬─────────────────────┘       └────────────────────────────┘
                   no
    ┌──────────────▼──────────────────────────┐
    │ outputs contain other lightning script? ├──┐
    └──────────────┬──────────────────────────┘  │
                   no                           yes
    ┌──────────────▼─────────────┐               │
    │ sequence starts with 0x80  │      ┌────────▼────────┐
    │           and              ├──────► force close = 2 │
    │ locktime starts with 0x20? │      └─────────────────┘
    └──────────────┬─────────────┘
                   no
         ┌─────────▼────────┐
         │ mutual close = 1 │
         └──────────────────┘

I saw this diagram here in the mempool space code. How does the sequence and lock time start to detect a forced shutdown? Are there any rules or is this important to the underlying protocol?

Related Articles

Back to top button