Beispiel #1
0
 public static PrivateKey FromWIF(String s)
 {
     Byte[] b = Base58CheckString.ToByteArray(s);
     if (b.Length == 0x20)
     {
         return(new PrivateKey(b, false));
     }
     else if (b.Length == 0x21)
     {
         return(new PrivateKey(b.Take(0x20).ToArray(), true));
     }
     else
     {
         throw new ArgumentException("Invalid WIF Private Key");
     }
 }
Beispiel #2
0
        private Byte calcHash()
        {
            Byte version;

            Byte[] hash = Base58CheckString.ToByteArray(this.ToString(), out version);
            switch (version)
            {
            case PUBKEYHASH:
                pubKeyHash = hash;
                break;

            case SCRIPTHASH:
                scriptHash = hash;
                break;
            }
            type = version;
            return(version);
        }