I'm trying to build a transaction using Nbitcoin. When I run this line there is an error parsing the address. It runs fine with segwit addresses starting with a 1, but not native segwit.
Using System;
Using System.Text;
Using NBitcoin;
static void Main(string[] args) {
var wallet = new BitcoinPubKeyAddress("bc1q....", Network.Main); //throws error
}
Error: System.FormatException: 'Invalid base58 data'
Is there a way to use native segwit with Nbitcoin? Thanks