mimblewimble / mwixnet

Implementation of the Mimblewimble CoinSwap proposal.
Apache License 2.0
8 stars 18 forks source link

Basic Reorg Protection #8

Open scilio opened 1 year ago

scilio commented 1 year ago

As part of milestone 3, the following protections will be added to help ensure CoinSwap transactions cannot be easily lost due to short chain reorgs:

  1. If a transaction is broadcast but not accepted by the network due to inputs being already spent, the mwixnet servers will try to rebuild the transaction, pruning any swaps for inputs already spent.
  2. If a CoinSwap transaction is included in a block, but later removed by a reorg, the mwixnet server will try to rebroadcast the transaction. If the transaction is no longer valid, try to rebuild it, pruning any swaps for inputs already spent.

Reasonable limits will be set for the size of the swap cache and the number of attempts at rebuilding the CoinSwap transaction for a round.