The use of 0-confirmation can make swaps a lot faster by utilizing transactions that are not included in a block yet. But accepting 0-conf transactions doesn't come without unwarranted risk. Therefore, as a precautionary measure, Boltz enforces a few rules when it comes to 0-conf.
It is important to note that for:
- normal swaps in which the user sends the onchain transaction, a Boltz service provider is taking the risk by accepting the 0-conf transaction
- reverse swaps where the user receives the onchain coins from Boltz, the user is at risk for accepting the unconfirmed transaction
And 0-confirmation Swaps are only available on UTXO based blockchains like Bitcoin.
When it comes to accepting 0-conf transactions, Boltz has configurable limits in place. These limits can be found in the
getpairs endpoint and are just enforced for normal swaps. When the user receives onchain coins from Boltz, he can accept any amount of coins with 0-conf he is comfortable with.
BIP 125 - Replace-By-Fee
If a transaction locking up coins is signalling Replace-By-Fee either explicitly or inherently (unconfirmed inputs of the transaction signal RBF) Boltz will not accept 0-conf for that transaction. Boltz itself will never send transactions that signal RBF, which means that the user doesn't have to worry about a lockup transaction of a reverse swap being replaceable.
For more information about RBF please read the BIP 125 - Opt-in Full Replace-by-Fee Signaling
Swaps on Boltz are based on HTLCs (Hash Time Locked Contracts). In order to be able to deal with the time locked component of these contracts, in scenarios where not all transactions from the mempool are getting included in the very next block all the time, transactions locking and claiming coins from such contracts have to pay a reasonably high miner fee in order to be included in a block quickly.
Boltz considers fees that are equal or higher than 80% of the
sat/vbyte estimations of the
getfeeestimation endpoint as reasonably high. If the miner fee paid by the transaction is less than that, Boltz will not accept 0-conf and wait for the transaction to be included in a block.