HomePhabricator

Merge #12714: Introduce interface for signing providers

Description

Merge #12714: Introduce interface for signing providers

Summary:
d40f06a Introduce interface for signing providers (Pieter Wuille)

Pull request description:

`CKeyStore` is a rich interface that provides many features, including knowledge of scripts and pubkeys for solving, private keys for signing, in addition to watch-only keys and scripts, and distinguishing lack of keys from them just being encrypted.

The signing logic in script/sign does not actually need most of these features. Here we introduce a simpler interface (`SigningProvider`) which *only* provides keys and scripts. This is actually sufficient for signing.

In addtion, we swap the dependency between keystore and script/sign (keystore now depends on script/script with `CKeyStore` deriving from `SigningProvider`, rather than `CKeyStore` being the interface that signing relies on).

This is a very early step towards the design in https://gist.github.com/sipa/125cfa1615946d0c3f3eec2ad7f250a2, separating the concern between deciding what outputs are ours and signing.

Tree-SHA512: d511b7b03eec0e513530db1d9ae5aacf6d0bfa1d3e1c03d06c5bde396bafb5824c4491b227d32bcda9288530caf49835da18e846ccf66538d6c0cc6ae27291c9

Backport of Core PR12714
https://github.com/bitcoin/bitcoin/pull/12714/

Test Plan:

make check
test_runner.py

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

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

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on Mar 27 2018, 18:16
nakihitoCommitted on Aug 19 2019, 20:30
nakihitoPushed on Aug 19 2019, 20:30
Reviewer
Restricted Owners Package
Differential Revision
D3888: Merge #12714: Introduce interface for signing providers
Parents
rABCf1d523c99830: Merge #12762: Make CKeyStore an interface
Branches
Unknown
Tags
Unknown