walletrpc+lnwallet: possibility to define an address type for changes in FundPsbt

By default, P2TR addresses are used for changes. However, some users
might encounter some problems with this change. We add the possibility
to define a custom address type in FundPsbt for default/imported accounts
(only P2TR for now). If no address type is specified for these accounts,
we will use P2WKH by default.
This commit is contained in:
Torakushi committed 2023-02-08 12:35:44 +01:00
1 parent 3bb68661e7
commit cdb015223b
9 files changed
+625 -413

No files matched your search

+13
View File
@@ -1291,6 +1291,15 @@
"walletrpcBumpFeeResponse": {
"type": "object"
},
"walletrpcChangeAddressType": {
"type": "string",
"enum": [
"CHANGE_ADDRESS_TYPE_UNSPECIFIED",
"CHANGE_ADDRESS_TYPE_P2TR"
],
"default": "CHANGE_ADDRESS_TYPE_UNSPECIFIED",
"description": "The possible change address types for default accounts and single imported\npublic keys. By default, P2WPKH will be used. We don't provide the\npossibility to choose P2PKH as it is a legacy key scope, nor NP2WPKH as\nno key scope permits to do so. For custom accounts, no change type should\nbe provided as the coin selection key scope will always be used to generate\nthe change address.\n\n - CHANGE_ADDRESS_TYPE_UNSPECIFIED: CHANGE_ADDRESS_TYPE_UNSPECIFIED indicates that no change address type is\nprovided. We will then use P2WPKH address type for change (BIP0084 key\nscope).\n - CHANGE_ADDRESS_TYPE_P2TR: CHANGE_ADDRESS_TYPE_P2TR indicates to use P2TR address for change output\n(BIP0086 key scope)."
},
"walletrpcEstimateFeeResponse": {
"type": "object",
"properties": {
@@ -1364,6 +1373,10 @@
"spend_unconfirmed": {
"type": "boolean",
"description": "Whether unconfirmed outputs should be used as inputs for the transaction."
},
"change_type": {
"$ref": "#/definitions/walletrpcChangeAddressType",
"description": "The address type for the change. If empty, P2WPKH addresses will be used\nfor default accounts and single imported public keys. For custom\naccounts, no change type should be provided as the coin selection key\nscope will always be used to generate the change address."
}
}
},