user111688: So I wrote a vanity address generator in c# with the NBitcoin lib. When I use the private key used to generate the address and input it in Mycelium it outputs a different address. This does not occur when working with legacy addresses, so I'm guessing I need something more than just a private key in order to generate a segwit address. Was it a redeem script or something? How can I make sure I get the same address in a wallet when I input the privkey?

user-1:             var bitcoinPrivateKey = new BitcoinSecret("cPof7e5g6xfgB6AZrc6XVTVwA4efLJurh9kVxa6FRChbr8Jyqaon", Network.TestNet);

            var legacy_address = bitcoinPrivateKey.GetAddress(ScriptPubKeyType.Legacy);
            var segwitp2sh_address = bitcoinPrivateKey.GetAddress(ScriptPubKeyType.SegwitP2SH);
            var nativesegwit_address = bitcoinPrivateKey.GetAddress(ScriptPubKeyType.Segwit);

            Console.WriteLine("Private Key :" + bitcoinPrivateKey);
            Console.WriteLine("Legacy Address :" + legacy_address);
            Console.WriteLine("Segwit-P2SH Address :" + segwitp2sh_address);
            Console.WriteLine("Bech32 Address :" + nativesegwit_address);


Mycelium testnet bitcoin wallet:


111688: <p>So I wrote a vanity address generator in c# with the NBitcoin lib. When I use the private key used to generate the address and input it in Mycelium it outputs a different address. This does not occur when working with legacy addresses, so I'm guessing I need something more than just a private key in order to generate a segwit address. Was it a redeem script or something? How can I make sure I get the same address in a wallet when I input the privkey?</p>
 -1: <pre><code>            var bitcoinPrivateKey = new BitcoinSecret(&quot;cPof7e5g6xfgB6AZrc6XVTVwA4efLJurh9kVxa6FRChbr8Jyqaon&quot;, Network.TestNet);

            var legacy_address = bitcoinPrivateKey.GetAddress(ScriptPubKeyType.Legacy);
            var segwitp2sh_address = bitcoinPrivateKey.GetAddress(ScriptPubKeyType.SegwitP2SH);
            var nativesegwit_address = bitcoinPrivateKey.GetAddress(ScriptPubKeyType.Segwit);

            Console.WriteLine(&quot;Private Key :&quot; + bitcoinPrivateKey);
            Console.WriteLine(&quot;Legacy Address :&quot; + legacy_address);
            Console.WriteLine(&quot;Segwit-P2SH Address :&quot; + segwitp2sh_address);
            Console.WriteLine(&quot;Bech32 Address :&quot; + nativesegwit_address);
</code></pre>
<p><a href="https://i.stack.imgur.com/qRVM4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qRVM4.png" alt="output" /></a></p>
<p><a href="https://play.google.com/store/apps/details?id=com.mycelium.testnetwallet" rel="nofollow noreferrer">Mycelium</a> testnet bitcoin wallet:</p>
<p><a href="https://i.stack.imgur.com/j3nG9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j3nG9.png" alt="mycelium" /></a></p>
