Пример #1
0
 public override void WriteToBitcoinBuffer(byte[] buffer, int offset)
 {
     Version.WriteBytes(buffer, offset);
     TxIns.WriteToBitcoinBuffer(buffer, TxIns_Offset(ref offset));
     TxOuts.WriteToBitcoinBuffer(buffer, TxOuts_Offset(ref offset));
     LockTime.WriteBytes(buffer, LockTime_Offset(ref offset));
 }
Пример #2
0
        public void Sign(byte[] privateKey)
        {
            var publicKey = BitcoinHelper.CreatePublicKeyFromPrivate(privateKey);

            var transactionHash = ComputeHashBeforeSigning();

            var signature = BitcoinHelper.Sign(transactionHash, privateKey);

            TxIns.First().CreateSignatureScript(signature, publicKey);
        }