0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-06 10:18:44 -05:00
bitcoin-bitcoin-core/src/wallet
W. J. van der Laan 0553d75268
Merge bitcoin/bitcoin#22154: Add OutputType::BECH32M and related wallet support for fetching bech32m addresses
754f134a50 wallet: Add error message to GetReservedDestination (Andrew Chow)
87a0e7a3b7 Disallow bech32m addresses for legacy wallet things (Andrew Chow)
6dbe4d1072 Use BECH32M for tr() desc, WitV1Taproot, and WitUnknown CTxDests (Andrew Chow)
699dfcd8ad Opportunistically use bech32m change addresses if available (Andrew Chow)
0262536c34 Add OutputType::BECH32M (Andrew Chow)
177c15d2f7 Limit LegacyScriptPubKeyMan address types (Andrew Chow)

Pull request description:

  Currently bech32m addresses are classfied as bech32. Because bech32m is incompatible with bech32, we need to define a new `OutputType` for it so that it can be handled correctly. This PR adds `OutputType::BECH32M`, updates all of the relevant `OutputType` classifications, and handle requests for bech32m addresses. There is now a `bech32m` address type string that can be used.

  * `tr()` descriptors now report their output type as `OutputType::BECH32M`. `WtinessV1Taproot` and `WitnessUnknown` are also classified as `OutputType::BECH32M`.
  * Bech32m addresses are completely disabled for legacy wallets. They cannot be imported (explicitly disallowed in `importaddress` and `importmulti`), will not be created when getting all destinations for a pubkey, and will not be added with `addmultisigaddress`. Additional protections have been added to `LegacyScriptPubKeyMan` to disallow attempting to retrieve bech32m addresses.
  * Since Taproot multisigs are not implemented yet, `createmultisig` will also disallow the bech32m address type.
  * As Taproot is not yet active, `DescriptorScriptPubKeyMan` cannot and will not create a `tr()` descriptor. Protections have been added to make sure this cannot occur.
  * The change address type detection algorithm has been updated to return `bech32m` when there is a segwit v1+ output script and the wallet has a bech32m `ScriptPubKeyMan`, falling back to bech32 if one is not available.

ACKs for top commit:
  laanwj:
    re-review ACK 754f134a50
  Sjors:
    re-utACK 754f134: only change is switching to `bech32m` in two `wallet_taproot.py` test cases.
  fjahr:
    re-ACK 754f134a50
  jonatack:
    ACK 754f134a50

Tree-SHA512: 6ea90867d3631d0d438e2b08ce6ed930f37d01323224661e8e38f183ea5ee2ab65b5891394a3612c7382a1aff907b457616c6725665a10c320174017b998ca9f
2021-06-24 14:20:28 +02:00
..
test Construct and use PrecomputedTransactionData in PSBT signing 2021-06-12 12:25:28 -07:00
bdb.cpp scripted-diff: remove MakeUnique<T>() 2021-03-11 13:45:14 +08:00
bdb.h wallet: Add BerkeleyDB version sanity check at init time 2021-01-17 18:10:20 +01:00
coincontrol.cpp refactor: Drop CCoinControl::SetNull 2021-04-18 21:10:47 +01:00
coincontrol.h rpc: include_unsafe option for fundrawtransaction 2021-04-30 18:53:47 +02:00
coinselection.cpp Have OutputGroup determine the value to use 2021-05-19 15:35:11 -04:00
coinselection.h Have OutputGroup determine the value to use 2021-05-19 15:35:11 -04:00
context.cpp Remove g_rpc_chain global 2020-05-28 02:13:19 -04:00
context.h wallet: Pass unused args to StartWallets 2020-07-09 13:07:37 +02:00
crypter.cpp refactor: Replace &foo[0] with foo.data() 2021-05-04 06:55:31 +02:00
crypter.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
db.cpp Merge bitcoin/bitcoin#21944: wallet: Fix issues when walletdir is root directory 2021-06-09 22:53:36 +12:00
db.h refactor: post Optional<> removal cleanups 2021-03-17 14:56:20 +08:00
dump.cpp refactor: move first run detection to client code 2021-05-19 08:50:16 +02:00
dump.h wallettool: Add createfromdump command 2020-12-16 12:33:06 -05:00
external_signer_scriptpubkeyman.cpp Merge bitcoin/bitcoin#21365: Basic Taproot signing support for descriptor wallets 2021-06-18 09:12:44 +12:00
external_signer_scriptpubkeyman.h Merge bitcoin/bitcoin#21365: Basic Taproot signing support for descriptor wallets 2021-06-18 09:12:44 +12:00
feebumper.cpp Replace size/weight estimate tuple with struct for named fields 2021-05-26 07:33:09 +08:00
feebumper.h
fees.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
fees.h
init.cpp Merge bitcoin/bitcoin#18418: wallet: Increase OUTPUT_GROUP_MAX_ENTRIES to 100 2021-05-26 19:32:51 +08:00
interfaces.cpp Rearrange fillPSBT arguments 2021-06-10 10:58:45 -04:00
ismine.h doc: Add developer documentation to isminetype 2021-01-19 19:04:45 +08:00
load.cpp scripted-diff: Fix ellipsis after pr20773 2021-05-27 13:46:36 +03:00
load.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
receive.cpp MOVEONLY: CWallet transaction code out of wallet.cpp/.h 2021-05-26 06:32:51 -05:00
receive.h MOVEONLY: CWallet transaction code out of wallet.cpp/.h 2021-05-26 06:32:51 -05:00
rpcdump.cpp Disallow bech32m addresses for legacy wallet things 2021-06-22 21:57:04 -04:00
rpcwallet.cpp Merge bitcoin/bitcoin#22154: Add OutputType::BECH32M and related wallet support for fetching bech32m addresses 2021-06-24 14:20:28 +02:00
rpcwallet.h refactor: replace util::Ref by std::any (C++17) 2021-03-29 23:29:42 +02:00
salvage.cpp refactor: Replace &foo[0] with foo.data() 2021-05-04 06:55:31 +02:00
salvage.h wallettool: Have RecoverDatabaseFile return errors and warnings 2020-07-26 20:22:45 -04:00
scriptpubkeyman.cpp wallet: Add error message to GetReservedDestination 2021-06-22 21:57:04 -04:00
scriptpubkeyman.h wallet: Add error message to GetReservedDestination 2021-06-22 21:57:04 -04:00
spend.cpp wallet: Add error message to GetReservedDestination 2021-06-22 21:57:04 -04:00
spend.h MOVEONLY: CWallet transaction code out of wallet.cpp/.h 2021-05-26 06:32:51 -05:00
sqlite.cpp wallet: refactor: dedup sqlite PRAGMA assignments 2021-05-17 17:22:36 +02:00
sqlite.h doc: fix various typos 2021-01-04 12:31:31 +08:00
transaction.cpp MOVEONLY: CWallet transaction code out of wallet.cpp/.h 2021-05-26 06:32:51 -05:00
transaction.h refactor: Switch serialize to uint8_t (1/n) 2021-05-31 14:56:17 +02:00
wallet.cpp wallet: Add error message to GetReservedDestination 2021-06-22 21:57:04 -04:00
wallet.h wallet: Add error message to GetReservedDestination 2021-06-22 21:57:04 -04:00
walletdb.cpp Do not load external signers wallets when unsupported 2021-06-06 13:52:27 -04:00
walletdb.h Include wallet/bdb.h where it is actually being used 2020-11-18 11:55:43 -05:00
wallettool.cpp refactor: move first run detection to client code 2021-05-19 08:50:16 +02:00
wallettool.h refactor: Move all command dependend checks to ExecuteWalletToolFunc 2021-01-21 19:30:34 +01:00
walletutil.cpp scripted-diff: Replace GetDataDir() calls with gArgs.GetDataDirNet() calls 2021-05-24 10:29:58 +02:00
walletutil.h wallet: add external_signer flag 2021-02-23 14:34:30 +01:00