lbrycrd/src/qt
Jonas Schnelli d889c036cd
Merge #11403: SegWit wallet support
b224a47a1 Add address_types test (Pieter Wuille)
7ee54fd7c Support downgrading after recovered keypool witness keys (Pieter Wuille)
940a21932 SegWit wallet support (Pieter Wuille)
f37c64e47 Implicitly know about P2WPKH redeemscripts (Pieter Wuille)
57273f2b3 [test] Serialize CTransaction with witness by default (Pieter Wuille)
cf2c0b6f5 Support P2WPKH and P2SH-P2WPKH in dumpprivkey (Pieter Wuille)
37c03d3e0 Support P2WPKH addresses in create/addmultisig (Pieter Wuille)
3eaa003c8 Extend validateaddress information for P2SH-embedded witness (Pieter Wuille)
30a27dc5b Expose method to find key for a single-key destination (Pieter Wuille)
985c79552 Improve witness destination types and use them more (Pieter Wuille)
cbe197470 [refactor] GetAccount{PubKey,Address} -> GetAccountDestination (Pieter Wuille)
0c8ea6380 Abstract out IsSolvable from Witnessifier (Pieter Wuille)

Pull request description:

  This implements a minimum viable implementation of SegWit wallet support, based on top of #11389, and includes part of the functionality from #11089.

  Two new configuration options are added:
  * `-addresstype`, with options `legacy`, `p2sh`, and `bech32`. It controls what kind of addresses are produced by `getnewaddress`, `getaccountaddress`, and `createmultisigaddress`.
  * `-changetype`, with the same options, and by default equal to `-addresstype`, that controls what kind of change is used.

  All wallet private and public keys can be used for any type of address. Support for address types dependent on different derivation paths will need a major overhaul of how our internal detection of outputs work. I expect that that will happen for a next major version.

  The above also applies to imported keys, as having a distinction there but not for normal operations is a disaster for testing, and probably for comprehension of users. This has some ugly effects, like needing to associate the provided label to `importprivkey` with each style address for the corresponding key.

  To deal with witness outputs requiring a corresponding redeemscript in wallet, three approaches are used:
  * All SegWit addresses created through `getnewaddress` or multisig RPCs explicitly get their redeemscripts added to the wallet file. This means that downgrading after creating a witness address will work, as long as the wallet file is up to date.
  * All SegWit keys in the wallet get an _implicit_ redeemscript added, without it being written to the file. This means recovery of an old backup will work, as long as you use new software.
  * All keypool keys that are seen used in transactions explicitly get their redeemscripts added to the wallet files. This means that downgrading after recovering from a backup that includes a witness address will work.

  These approaches correspond to solutions 3a, 1a, and 5a respectively from https://gist.github.com/sipa/125cfa1615946d0c3f3eec2ad7f250a2. As argued there, there is no full solution for dealing with the case where you both downgrade and restore a backup, so that's also not implemented.

  `dumpwallet`, `importwallet`, `importmulti`, `signmessage` and `verifymessage` don't work with SegWit addresses yet. They're remaining TODOs, for this PR or a follow-up. Because of that, several tests unexpectedly run with `-addresstype=legacy` for now.

Tree-SHA512: d425dbe517c0422061ab8dacdc3a6ae47da071450932ed992c79559d922dff7b2574a31a8c94feccd3761c1dffb6422c50055e6dca8e3cf94a169bc95e39e959
2018-01-10 20:55:41 -10:00
..
forms [Wallet] Use RBF by default in QT only 2017-12-22 09:18:05 +01:00
locale qt: Periodic translations update 2017-08-09 12:04:41 +02:00
res [qt] Make network disabled icon 50% opaque 2016-11-13 22:06:35 +01:00
test Merge #11403: SegWit wallet support 2018-01-10 20:55:41 -10:00
addressbookpage.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
addressbookpage.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
addresstablemodel.cpp Merge #11403: SegWit wallet support 2018-01-10 20:55:41 -10:00
addresstablemodel.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
askpassphrasedialog.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
askpassphrasedialog.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
bantablemodel.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
bantablemodel.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
bitcoin.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
bitcoin.qrc Overhaul network activity toggle 2016-10-24 10:23:58 +00:00
bitcoin_locale.qrc qt: periodic translations update 2017-01-10 12:52:02 +01:00
bitcoinaddressvalidator.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
bitcoinaddressvalidator.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
bitcoinamountfield.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
bitcoinamountfield.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
bitcoingui.cpp Merge #12035: [qt] change µBTC to bits 2018-01-03 22:16:13 -10:00
bitcoingui.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
bitcoinstrings.cpp qt: Periodic translations update 2017-07-31 12:19:05 +02:00
bitcoinunits.cpp Merge #12035: [qt] change µBTC to bits 2018-01-03 22:16:13 -10:00
bitcoinunits.h Merge #12035: [qt] change µBTC to bits 2018-01-03 22:16:13 -10:00
callback.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
clientmodel.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
clientmodel.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
coincontroldialog.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
coincontroldialog.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
coincontroltreewidget.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
coincontroltreewidget.h Bump copyright headers to 2014 2016-01-05 21:01:39 +01:00
csvmodelwriter.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
csvmodelwriter.h Bump copyright headers to 2014 2016-01-05 21:01:39 +01:00
editaddressdialog.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
editaddressdialog.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
guiconstants.h Increment MIT Licence copyright header year on files modified in 2016 2016-12-31 11:01:21 -07:00
guiutil.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
guiutil.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
intro.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
intro.h Increment MIT Licence copyright header year on files modified in 2016 2016-12-31 11:01:21 -07:00
macdockiconhandler.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
macdockiconhandler.mm Document the preference of nullptr over NULL or (void*)0 2017-08-18 09:51:00 +02:00
macnotificationhandler.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
macnotificationhandler.mm [macOS] remove Growl support, remove unused code 2017-09-07 10:11:44 -07:00
Makefile build: add stub makefiles for easier subdir builds 2014-06-05 16:05:43 -04:00
modaloverlay.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
modaloverlay.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
networkstyle.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
networkstyle.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
notificator.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
notificator.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
openuridialog.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
openuridialog.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
optionsdialog.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
optionsdialog.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
optionsmodel.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
optionsmodel.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
overviewpage.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
overviewpage.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
paymentrequest.proto Specify Protobuf version 2 in paymentrequest.proto 2016-09-16 11:45:08 +08:00
paymentrequestplus.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
paymentrequestplus.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
paymentserver.cpp Merge #11403: SegWit wallet support 2018-01-10 20:55:41 -10:00
paymentserver.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
peertablemodel.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
peertablemodel.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
platformstyle.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
platformstyle.h qt: Introduce PlatformStyle 2015-07-31 09:35:18 +02:00
qvalidatedlineedit.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
qvalidatedlineedit.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
qvaluecombobox.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
qvaluecombobox.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
receivecoinsdialog.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
receivecoinsdialog.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
receiverequestdialog.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
receiverequestdialog.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
recentrequeststablemodel.cpp Merge #12035: [qt] change µBTC to bits 2018-01-03 22:16:13 -10:00
recentrequeststablemodel.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
rpcconsole.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
rpcconsole.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
sendcoinsdialog.cpp Replaces numbered place marker %2 with %1. 2018-01-04 20:57:22 +01:00
sendcoinsdialog.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
sendcoinsentry.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
sendcoinsentry.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
signverifymessagedialog.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
signverifymessagedialog.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
splashscreen.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
splashscreen.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
trafficgraphwidget.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
trafficgraphwidget.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
transactiondesc.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
transactiondesc.h Bump copyright headers to 2014 2016-01-05 21:01:39 +01:00
transactiondescdialog.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
transactiondescdialog.h Bump copyright headers to 2014 2016-01-05 21:01:39 +01:00
transactionfilterproxy.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
transactionfilterproxy.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
transactionrecord.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
transactionrecord.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
transactiontablemodel.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
transactiontablemodel.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
transactionview.cpp Merge #12074: [qt] Optimizes boolean expression model && model->haveWatchOnly() 2018-01-03 21:58:46 -10:00
transactionview.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
utilitydialog.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
utilitydialog.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
walletframe.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
walletframe.h Increment MIT Licence copyright header year on files modified in 2016 2016-12-31 11:01:21 -07:00
walletmodel.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
walletmodel.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
walletmodeltransaction.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
walletmodeltransaction.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
walletview.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
walletview.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
winshutdownmonitor.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
winshutdownmonitor.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00