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.
WIF
is 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 keyWIF
into 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
WIF
to a wallet.
Private keys can be associated with public keys that are either compressed (
33
bytes) or uncompressed (65
bytes), and theWIF
will be different if compressed/uncompressed. For instance, compressed public keys start withL
orK
on Mainnet andc
on Testnet, whilst uncompressed public keys start with5
on Mainnet and9
on Testnet.You can modify your code sample above to use uncompressed public keys (the default is compressed):
var key = new Key(fCompressedIn: false); // ...