public static bool IsValidPublicKey(string hex) { byte[] pubKeyBytes = Bitcoin.HexStringToBytes(hex); PublicKey pk = new PublicKey(); string result = pk.constructFromBytes(pubKeyBytes); return (result == null); }