• Welcome to forex.pm forex forum binary options trade. Please login or sign up.
 

How long is SIGHASH?

Started by Bitcoin, Feb 19, 2022, 12:47 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bitcoin

How long is SIGHASH?

I am reading these two posts 1 2, and following step by step.
I almost understand, but I still have some questions.



  1. 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?



  2. 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.




Source: How long is SIGHASH?