Update documentation
This commit is contained in:
parent
e500d6873d
commit
6b35302026
10
README.md
10
README.md
@ -65,6 +65,16 @@ Check [this](https://github.com/trezor/blockbook/issues/89) or [this](https://gi
|
||||
|
||||
Your coin's block/transaction data may not be compatible with `BitcoinParser` `ParseBlock`/`ParseTx`, which is used by default. In that case, implement your coin in a similar way we used in case of [zcash](https://github.com/trezor/blockbook/tree/master/bchain/coins/zec) and some other coins. The principle is not to parse the block/transaction data in Blockbook but instead to get parsed transactions as json from the backend.
|
||||
|
||||
#### Cannot build Blockbook using `go build` command
|
||||
|
||||
When building Blockbook, I get error `not enough arguments in call to _Cfunc_rocksdb_approximate_sizes`.
|
||||
|
||||
RocksDB version 6.16.0 changed the API in backward incompatible way. It is necessary to build Blockbook with the tag `rocksdb_6_16`, which fixes the compatibility issue. The correct way to build Blockbook is:
|
||||
|
||||
```
|
||||
go build -tags rocksdb_6_16
|
||||
```
|
||||
|
||||
## Data storage in RocksDB
|
||||
|
||||
Blockbook stores data the key-value store RocksDB. Database format is described [here](/docs/rocksdb.md).
|
||||
|
||||
33
docs/api.md
33
docs/api.md
@ -331,16 +331,35 @@ Response:
|
||||
|
||||
#### Get xpub
|
||||
|
||||
Returns balances and transactions of an xpub, applicable only for Bitcoin-type coins.
|
||||
Returns balances and transactions of an xpub or output descriptor, applicable only for Bitcoin-type coins.
|
||||
|
||||
Blockbook supports BIP44, BIP49 and BIP84 derivation schemes. It expects xpub at level 3 derivation path, i.e. *m/purpose'/coin_type'/account'/*. Blockbook completes the *change/address_index* part of the path when deriving addresses.
|
||||
Blockbook supports BIP44, BIP49, BIP84 and BIP86 (Taproot) derivation schemes, using either xpubs or output descriptors (see https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md)
|
||||
|
||||
The BIP version is determined by the prefix of the xpub. The prefixes for each coin are defined by fields `xpub_magic`, `xpub_magic_segwit_p2sh`, `xpub_magic_segwit_native` in the [trezor-common](https://github.com/trezor/trezor-common/tree/master/defs/bitcoin) library. If the prefix is not recognized, Blockbook defaults to BIP44 derivation scheme.
|
||||
* Xpubs
|
||||
|
||||
Blockbook expects xpub at level 3 derivation path, i.e. *m/purpose'/coin_type'/account'/*. Blockbook completes the *change/address_index* part of the path when deriving addresses.
|
||||
The BIP version is determined by the prefix of the xpub. The prefixes for each coin are defined by fields `xpub_magic`, `xpub_magic_segwit_p2sh`, `xpub_magic_segwit_native` in the [trezor-common](https://github.com/trezor/trezor-common/tree/master/defs/bitcoin) library. If the prefix is not recognized, Blockbook defaults to BIP44 derivation scheme.
|
||||
|
||||
* Output descriptors
|
||||
|
||||
Output descriptors are in the form `<type>([<path>]<xpub>[/<change>/*])[#checkum]`, for example `pkh([5c9e228d/44'/0'/0']xpub6BgBgses...Mj92pReUsQ/<0;1>/*)#abcd`
|
||||
|
||||
Parameters `type` and `xpub` are mandatory, the rest is optional
|
||||
|
||||
Blockbook supports a limited set of `type`s:
|
||||
- BIP44: `pkh(xpub)`
|
||||
- BIP49: `sh(wpkh(xpub))`
|
||||
- BIP84: `wpkh(xpub)`
|
||||
- BIP86 (Taproot single key): `tr(xpub)`
|
||||
|
||||
Parameter `change` can be a single number or a list of change indexes, specified either in the format `<index1;index2;...>` or `{index1,index2,...}`. If the parameter `change` is not specified, Blockbook defaults to `<0;1>`.
|
||||
|
||||
|
||||
|
||||
The returned transactions are sorted by block height, newest blocks first.
|
||||
|
||||
```
|
||||
GET /api/v2/xpub/<xpub>[?page=<page>&pageSize=<size>&from=<block height>&to=<block height>&details=<basic|tokens|tokenBalances|txids|txs>&tokens=<nonzero|used|derived>]
|
||||
GET /api/v2/xpub/<xpub|descriptor>[?page=<page>&pageSize=<size>&from=<block height>&to=<block height>&details=<basic|tokens|tokenBalances|txids|txs>&tokens=<nonzero|used|derived>]
|
||||
```
|
||||
|
||||
The optional query parameters:
|
||||
@ -409,14 +428,14 @@ Note: *usedTokens* always returns total number of **used** addresses of xpub.
|
||||
|
||||
#### Get utxo
|
||||
|
||||
Returns array of unspent transaction outputs of address or xpub, applicable only for Bitcoin-type coins. By default, the list contains both confirmed and unconfirmed transactions. The query parameter *confirmed=true* disables return of unconfirmed transactions. The returned utxos are sorted by block height, newest blocks first. For xpubs the response also contains address and derivation path of the utxo.
|
||||
Returns array of unspent transaction outputs of address or xpub, applicable only for Bitcoin-type coins. By default, the list contains both confirmed and unconfirmed transactions. The query parameter *confirmed=true* disables return of unconfirmed transactions. The returned utxos are sorted by block height, newest blocks first. For xpubs or output descriptors, the response also contains address and derivation path of the utxo.
|
||||
|
||||
Unconfirmed utxos do not have field *height*, the field *confirmations* has value *0* and may contain field *lockTime*, if not zero.
|
||||
|
||||
Coinbase utxos do have field *coinbase* set to true, however due to performance reasons only up to minimum coinbase confirmations limit (100). After this limit, utxos are not detected as coinbase.
|
||||
Coinbase utxos have field *coinbase* set to true, however due to performance reasons only up to minimum coinbase confirmations limit (100). After this limit, utxos are not detected as coinbase.
|
||||
|
||||
```
|
||||
GET /api/v2/utxo/<address|xpub>[?confirmed=true]
|
||||
GET /api/v2/utxo/<address|xpub|descriptor>[?confirmed=true]
|
||||
```
|
||||
|
||||
Response:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user