When manually creating a raw bitcoin tx, how does one determine whether the r or s values require more zeros?
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.