Skip to content

Commit

Permalink
docs: update wallet description how-to
Browse files Browse the repository at this point in the history
  • Loading branch information
qustavo committed Oct 2, 2023
1 parent e2ccc2c commit bdb7914
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/how-to-guides/how-to-use-chainhooks-with-bitcoin.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,31 @@ Get any transaction, including a `p2wsh` output paying a given recipient:

`p2wsh` (Pay-to-Witness-Script-Hash) is a Bitcoin transaction output script type used in Segregated Witness (SegWit) that enables users to send funds to a hashed script, allowing for more complex transaction conditions and greater scalability by separating the script from the transaction data.

**Wallet Descriptors** provide a compact and semi-standardized method for describing how scripts and addresses within a wallet are generated. Chainhooks users that want to track addresses derived from an extended pubkey or a multisig-wallet for example, can now rely on this feature instead of defining one predicate per address.
For example if we wanted to track the first 3 addressed generated by the following descriptor:
```
wpkh(tprv8ZgxMBicQKsPePxn6j3TjvB2MBzQkuhGgc6oRh2WZancZQgxktcnjZJ44XdsRiw3jNkbVTK9JW6KFHvnRKgAMtSyuBevMJprSkZ4PTfmTgV/84'/1'/0'/0/*)
```
which reads: describe a P2WPKH output with the specified extended public key, and produces these BIP84 addresses:

```
bcrt1qzy2rdyvu8c57qd8exyyp0mw7dk5drsu9ewzdsu
bcrt1qsfsjnagr29m8h3a3vdand2s85cg4cefkcwk2fy
bcrt1qauewfytqe5mtr0xwp786r6fl39kmum2lr65kmj
```
The following predicate should be defined:
```json
{
"if_this": {
"scope": "outputs",
"descriptor": {
"expression": "wpkh(tprv8ZgxMBicQKsPePxn6j3TjvB2MBzQkuhGgc6oRh2WZancZQgxktcnjZJ44XdsRiw3jNkbVTK9JW6KFHvnRKgAMtSyuBevMJprSkZ4PTfmTgV/84'/1'/0'/0/*)",
"range": [0,3]
}
}
}
```

Get any Bitcoin transaction, including a Block commitment. Broadcasted payloads include _Proof of Transfer_ reward information:

```json
Expand Down

0 comments on commit bdb7914

Please sign in to comment.