Validiating Block Versions and Hash_Types #317

issue roconnor opened this issue on June 16, 2011
  1. roconnor commented at 12:14 AM on June 16, 2011: none

    It is my understanding that bitcoin does not verify the version number in block or transactions. If versions are meant as an extension mechanism, then presumably the client ought to enforce that all the version numbers are equal to 1 until such time as alternative block and transaction versions are added. Right now anyone can start spamming version numbers with any value they want I think.

    Similarly the client only checks to see if the low bits of the HashType are SIGHASH_NONE or SIGHASH_SINGLE and all other combinations are treated as SIGHASH_ALL. Again, if this mechanism was intended to be extensible, then you need to check that the SIGHASH_ALL is correct and reject all other invalid HashTypes. Since there are only 5 bits available, spammers could easily exhaust all the HashTypes. Already at least transaction c99c49... is using an invalid HashType of 0 as if it were a SIGHASH_ALL.

  2. roconnor commented at 8:51 PM on December 27, 2011: none

    I've started putting blocks and transactions with random version numbers and random hash types into the testnet chain.

  3. gavinandresen commented at 10:02 PM on January 2, 2012: contributor

    Fixing this without inadvertently causing a blockchain split looks like:

    1. "Discourage" transactions/blocks with weird hashTypes/versions.
    2. Get 50+% of mining power to express support for a rule-change to declare other versions invalid by putting some string in their coinbase transactions.
    3. Strictly enforcing the rule as of some block number or date after 50% of the network has upgraded (only for blocks/transactions after that date, old blocks/transactions that break the rule must be 'grandfathered').
  4. sipa referenced this in commit 9177950c74 on Oct 21, 2015
  5. sipa referenced this in commit f4787d1caf on Oct 21, 2015
  6. sipa referenced this in commit 6557a8cd46 on Oct 26, 2015
  7. sipa referenced this in commit ea06490d14 on Oct 27, 2015
  8. sipa referenced this in commit 003bb87153 on Nov 5, 2015
  9. sipa referenced this in commit bfd83199c3 on Nov 11, 2015
  10. sipa referenced this in commit b437ea7ec9 on Nov 12, 2015
  11. sipa referenced this in commit 1d84107924 on Nov 12, 2015
  12. dexX7 referenced this in commit 4fcd4ed746 on Dec 31, 2015
  13. laanwj closed this on Feb 9, 2016

  14. jtimon referenced this in commit 91ee21c024 on Mar 11, 2016
  15. sipa referenced this in commit f41ed612dd on Aug 27, 2016
  16. sipa referenced this in commit 2f342da4b9 on Nov 30, 2016
  17. sipa referenced this in commit 634ad51703 on Dec 2, 2016
  18. rebroad referenced this in commit 40ead34fbe on Dec 7, 2016
  19. deadalnix referenced this in commit fe0d463494 on Jan 19, 2017
  20. ptschip referenced this in commit 1b09526df2 on Apr 11, 2017
  21. destenson referenced this in commit b27cb725c0 on Nov 18, 2017
  22. destenson referenced this in commit c6c52c76cc on Nov 18, 2017
  23. classesjack referenced this in commit 8622df8f86 on Jan 2, 2018
  24. lateminer referenced this in commit ded9de0bb1 on Oct 16, 2019
  25. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 06:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me