How would I hand code a Bitcoin transaction Form the Bitcoin Wiki - Transactions I see a transaction has the following format.

Input:
Previous tx: f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6
Index: 0
scriptSig: 304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d10
90db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501

Output:
Value: 5000000000
scriptPubKey: OP_DUP OP_HASH160 404371705fa9bd789a2fcd52d2c580b65d35549d
OP_EQUALVERIFY OP_CHECKSIG


The input in this transaction imports 50 BTC from output #0 in transaction f5d8... Then the output sends 50 BTC to a Bitcoin address (expressed here in hexadecimal 4043... instead of the normal base58). When the recipient wants to spend this money, he will reference output #0 of this transaction in an input of his own transaction. 

I'm assuming I could use BlockExplorer to find the Previous tx and Index.


How would I generate the scriptSig ? Is it something that could be done on the command line e.g. openssl.
The OP_DUP OP_HASH160 is that literally placed into the transaction text or is it a pseudonym ?
The 40437... in the scriptPubkey, how would I create that ?
Technically, the ScriptSig depends on the particular type of transaction output you're trying to claim, but for all standard scripts, it consists of the signature of this transaction and (usually) the public key corresponding to the private key the signature was made with. The public key must be the correct one to claim the transaction output this claims, that is, the one the coins were sent to.
Bitcoin scripts use opcodes. They're documented in the wiki.
That is the Bitcoin address that can claim this output (in raw binary form), assuming the transaction is a transfer to a Bitcoin address.