When manually creating a raw bitcoin tx, how does one determine whether the r or s values require more zeros? Supposedly, if an R or S value will equal a "negative" number, one must append zeros to it and alter the "length" descriptor for the value to reflect that.  When manually creating a raw tx how does one determine whether one's R and or S values require the addition of these extra byte(s)?  All conversions I do with a hex calculator always show positive numbers.
If the first byte is greater than or equal to 0x80 (128), then you need to add a leading zero byte. You can do 0x80 &amp; first_byte. If the result is zero, no padding is needed.