Bitcoin Forum
May 08, 2024, 10:08:30 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is there a list of historical bitcoin core bugs related to SigHash?  (Read 155 times)
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
February 25, 2020, 06:36:05 AM
 #1

I can't find that much information regarding historical bugs that concerned SigHash types. I have found a couple of transactions that should have been logically invalid but were accepted as valid in the history such as SigHash zero or the case where some garbage bytes are added at the end of the signature before the SigHash byte.
I'm also wondering whether such cases are invalid today or just non-standard.

I'd appreciate it if you could provide some detailed information about this.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Activity + Trust + Earned Merit == The Most Recognized Users on Bitcointalk
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715162910
Hero Member
*
Offline Offline

Posts: 1715162910

View Profile Personal Message (Offline)

Ignore
1715162910
Reply with quote  #2

1715162910
Report to moderator
1715162910
Hero Member
*
Offline Offline

Posts: 1715162910

View Profile Personal Message (Offline)

Ignore
1715162910
Reply with quote  #2

1715162910
Report to moderator
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4172
Merit: 8412



View Profile WWW
February 25, 2020, 07:49:06 AM
 #2

I can't find that much information regarding historical bugs that concerned SigHash types. I have found a couple of transactions that should have been logically invalid but were accepted as valid in the history such as SigHash zero or the case where some garbage bytes are added at the end of the signature before the SigHash byte.
I'm also wondering whether such cases are invalid today or just non-standard.

I'd appreciate it if you could provide some detailed information about this.

Your question is not about sighash, sighash flag is always just the last byte. Your question is about signature encoding.

Search for invalid DER encoding bitcoin   or similar.
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
February 25, 2020, 08:53:29 AM
 #3

Your question is not about sighash, sighash flag is always just the last byte. Your question is about signature encoding.

Search for invalid DER encoding bitcoin   or similar.

That is part of the information I've already found that includes malleability fixes. But some parts are missing.
Let me be more specific, One case is invalid SigHash byte. I have found transactions (already mined) that have 0x00 as their SigHash byte (flag) which is clearly a bug and is not about encoding.
Is this currently fixed? At which fork (block height, is it along BIP66?)?
Also I'm wondering what other "special cases" exist that I'm not aware of. For instance is/was 0x05 (=0b0000_0101) considered valid SigHash and equal to SigHash_All?

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1354


aka tonikt


View Profile WWW
February 26, 2020, 07:32:40 PM
Merited by ABCbits (1), Coding Enthusiast (1)
 #4

It's in the function called IsValidSignatureEncoding() in src/script/interpreter.cpp

https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L107

The rules from that function are being enforced since BIP66 was "activated", which was at (including) block #330776


Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
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!