private static string NotNull(WitKeyId segwitKeyId) { if (segwitKeyId == null) { throw new ArgumentNullException("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 BitcoinWitPubKeyAddress(WitKeyId segwitKeyId, Network network) : base(NotNull(segwitKeyId) ?? Network.CreateBech32(Bech32Type.WITNESS_PUBKEY_ADDRESS, segwitKeyId.ToBytes(), 0, network), network) { _Hash = segwitKeyId; }