Outputs of a btc transaction can be marked internal ("ours") or
external.
Before now, internal ones were forced to be change outputs, and the
keypath was validated to be a change keypath.
This commit changes this so that the output can be marked internal and
not be a change output, but a regular output of the same account.
The reason for this change is that some wallets supply the keypath
information to PSBTs even for non-change outputs of the same
account. Until now, e.g. in HWI, we checked if the keypath was
available for an output, and stripped it if it was a change keypath,
so the BitBox02 would not error out. With miniscript, such a check
becomes very difficult, as the change keypath does not need to be on
/1/*, but could be anywhere, e.g. in a policy like
wsh(pk/@0/<10;11>/*)), where the change output is at /11/*.
Outputs of a btc transaction can be marked internal ("ours") or external.
Before now, internal ones were forced to be change outputs, and the keypath was validated to be a change keypath.
This commit changes this so that the output can be marked internal and not be a change output, but a regular output of the same account.
The reason for this change is that some wallets supply the keypath information to PSBTs even for non-change outputs of the same account. Until now, e.g. in HWI, we checked if the keypath was available for an output, and stripped it if it was a change keypath, so the BitBox02 would not error out. With miniscript, such a check becomes very difficult, as the change keypath does not need to be on
/1/*
, but could be anywhere, e.g. in a policy likewsh(pk/@0/<10;11>/*))
, where the change output is at/11/*
.