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?


2 Answers 2


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:



This is done in the Javascript from BlockChain.info:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.