HomePhabricator

SegWit wallet support

Description

SegWit wallet support

Summary:
This introduces two command line flags (-addresstype and -changetype) which control
the type of addresses/outputs created by the GUI and RPCs. Certain RPCs allow
overriding these (getnewaddress and getrawchangeaddress). Supported types
are "legacy" (P2PKH and P2SH-multisig), "p2sh-segwit" (P2SH-P2WPKH and P2SH-P2WSH-multisig),
and "bech32" (P2WPKH and P2WSH-multisig).

A few utility functions are added to the wallet to construct different address type
and to add the necessary entries to the wallet file to be compatible with earlier
versions (see CWallet::LearnRelatedScripts, GetDestinationForKey,
GetAllDestinationsForKey, CWallet::AddAndGetDestinationForScript).

This is a partial backport of Core PR11403 : https://github.com/bitcoin/bitcoin/pull/11403/commits/940a21932ba769ba5829cba713579db84f96d2f8

Because we just have one address type to support, we don't need to add new configuration parameters like in the original code.

Depends on D3129, D3131 and D3132

Test Plan:

make check
./test/functional/test_runner.py

Reviewers: #bitcoin_abc, markblundeberg

Reviewed By: #bitcoin_abc, markblundeberg

Subscribers: markblundeberg

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

Details

Provenance
Pieter Wuille <pieter.wuille@gmail.com>Authored on Dec 1 2017, 00:49
deadalnixCommitted on May 28 2019, 14:09
markblundebergPushed on May 28 2019, 16:11
Reviewer
Restricted Project
Differential Revision
D3133: SegWit wallet support
Parents
rSTAGING1d6c9eac7c10: [CMAKE] Fix Miniupnpc error message
Branches
Unknown
Tags
Unknown