Question was posted & answered on the NBitcoin repo, so copying my answers here for the benefit of SE members:
This is a Blockchain.com-specific UX issue… They technically could generate a Segwit address, but they default to
P2PKH(legacy) at the moment.
WIFis an old format that doesn’t carry metadata about the kind of address that should be unwrapped from the private key, so when you import a private key
WIFinto a wallet, it’s up to the wallet to decide what kind of address to give you for that private key.
ps: Some wallets are “smart” and check all possible addresses (Legacy, Segwit, SegwitP2SH, …) and then pick whichever one has a balance, so you might want to put some satoshis on the Segwit address that you create before importing the private key
WIFto a wallet.
Private keys can be associated with public keys that are either compressed (
33bytes) or uncompressed (
65bytes), and the
WIFwill be different if compressed/uncompressed. For instance, compressed public keys start with
Kon Mainnet and
con Testnet, whilst uncompressed public keys start with
5on Mainnet and
You can modify your code sample above to use uncompressed public keys (the default is compressed):
var key = new Key(fCompressedIn: false); // ...