public Transaction(Output[] Outputs, string Id = null) { this.Id = Id ?? HashUtil.Sha1(RandomUtil.Bytes()); this.Outputs = Outputs; Type = TransactionType.REWARD; InputsConcatenated = Inputs.Map(In => In.ToString()).Reduce(R.Concat, ""); OutputsConcatenated = Outputs.Map(Out => Out.ToString()).Reduce(R.Concat, ""); }
public void Sign(SharpKeyPair Skp) { Signature = Skp.Sign(HashUtil.Sha1(ToString())); }
public bool Verify() { return(Signature.Verify(HashUtil.Sha1(ToString())) && Inputs.All(In => In.Verify())); }