Bitcoin Forum
May 12, 2024, 12:49:31 AM *
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.

1715474971
Hero Member
*
Offline Offline

Posts: 1715474971

View Profile Personal Message (Offline)

Ignore
1715474971
Reply with quote  #2

1715474971
Report to moderator
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715474971
Hero Member
*
Offline Offline

Posts: 1715474971

View Profile Personal Message (Offline)

Ignore
1715474971
Reply with quote  #2

1715474971
Report to moderator
1715474971
Hero Member
*
Offline Offline

Posts: 1715474971

View Profile Personal Message (Offline)

Ignore
1715474971
Reply with quote  #2

1715474971
Report to moderator
1715474971
Hero Member
*
Offline Offline

Posts: 1715474971

View Profile Personal Message (Offline)

Ignore
1715474971
Reply with quote  #2

1715474971
Report to moderator
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!