Every transaction takes unspent outputs as inputs and creates new outputs. The creator of the transaction uses his private key to sign the transaction and nodes validate that transaction by using the public key of the creator.
But how excactly are transactions formated? I have seen this on the bitcoin wiki:
Input:
Previous tx: f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6
Index: 0
scriptSig: 304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d10
90db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501
Output:
Value: 5000000000
scriptPubKey: OP_DUP OP_HASH160 404371705fa9bd789a2fcd52d2c580b65d35549d
OP_EQUALVERIFY OP_CHECKSIG
If we use this transaction as an example, how do we take the data from this and format it into a RAW signed transaction that I could send straight into the network without the need of a wallet?
Also, after creating the signed RAW transaction, is it just hashed by SHA256 to create its hash ID or does creating the ID consist of other steps?
Lastly, what is scriptSig? I don't quiet understand scripts in general so if someone could give me a brief explanation of that as well I'd be grateful
Thanks in advance!
Fihdi