From 294b9985cfe4886b11fea91ebbd4ab8734d430a9 Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Sun, 9 Nov 2025 02:18:41 +0100 Subject: [PATCH] feat: assume xmr double spend safety after 6 confirmations --- CHANGELOG.md | 2 ++ swap-env/src/env.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4130439d..0146ec77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- GUI + SWAP: Assume double spend safety of Monero transactions after 6 confirmations. This means we are assuming that there won't be any re-orgs deeper than 5 blocks. We believe this is a safe assumption given that there were almost no orphaned blocks over the last two weeks. Qubic (which was behind the re-orgs) has mined less than 1% of the last 1000 blocks. + ## [3.2.10] - 2025-11-08 - GUI + SWAP + ASB: Reduce the confirmations required to spend a Monero transaction from 22 to 15. We believe the risks of re-orgs is low again and this is safe to do. This may increase the chances of swap being successful and will reduce the time a swap takes. diff --git a/swap-env/src/env.rs b/swap-env/src/env.rs index 5a5f9edc..1e1a402e 100644 --- a/swap-env/src/env.rs +++ b/swap-env/src/env.rs @@ -66,8 +66,8 @@ impl GetConfig for Mainnet { // If Alice cannot lock her Monero within this timeout, // she will initiate an early refund of Bobs Bitcoin monero_lock_retry_timeout: 10.std_minutes(), - monero_finality_confirmations: 15, - monero_double_spend_safe_confirmations: 15, + monero_finality_confirmations: 10, + monero_double_spend_safe_confirmations: 6, monero_network: monero::Network::Mainnet, } } @@ -86,8 +86,8 @@ impl GetConfig for Testnet { bitcoin_network: bitcoin::Network::Testnet, monero_avg_block_time: 2.std_minutes(), monero_lock_retry_timeout: 10.std_minutes(), - monero_finality_confirmations: 15, - monero_double_spend_safe_confirmations: 15, + monero_finality_confirmations: 10, + monero_double_spend_safe_confirmations: 6, monero_network: monero::Network::Stagenet, } } @@ -106,8 +106,8 @@ impl GetConfig for Regtest { bitcoin_network: bitcoin::Network::Regtest, monero_avg_block_time: 1.std_seconds(), monero_lock_retry_timeout: 1.std_minutes(), - monero_finality_confirmations: 12, - monero_double_spend_safe_confirmations: 12, + monero_finality_confirmations: 10, + monero_double_spend_safe_confirmations: 6, monero_network: monero::Network::Mainnet, // yes this is strange } }