Skip to content

Commit

Permalink
docs: API v2 wording and style (#486)
Browse files Browse the repository at this point in the history
* docs: No subject

* docs: redeem script clarification

* Update docs/api.md

* docs: misc fixes for #484

* docs: api-v1 doc fixes

* docs: rm "the"

* docs: misc fixes apiv2

* docs: beginning to end wording

* docs: claim-swaps.md fixes

* docs: don't-trust-verify.md smol fix

* docs: misc swap state fixes

* docs: rm reason for cooperating in Boltz's keypath claim

* docs: move hints to new style

* docs: No subject

* docs: No subject

* docs: No subject

* docs: api pages subtitles

* docs: No subject

* docs: No subject

* docs: go examples

* docs: fix tab

* docs: submarine go sample fix

* Update docs/0-conf.md

Co-authored-by: michael1011 <me@michael1011.at>

* Update docs/lifecycle.md

Co-authored-by: michael1011 <me@michael1011.at>

* Update docs/claiming-swaps.md

Co-authored-by: michael1011 <me@michael1011.at>

* docs: Move SIGHASH_DEFAULT hint into Taproot Section

* docs: fix go code sample reverse swap

---------

Co-authored-by: Kilian <kilian.rausch@gmail.com>
Co-authored-by: michael1011 <me@michael1011.at>
Co-authored-by: jackstar12 <jkranawetter05@gmail.com>
  • Loading branch information
4 people committed Feb 18, 2024
1 parent e4db482 commit 4972f31
Show file tree
Hide file tree
Showing 6 changed files with 393 additions and 76 deletions.
6 changes: 4 additions & 2 deletions docs/0-conf.md
Expand Up @@ -12,9 +12,11 @@ As a precautionary measure, Boltz enforces a few rules when it comes to 0-conf.
* 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._
_0-conf Swaps are subject to network conditions and only available on UTXO chains like Bitcoin or Liquid._

> Note: Because of [growing support for `-mempoolfullrbf`](https://github.com/bitcoin/bitcoin/pull/28132) in Bitcoin Core and because a significant set of miners (>35% at time of writing) are processing such transactions already, Boltz had to set limits for the Bitcoin mainchain to 0, effectively not accepting 0-conf transactions for Normal Submarine Swaps anymore.
{% hint style="info" %}
Because of [growing adoption of`mempoolfullrbf`](https://github.com/bitcoin/bitcoin/pull/28132) by a significant set of miners, Boltz is currently **not** accepting 0-conf transactions for Normal Submarine Swaps on the Bitcoin mainchain.
{% endhint %}

## Limits

Expand Down
33 changes: 22 additions & 11 deletions docs/api-v1.md
@@ -1,11 +1,12 @@
---
description: >-
This page lists all available endpoints of the legacy Boltz v1 API
description: This page lists all available endpoints of the deprecated Boltz API v1.
---

# 🤖 REST API v1
# 🤖 REST API v1 (deprecated)

> The API v1 is deprecated
{% hint style="info" %}
API v1 is maintained for existing integrations, we highly recommend using API v2 for all new integrations.
{% endhint %}

## Basics

Expand Down Expand Up @@ -208,7 +209,7 @@ For UTXO chains, `/createswap` requests have to contain one additional parameter

Responses also contain one additional value:

* `redeemScript`: redeem script from which the `address` is derived. The redeem script should be used, [to verify](dont-trust-verify#utxo-chain-address-verification) that Boltz did provide the correct address.
* `redeemScript`: redeem script from which the `address` is derived. The redeem script should be used, [to verify](dont-trust-verify.md#utxo-chain-address-verification) that Boltz did provide the correct address.

In case the address is for the Liquid Network, it will be blinded by a key that is also in the response:

Expand Down Expand Up @@ -250,7 +251,9 @@ Response:

### Normal Swaps: EVM Chains

> Currently, Boltz only supports RSK Testnet!
{% hint style="info" %}
Currently, Boltz only supports RSK Testnet.
{% endhint %}

Swaps from account-based EVM chains like RSK do not require a new address for every swap. `/createswap` takes the details of the swap (like lightning invoice and pair) and Boltz waits until the user locked e.g. RBTC in the contract. The addresses of those contracts can be queried with [`/getcontracts`](api-v1.md#swap-contracts) and the address of the contract that needs to be used for the swap is also returned in the response of this request.

Expand Down Expand Up @@ -469,7 +472,9 @@ In case the invoice amount was specified, the amount that will be locked in the

Boltz Backend finally features the so-called Prepay Miner Fee protocol that requires an invoice for network fees to be paid before the actual hold `invoice` of a Reverse Submarine Swap. If this protocol is enabled, the response object will also contain a `minerFeeInvoice`. Once the `minerFeeInvoice` is paid, Boltz will send the event `minerfee.paid` and when the actual hold `invoice` is paid, the chain bitcoin will be sent.

> Note: This protocol is a countermeasure against a specific attack vector and is currently _not_ enabled on Boltz Mainnet.
{% hint style="info" %}
This protocol is a countermeasure against a specific attack vector and is currently _not_ enabled on Boltz Mainnet.
{% endhint %}

### Reverse Swaps: UTXO Chains

Expand All @@ -479,7 +484,7 @@ For UTXO chains, `/createswap` requests have to contain one additional parameter

Responses also contain one additional value:

* `redeemScript`: Redeem script from which the lockup address is derived. The redeem script should be used, [to verify](dont-trust-verify#utxo-chain-address-verification) that Boltz didn't try to cheat by creating an address without a HTLC.
* `redeemScript`: Redeem script from which the lockup address is derived. The redeem script should be used, [to verify](dont-trust-verify.md#utxo-chain-address-verification) that Boltz didn't try to cheat by creating an address without a HTLC.

In case the lockup address is on the Liquid Network, it will be blinded by a key that is returned in the response too:

Expand Down Expand Up @@ -547,7 +552,9 @@ Response body:

### Reverse Swaps: EVM Chains

> Currently, Boltz only supports RSK Testnet!
{% hint style="info" %}
Currently, Boltz only supports RSK Testnet.
{% endhint %}

For EVM chains, `/createswap` requests have to contain one additional parameter:

Expand Down Expand Up @@ -600,7 +607,9 @@ Response body:

## Swap Status

_Before handling status events of this method it is recommended to read:_ [_Swap Types & States_](lifecycle.md)
{% hint style="info" %}
Before handling status events of this method, we recommended to read: [Swap Types & States](lifecycle.md)
{% endhint %}

To query the status of a swap one can use this endpoint which returns a `JSON` object containing the status of the swap. Possible states and status events are documented in the section [Swap Types & States](lifecycle.md)_._

Expand Down Expand Up @@ -781,7 +790,9 @@ Response:

## Swap Contracts

> Currently, Boltz only supports RSK Testnet!
{% hint style="info" %}
Currently, Boltz only supports RSK Testnet.
{% endhint %}

To query the addresses of contracts used by Boltz for swaps on EVM chains like RSK, the following endpoint can be queried:

Expand Down

0 comments on commit 4972f31

Please sign in to comment.