private static string NotNull(WitKeyId segwitKeyId)
 {
     if (segwitKeyId == null)
     {
         throw new ArgumentNullException(nameof(segwitKeyId));
     }
     return(null);
 }
        public BitcoinWitPubKeyAddress(string bech32, Network expectedNetwork = null)
            : base(Validate(bech32, ref expectedNetwork), expectedNetwork)
        {
            var  encoder = expectedNetwork.GetBech32Encoder(Bech32Type.WITNESS_PUBKEY_ADDRESS, true);
            byte witVersion;
            var  decoded = encoder.Decode(bech32, out witVersion);

            _Hash = new WitKeyId(decoded);
        }
 public Script GenerateScriptPubKey(WitKeyId pubkeyHash)
 {
     return(pubkeyHash.ScriptPubKey);
 }
 public virtual BitcoinAddress CreateP2WPKH(WitKeyId witKeyId, Network network)
 {
     return(new BitcoinWitPubKeyAddress(witKeyId, network));
 }
 public BitcoinWitPubKeyAddress(WitKeyId segwitKeyId, Network network) :
     base(NotNull(segwitKeyId) ?? Network.CreateBech32(Bech32Type.WITNESS_PUBKEY_ADDRESS, segwitKeyId.ToBytes(), 0, network), network)
 {
     _Hash = segwitKeyId;
 }