Open zilveer opened 6 years ago
You should check the input script (scriptSig) for the transaction you want to decode. Assuming you are analysing a P2PKH transaction, the structure of the script will be:
< signature >< hash_type >< public_key >
The hash_type is always 1 byte long.
For future questions I would recommend you to ask this type of questions in another place, like the Bitcoin Stack Exchange, since this repo is kind off discontinued.
@sr-gi thanks for replying back to me.
I will do that but meanwhile u r here what if it's a P2SH transaction how does it look like then?
Thanks for your kind reply.
regards
P2SH
are more tricky, since them not always require a signature. However, if there is a signature the hash type will be the next byte or the tailing byte, depending on how you interpret the signature (as it happened with P2PKH
scripts).
Here you have the structure of a signature:
and here an example where r
and s
are 32-byte values:
Notice that ht
represents the hash type.
Hello, is there anyone here who can guide me on how to decode a Sighash type on a TX hex which is signed?
I am pretty new to this, any help is appreciated.
regards