I am reading these two posts 1 2, and following step by step. I almost understand, but I still have some questions.
Before signing, input script should be removed and replaced by pre locking script. In the last, SIGHASH should be appended. in this time, SIGHASH is 4 bytes(0x01000000). However, after signing, SIGHASH should also be appended. in this time(DER), SIGHASH is 1 byte(0x01), as seen in the raw transaction. So how long SIGHASH is?
in the pizza transaction, the r takes 33 bytes, whit 0x00 in the first. When i use ecdsa in python, i have to delete the first byte 0x00. So when DER process, why not just use 32 bytes.