HomePhabricator

[backport#15024] Allow specific private keys to be derived from descriptor

Description

[backport#15024] Allow specific private keys to be derived from descriptor

Summary:
53b7de629d3d9281dc6f8fa10e32c4cdec59c140 Add test for dumping the private key imported from descriptor (MeshCollider)
2857bc4a64cc8dc7914bc984ac878397ac64292d Extend importmulti descriptor tests (MeshCollider)
81a884bbd0dbee108d11776794d9627ca07504aa Import private keys from descriptor with importmulti if provided (MeshCollider)
a4d1bd1a29be2dcc5e00c63b6b41916b1c466de0 Add private key derivation functions to descriptors (MeshCollider)

Pull request description:

~This is based on #14491, review the last 3 commits only.~

Currently, descriptors have an Expand() function which returns public keys and scripts for a specific index of a ranged descriptor. But the private key for a specific index is not given. This allows private keys for specific indices to be derived. This also allows those keys to be imported through the `importmulti` RPC rather than having to provide them separately.

Backport of Core PR15024

Test Plan:

ninja all check check-functional

afaict, either this functionality is unavailable for legacy addresses or Core didn't add tests aside from sh(wpkh()) descriptors

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: PiRK, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7804

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on Jun 7 2019, 13:40
majcostaCommitted on Nov 12 2020, 20:49
majcostaPushed on Nov 12 2020, 20:49
Reviewer
Restricted Project
Differential Revision
D7804: [backport#15024] Allow specific private keys to be derived from descriptor
Parents
rABC09cc5afe4fb7: Add test for descriptor ranges in wallet_importmulti.py
Branches
Unknown
Tags
Unknown