Bitcoin Forum
May 26, 2024, 11:03:38 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: 0x00 prefix for R and S values in DER signature  (Read 1145 times)
luv2drnkbr (OP)
Hero Member
*****
Offline Offline

Activity: 793
Merit: 1016



View Profile
November 26, 2014, 08:43:12 PM
 #1

I've noticed that some scriptsigs have a 0x00 prefixing the 32 byte R and S values in the signatures, and some signatures do not have that.  I was hoping somebody knows the reason behind that and can explain to me if and when the prefix is necessary, and why.

Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1072
Merit: 1174


View Profile WWW
November 26, 2014, 11:42:39 PM
 #2

It's a DER requirement to prefix a 0x00 byte to an encoded integer if the integer otherwise starts with a byte >= 0x80. If not, it would be interpreted as a negative number.

I do Bitcoin stuff.
luv2drnkbr (OP)
Hero Member
*****
Offline Offline

Activity: 793
Merit: 1016



View Profile
November 27, 2014, 01:18:57 AM
 #3

Thanks for that clear explanation!

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!