Exemple #1
0
        public static byte[] GetScriptHashFromScript(byte[] script)
        {
            var scripthash = sha256.ComputeHash(script);

            scripthash = ripemd160.ComputeHash(scripthash);
            return(scripthash);
        }
Exemple #2
0
        public static byte[] GetScriptHashFromPublicKey(byte[] publicKey)
        {
            byte[] script     = GetScriptFromPublicKey(publicKey);
            var    scripthash = sha256.ComputeHash(script);

            scripthash = ripemd160.ComputeHash(scripthash);
            return(scripthash);
        }
Exemple #3
0
        public static Hash160 GetScriptHashFromScript(byte[] script)
        {
            System.Security.Cryptography.SHA256 sha256 = getSha256();
            var scripthash             = sha256.ComputeHash(script);
            RIPEMD160Managed ripemd160 = getRipemd160();

            scripthash = ripemd160.ComputeHash(scripthash);
            return(scripthash);
        }