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 asOutputType::BECH32M
.WtinessV1Taproot
andWitnessUnknown
are also classified asOutputType::BECH32M
.- Bech32m addresses are completely disabled for legacy wallets. They cannot be imported (explicitly disallowed in
importaddress
andimportmulti
), will not be created when getting all destinations for a pubkey, and will not be added withaddmultisigaddress
. Additional protections have been added toLegacyScriptPubKeyMan
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 atr()
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 bech32mScriptPubKeyMan
, falling back to bech32 if one is not available.