Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save mohamedawnallah/5a59f10abc1b1aafa6fcb24452262cb5 to your computer and use it in GitHub Desktop.

Select an option

Save mohamedawnallah/5a59f10abc1b1aafa6fcb24452262cb5 to your computer and use it in GitHub Desktop.
Sequence Diagram: Dynamic Commitment Update Flow
sequenceDiagram
    participant User
    participant LND_A as LND Node A
    participant LND_B as LND Node B

    %% Initialization Phase
    User->>LND_A: UpdateChannelParams RPC
    LND_A->>LND_A: Status: Initialized
    LND_A->>LND_A: Validate parameters
    LND_A->>LND_A: Status: Pending

    %% Quiescence Phase
    LND_A->>LND_B: stfu (enter quiescence)
    LND_B->>LND_A: stfu (acknowledge)
    Note over LND_A,LND_B: Channel enters quiescent state<br/>No new HTLCs accepted

    %% Parameter Negotiation
    LND_A->>LND_B: DynProposal (new parameters)

    alt Parameters Accepted
        LND_B->>LND_A: DynAck (accept proposal)

        %% Commitment Dance
        LND_A->>LND_B: DynCommit (commit to changes)
        LND_B->>LND_A: CommitSig (new commitment signature)
        LND_A->>LND_B: RevokeAndAck (revoke old state)
        LND_B->>LND_A: RevokeAndAck (revoke old state)

        %% Success
        Note over LND_A,LND_B: Parameters updated successfully
        LND_A->>LND_A: Status: Succeeded
        LND_A->>User: Success Response

    else Parameters Rejected
        LND_B->>LND_A: DynReject (reject proposal)
        LND_A->>LND_A: Status: Failed
        LND_A->>User: Error Response
    end

    %% Resume Normal Operations
    Note over LND_A,LND_B: Exit quiescence<br/>Resume normal HTLC operations
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment