elements/src/script
Samuel Dobson db656db2ed
Merge #19136: wallet: add parent_desc to getaddressinfo
de6b389d5d tests: Test getaddressinfo parent_desc (Andrew Chow)
e4ac869a0a rpc: Add parent descriptor to getaddressinfo output (Andrew Chow)
bbe4a36152 wallet: Add GetDescriptorString to DescriptorScriptPubKeyMan (Andrew Chow)
9be1437c49 descriptors: Add ToNormalizedString and tests (Andrew Chow)

Pull request description:

  Adds `parent_desc` field to the `getaddressinfo` RPC to export a public descriptor. Using the given address, `getaddressinfo` will look up which `DescriptorScriptPubKeyMan` can be used to produce that address. It will then return the descriptor for that `DescriptorScriptPubKeyMan` in the `parent_desc` field. The descriptor will be in a normalized form where the xpub at the last hardened step is derived so that the descriptor can be imported to other wallets. Tests are added to check that the correct descriptor is being returned for the wallet's addresses and that these descriptors can be imported and used in other wallets.

  As part of this PR, a `ToNormalizedString` function is added to the descriptor classes. This really only has an effect on `BIP32PubkeyProvider`s that have hardened derivation steps. Tests are added to check that normalized descriptors are returned.

ACKs for top commit:
  Sjors:
    utACK de6b389d5d
  S3RK:
    Tested ACK de6b389
  jonatack:
    Tested ACK de6b389d5d modulo a few minor comments
  fjahr:
    Code review ACK de6b389d5d
  meshcollider:
    Tested ACK de6b389d5d

Tree-SHA512: a633e4a39f2abbd95afd7488484cfa66fdd2651dac59fe59f2b80a0940a2a4a13acf889c534a6948903d701484a2ba1218e3081feafe0b9a720dccfa9e43ca2b
2021-02-18 21:51:16 +13:00
..
bitcoinconsensus.cpp refactor: took out unused member functions 2020-09-22 14:41:15 +01:00
bitcoinconsensus.h build: test for __declspec(dllexport) in configure 2021-02-12 09:04:16 +08:00
descriptor.cpp Merge #19136: wallet: add parent_desc to getaddressinfo 2021-02-18 21:51:16 +13:00
descriptor.h descriptors: Add ToNormalizedString and tests 2020-10-09 09:04:13 -04:00
interpreter.cpp Don't declare de facto const member functions as non-const 2020-12-06 18:44:25 +00:00
interpreter.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
keyorigin.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
script.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
script.h Implement Tapscript script validation rules (BIP 342) 2020-10-12 17:18:24 -07:00
script_error.cpp Implement Tapscript script validation rules (BIP 342) 2020-10-12 17:18:24 -07:00
script_error.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
sigcache.cpp refactor: replace Boost shared_mutex with std shared_mutex in sigcache 2021-02-02 12:38:10 +08:00
sigcache.h Merge #19935: Move SaltedHashers to separate file and add some new ones 2021-01-13 08:49:17 +01:00
sign.cpp Merge #20211: Use -Wswitch for TxoutType where possible 2021-02-11 11:48:12 +01:00
sign.h Support for Schnorr signatures and integration in SignatureCheckers (BIP 340) 2020-10-12 17:15:40 -07:00
signingprovider.cpp Replace boost::variant with std::variant 2021-01-05 10:10:50 +01:00
signingprovider.h wallet: Improve LegacyScriptPubKeyMan::CanProvide script recognition 2020-02-12 11:48:30 -05:00
standard.cpp Merge #20211: Use -Wswitch for TxoutType where possible 2021-02-11 11:48:12 +01:00
standard.h Replace boost::variant with std::variant 2021-01-05 10:10:50 +01:00