9

When one sets up a transaction, the input of the transaction needs to have a script with a signature to show that you can spend those coins. Which fields of the previous and current transactions need to be concatenated into a message and signed to generate a proper signature? Can someone provide some examples?

ThePiachu
  • 43,091
  • 25
  • 139
  • 348
  • Does this thread give any help? http://bitcointalk.org/index.php?topic=50282.0 and verifier here: http://bitsend.rowit.co.uk – Stephen Gornick Mar 22 '12 at 02:56
  • @StephenGornick Well, it gives a couple examples of raw transactions and a way to verify them online, but still doesn't explain how to create such transactions without using the Bitcoin client. – ThePiachu Mar 22 '12 at 15:40
  • see 'Signatures & Witnesses' of the following link : https://medium.com/coinmonks/how-to-create-a-raw-bitcoin-transaction-step-by-step-239b888e87f2 – mkcisse Jan 30 '19 at 23:23

2 Answers2

3

Here and in the following articles I explain how to build and sign a Bitcoin transaction from scratch. There are also C code examples attached:

https://davidederosa.com/basic-blockchain-programming/inside-transactions/

keeshux
  • 386
  • 2
  • 7
2

This is done in the Javascript from BlockChain.info:

The transaction can then be sent using either of the following:

Stephen Gornick
  • 27,040
  • 12
  • 67
  • 141