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