There are three parts to this.
Part 1. This string is found at the final form of the raw tx:
But there is no explanation on how to get it or what it is nor does it appear to be from any other part of the tx. What is it and how do I get it from the data provided? Or is it merely the signature for the 1st input?
Part 2. This string is the preimage for the "sighash":
Why is it lacking the 1st input but has the hash that was derived from both the first and second inputs? How does one handle that part if your transaction only has 1 input? Or is this just the preimage for the second input?
Part 3. The above preimage for the sighash produces a signature. This signature of
02 47304402203609e17b84f6a7d30c80bfa610b5b4542f32a8a0d5447a12fb1366d7f01cc44a0220573a954c4518331561406f90300e8f3358f51928d43c212a8caed02de67eebee01 21025476c2e83188368da1ff3e292e7acafcdb3566bb0ad253f62fc70f07aeee6357
Why does this go at the bottom of the transaction in the "witness" preceded by a "02" and doesn't correlate with the input that it was created from (if it is indeed considered to be the signature for the 2nd output). If that is proper, then what does one do to create this "witness" thing at the end if one only has one input? And what does the "02" mean or what is it in reference to?
I was thinking of breaking this up into multiple questions but I think that would have gotten messy, not to mention I think these correlate with one another.