Now one thing that sticks out here, that I like to start our discussion with is, where in LB to implement the segwit addresses (i.e. P2WPKH and P2WSH).
All layers of LibBitcoin (e.g. client/server API etc.) use payment_address for describing a Bitcoin address.
With segwit, Bitcoin address now doesn't only mean P2PKH and P2SH, but also native (as bech32) and P2SH-wrapped (as p2sh) P2WPKH and P2WSH address.
Expectably of course the bech32 P2WPKH and P2WSH will be the more common addresses.
Our first thought was, let's make a witness_address class to describe this stuff.
But, second thought is, isn't Bitcoin a segwit phenomenon altogether now so we can as well just extend payment_address with segwit functionality?
As all LibBitcoin tooling does, and most dependencies likely do, want segwit template and address support, then with its introduction there will be code updates spread over all LB and dependency codebases anyhow.
payment_address can become a hybrid structure for both non-segwit and segwit addresses.
What are your thoughts on this topic?
Is there a goal, or not, in having LibBitcoin compile-able without segwit support and a separate witness_address class being needed for some such reason?