-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Wallet Descriptor Support for Transaction Indexing
This introduces support for wallet descriptors. Descriptors provide a compact and semi-standardized method for describing how scripts and addresses within a wallet are generated[1]. 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 ``` we could use the following predicate: ```json ... "networks": { "regtest": { "if_this": { "scope": "outputs", "descriptor": { "expression": "wpkh(tprv8ZgxMBicQKsPePxn6j3TjvB2MBzQkuhGgc6oRh2WZancZQgxktcnjZJ44XdsRiw3jNkbVTK9JW6KFHvnRKgAMtSyuBevMJprSkZ4PTfmTgV/84'/1'/0'/0/*)", "range": [0,3] } }, "then_that": { "file_append": { "path": "txns.txt" } } } } ... ``` 1: https://bitcoindevkit.org/descriptors/
- Loading branch information
Showing
5 changed files
with
149 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters