mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-06-06 06:09:29 -04:00
feat(consensus): Increase refund window from 72 to 144 blocks (#130)
This commit is contained in:
parent
ec25181581
commit
6b6737c056
3 changed files with 6 additions and 5 deletions
|
@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
- Breaking change: Increased Bitcoin refund timelock from 12 hours (72 blocks) to 24 hours (144 blocks) on mainnet. This change affects the default transaction configuration and requires both CLI and ASB to be updated to maintain compatibility. Earlier versions will not be able to initiate new swaps with peers running this version.
|
||||
- Breaking network protocol change: The libp2p version has been upgraded to 0.53 which includes breaking network protocol changes. ASBs and CLIs will not be able to swap if one of them is on the old version.
|
||||
- ASB: Transfer proofs will be repeatedly sent until they are acknowledged by the other party. This fixes a bug where it'd seem to Bob as if the Alice never locked the Monero. Forcing the swap to be refunded.
|
||||
- CLI: Encrypted signatures will be repeatedly sent until they are acknowledged by the other party
|
||||
|
|
|
@ -6,17 +6,17 @@ If you want to learn more about technical details, you can read this paper: [Ato
|
|||
|
||||
## Cancel
|
||||
|
||||
If the _Swap Provider_ has not been able to redeem the Bitcoin within 12 hours (144 Bitcoin blocks) from the start of the swap, the swap will be cancelled.
|
||||
If the _Swap Provider_ has not been able to redeem the Bitcoin within 12 hours (72 Bitcoin blocks) from the start of the swap, the swap will be cancelled.
|
||||
This is done by either you or the _Swap Provider_ publishing a special Bitcoin transaction called the `Bitcoin Cancel Transaction`.
|
||||
As soon as this transaction is included in the Bitcoin blockchain, the swap is locked in a state where only the [_Refund_](#refund) and [_Punish_](#punish) paths can be activated. The _Happy Path_ path where you redeem the Monero is no longer possible.
|
||||
|
||||
## Refund
|
||||
|
||||
As soon as the swap is cancelled, you can refund your Bitcoin. This is done by publishing the `Bitcoin Refund Transaction` on the Bitcoin blockchain.
|
||||
If this is done within 12 hours (144 Bitcoin blocks) from the inclusion of the `Bitcoin Cancel Transaction`, you will get your Bitcoin back.
|
||||
If this is done within 24 hours (144 Bitcoin blocks) from the inclusion of the `Bitcoin Cancel Transaction`, you will get your Bitcoin back.
|
||||
If you do not refund your Bitcoin within this time frame, the _Swap Provider_ can punish you. This is a security measure to ensure that you do not cancel the swap and then refuse to refund your Bitcoin which would result in the _Swap Provider_ losing their Monero.
|
||||
|
||||
## Punish
|
||||
|
||||
If you do not refund your Bitcoin within 12 hours (144 Bitcoin blocks) from the inclusion of the `Bitcoin Cancel Transaction`, the _Swap Provider_ will _punish_ you. This will result in the _Swap Provider_ taking your Bitcoin as a penalty for not refunding it in time.
|
||||
If you do not refund your Bitcoin within 24 hours (144 Bitcoin blocks) from the inclusion of the `Bitcoin Cancel Transaction`, the _Swap Provider_ will _punish_ you. This will result in the _Swap Provider_ taking your Bitcoin as a penalty for not refunding it in time.
|
||||
Even if this state is reached and the _Swap Provider_ has punished you, there's still hope to redeem the Monero. The _Swap Provider_ can choose to allow you to redeem the Monero by transmitting a secret key to you. This however is at the discretion of the _Swap Provider_ and they are not obligated to do so.
|
|
@ -51,7 +51,7 @@ impl GetConfig for Mainnet {
|
|||
bitcoin_finality_confirmations: 1,
|
||||
bitcoin_avg_block_time: 10.std_minutes(),
|
||||
bitcoin_cancel_timelock: CancelTimelock::new(72),
|
||||
bitcoin_punish_timelock: PunishTimelock::new(72),
|
||||
bitcoin_punish_timelock: PunishTimelock::new(144),
|
||||
bitcoin_network: bitcoin::Network::Bitcoin,
|
||||
monero_avg_block_time: 2.std_minutes(),
|
||||
monero_finality_confirmations: 10,
|
||||
|
@ -68,7 +68,7 @@ impl GetConfig for Testnet {
|
|||
bitcoin_finality_confirmations: 1,
|
||||
bitcoin_avg_block_time: 10.std_minutes(),
|
||||
bitcoin_cancel_timelock: CancelTimelock::new(12),
|
||||
bitcoin_punish_timelock: PunishTimelock::new(6),
|
||||
bitcoin_punish_timelock: PunishTimelock::new(24),
|
||||
bitcoin_network: bitcoin::Network::Testnet,
|
||||
monero_avg_block_time: 2.std_minutes(),
|
||||
monero_finality_confirmations: 10,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue