Notes:
- the linter part of the code is not applicable. We got rid of that linter in D11063 as it was obviously not very good at its job.
- most of the work was already done in D6549
- some of these constructors have two parameters in Bitcoin ABC
This is a backport of core#20530
https://github.com/bitcoin/bitcoin/pull/20530/commits/1e62350ca20898189904a88dfef9ea11ddcd8626