Skip to content

Chain reorg dangers and best practices #22

@fivepiece

Description

@fivepiece

I tried to go over the protocol and insert bullets in between phases where a chain reorg might happen.
The naming and numbering can be seen here for Alice and here for Carol

Alice:

stages 0..6 - no reorg danger

stages 7..9

  • if TX1 is reorged at this point, Alice must wait until L0 passes to back out from TX2 (key_2_2_CB_0)

stage 10

  • if TX1 is reorged after the secret was revealed, then Alice stands to lose all coins in TX2 which is redeemable by Carol with no lock time.
  • if L1 is approaching and TX5sig was not received, then Alice must back out from TX3 (key_2_2_AC_1) before L1 and using the secret X or else Carol might redeem both TX2 and TX3

stage 11..12

  • if TX5 is reorged and L1 is close, then Alice must rebroadcast TX5 as soon as possible, and probably add fees using CPFP

Carol:

stages 0..4 - no reorg danger

stages 5..6

  • if TX0 is reorged, Carol must rebroadcast TX0 and TX2 as soon as possible, else Alice can build TX3 and redeem from it without consequence

stages 7..9

  • no reorg danger(?)

stage 10

  • if TX4 is reorged, Carol must rebroadcast it as soon as possible. if L0 is approaching and TX0 is unspent, Alice can build TX2 and redeem from it.

This more or less brings me back to wanting a large duration wait time between TX0 and TX1 are confirmed, and until X is revealed.
Thoughts? Might be missing something on Carol's stages 7 to 9, I couldn't immediately see a reorg issue there.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions