Skip to main content

On bitcoin wiki OP_CHECKSIG documentation :

Firstly always thisthe Bitcoin Wiki's (the default) procedure is appliedOP_CHECKSIG documentation:

  1. the public key and the signature are popped from the stack, in that order. If the hash-type value is 0, then it is replaced by the last_byte of the signature. Then the last byte of the signature is always deleted.

Firstly always this (the default) procedure is applied:

  1. the public key and the signature are popped from the stack, in that order. If the hash-type value is 0, then it is replaced by the last_byte of the signature. Then the last byte of the signature is always deleted.

The signature format is  :

0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S] [sighash]

0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S] [sighash]

In case if hash type is 0 then we should get last byte from [S] and remove it I think it will corrupt signature !!!

May beMaybe I notdon't correctly understand this documentation. Could any bodyanybody explain the correct behavior ifin this case

Thank you?

On bitcoin wiki OP_CHECKSIG documentation :

Firstly always this (the default) procedure is applied:

  1. the public key and the signature are popped from the stack, in that order. If the hash-type value is 0, then it is replaced by the last_byte of the signature. Then the last byte of the signature is always deleted.

signature format is  :

0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S] [sighash]

In case if hash type is 0 then we should get last byte from [S] and remove it I think it will corrupt signature !!

May be I not correctly understand this documentation Could any body explain correct behavior if this case

Thank you

On the Bitcoin Wiki's OP_CHECKSIG documentation:

Firstly always this (the default) procedure is applied:

  1. the public key and the signature are popped from the stack, in that order. If the hash-type value is 0, then it is replaced by the last_byte of the signature. Then the last byte of the signature is always deleted.

The signature format is:

0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S] [sighash]

In case if hash type is 0 then we should get last byte from [S] and remove it I think it will corrupt signature!

Maybe I don't correctly understand this documentation. Could anybody explain the correct behavior in this case?

Source Link
bitaps.com
  • 677
  • 4
  • 14

OP_CHECKSIG signature hash type 0

On bitcoin wiki OP_CHECKSIG documentation :

Firstly always this (the default) procedure is applied:

  1. the public key and the signature are popped from the stack, in that order. If the hash-type value is 0, then it is replaced by the last_byte of the signature. Then the last byte of the signature is always deleted.

signature format is :

0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S] [sighash]

In case if hash type is 0 then we should get last byte from [S] and remove it I think it will corrupt signature !!

May be I not correctly understand this documentation Could any body explain correct behavior if this case

Thank you