private static byte[] signTransaction2Byte(byte[] transaction, byte[] privateKey) { ECKey ecKey = ECKey.FromPrivate(privateKey); Transaction transaction1 = Transaction.Parser.ParseFrom(transaction); byte[] rawdata = transaction1.RawData.ToByteArray(); byte[] hash = Sha256Keccak.Hash(rawdata); byte[] sign = ecKey.GetSignature(hash); Transaction clone = transaction1.Clone(); clone.Signature.Add(ByteString.CopyFrom(sign)); return(clone.ToByteArray()); }