Skip to content

Commit

Permalink
refactor: move docs to gitbook
Browse files Browse the repository at this point in the history
* refactor: move docs to gitbook
  • Loading branch information
armurbalda authored Oct 3, 2023
1 parent 0372a3c commit 33018b6
Show file tree
Hide file tree
Showing 12 changed files with 848 additions and 912 deletions.
Binary file added docs/.gitbook/assets/boltz-backend_header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 18 additions & 11 deletions docs/0-confirmation.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
# 0-confirmation
---
description: >-
The use of 0-conf 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.
---

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.
# ⏩ 0-conf

It is important to note that for:
As a precautionary measure, Boltz enforces a few rules when it comes to 0-conf.

- 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
It is important to note that:

*And 0-confirmation Swaps are only available on UTXO based blockchains like Bitcoin.*
* In Normal Submarine Swaps in which the user sends the chain transaction, _Boltz_ is taking the risk by accepting unconfirmed transactions
* In Reverse Submarine Swaps where the user receives the chain transaction from Boltz, _the user_ is at risk for accepting the unconfirmed transaction

_0-conf Swaps are subject to network conditions and generally only available on UTXO chains like Bitcoin._

## Limits

When it comes to accepting 0-conf transactions, Boltz has configurable limits in place. These limits can be found in the [`getpairs` endpoint](/api/#getting-pairs) 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.
When it comes to accepting 0-conf transactions, Boltz has configurable limits in place. These limits can be found via the [`getpairs`](api.md#supported-pairs) endpoint and are enforced only for Normal Submarine Swaps. When the user receives a chain transaction from Boltz, the acceptance and amounts are entirely up to the client and user.

## 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.
If a transaction locking up bitcoin 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 in Normal Submarine Swaps. Also note, that Boltz never sends transactions that signal RBF. For more information about RBF please read the [BIP 125 - Opt-in Full Replace-by-Fee Signaling](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki).

For more information about RBF please read the [BIP 125 - Opt-in Full Replace-by-Fee Signaling](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki)
> Note: [Growing support for `-mempoolfullrbf`](https://github.com/bitcoin/bitcoin/pull/28132) in Bitcoin Core might make it unfeasible for Boltz to accept 0-conf for the Bitcoin mainchain again.
## Miner fees

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.
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, transactions locking and claiming coins from such contracts have to pay a _reasonably high miner fee_ in order to be included in a block timely.

Boltz considers fees that are equal or higher than 80% of the `sat/vbyte` estimations of the [`getfeeestimation`](/api/#getting-fee-estimations) 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.
Boltz considers fees that are equal or higher than 80% of the `sat/vbyte` estimations of the [`getfeeestimation`](api.md#fee-estimations) 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.
24 changes: 24 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
description: >-
Boltz exposes a RESTful HTTP API that can be used to query information like
supported pairs as well as to create and monitor swaps.
cover: .gitbook/assets/boltz-backend_header.png
coverY: 0
---

# πŸ‘‹ Introduction

## Instances

We offer Boltz on [testnet](https://testnet.boltz.exchange) for development & testing purposes and our production service on [mainnet](https://boltz.exchange).

The corresponding REST APIs can be accessed at:

* Testnet: `https://testnet.boltz.exchange/api/`
* Mainnet: `https://api.boltz.exchange/`

> Note: To test API accessibility via browser, simply append an [endpoint](api.md) to the address, e.g.:
>
> [`https://api.boltz.exchange/version`](https://api.boltz.exchange/version)
In the following sections we'll walk through existing swap types & states, describe the REST API, how to handle refunds and more.
12 changes: 12 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Table of contents

* [πŸ‘‹ Introduction](README.md)
* [πŸ” Swap Types & States](lifecycle.md)
* [πŸ€– REST API](api.md)
* [πŸ“© Refund Files](swap-files.md)
* [🧾 Scripting](scripting.md)
* [⏩ 0-conf](0-confirmation.md)
* [✨ Channel Creation](channel-creation.md)
* [🚒 Deployment of Boltz Backend](deployment.md)
* [🐳 Docker Regtest Environment](regtest.md)
* [πŸ”™ Back to Docs Home](http://127.0.0.1:5000/o/SPM8mTvJyc7OIzGL3HD7/s/XUXMXrD8YTzvuqvAeom7/)
Loading

0 comments on commit 33018b6

Please sign in to comment.