[WIP] Segregated Witness #7404

pull jonasschnelli wants to merge 49 commits into bitcoin:0.12 from sipa:segwit changing 94 files +6921 −2607
  1. jonasschnelli commented at 8:47 PM on January 23, 2016: contributor

    This PR should allow people to look at the current implementation. [work in progress]

  2. sipa force-pushed on Jan 25, 2016
  3. laanwj commented at 11:48 AM on January 27, 2016: member

    I've deleted the post by @sadshoe. Please limit the discussion here to the code only.

  4. sipa force-pushed on Jan 27, 2016
  5. in src/chainparams.cpp:None in 37973bf2ef outdated
      76 | @@ -77,6 +77,7 @@ class CMainParams : public CChainParams {
      77 |          consensus.BIP34Height = 227931;
      78 |          consensus.BIP34Hash = uint256S("0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8");
      79 |          consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
      80 | +        consensus.SegWitHeight = 2000000000;
    


    rebroad commented at 2:00 PM on January 31, 2016:

    what is this number?


    sipa commented at 5:15 PM on March 23, 2016:

    "some long time in the future" (as we don't have a planned activation date for segwit on mainnet yet). actual segwit will be deployed using versionbits, so this will go away

  6. in src/chainparamsseeds.h:None in 37973bf2ef outdated
     888 | @@ -889,6 +889,13 @@ static SeedSpec6 pnSeed6_main[] = {
     889 |      {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xcf,0x7b,0x5e,0x3a,0x53,0x21,0x5b,0x62,0xe3,0x7a}, 8333}
     890 |  };
     891 |  
     892 | +static SeedSpec6 pnSeed6_seg[] = {
    


    rebroad commented at 2:03 PM on January 31, 2016:

    would be nice if the code has more comments that referred to documentation that explains what some of these numbers are

  7. sipa force-pushed on Feb 5, 2016
  8. sipa force-pushed on Feb 9, 2016
  9. laanwj added the label Validation on Feb 16, 2016
  10. sipa force-pushed on Mar 16, 2016
  11. sipa force-pushed on Mar 16, 2016
  12. sipa force-pushed on Mar 25, 2016
  13. sipa force-pushed on Mar 25, 2016
  14. sipa force-pushed on Mar 25, 2016
  15. sipa force-pushed on Mar 26, 2016
  16. sipa force-pushed on Mar 31, 2016
  17. sipa force-pushed on Mar 31, 2016
  18. sipa force-pushed on Apr 1, 2016
  19. sipa force-pushed on Apr 4, 2016
  20. sipa force-pushed on Apr 4, 2016
  21. sipa force-pushed on Apr 12, 2016
  22. Keep addrman's nService bits consistent with outbound observations 6fc1480076
  23. Verify that outbound connections have expected services 3dbfdf98c9
  24. Only store and connect to NODE_NETWORK nodes 2554857896
  25. test: Re-introduce JSON pretty printing in test builder bbf0f18e6f
  26. test: Script_error checking in script_invalid tests
    Check the returned script_error. Add expected script_error
    for generated as well as custom tests.
    
    The specific error is not part of consensus, however
    it could avoid unclear reporting issues such as #6862 in the future.
    
    Fixes #7513.
    25c1f67032
  27. Fix JSON pretty printing in script_tests 42b73b42f5
  28. Fix some misconstructed tests
    They claimed to be testing P2SH scripts with non-push scriptSigs, but
    1) they were not enabling P2SH
    2) they have push-only scriptSigs
    
    Fix this, and add a few more related cases.
    60b329287c
  29. Fix formatting of NOPs for generated script tests 3bb79007ed
  30. Make script_error a mandatory 4th field for script_tests 5f66cdabd4
  31. Get rid of expect in script_tests as it's implied by scripterror 9b85c68a4d
  32. Merge script_valid and script_invalid tests 90125c2332
  33. [qa] wallet: Wait for reindex to catch up 4f90d36e90
  34. Use txid as key in mapAlreadyAskedFor
    Previously we used the CInv that would be sent to the peer announcing the
    transaction as the key, but using the txid instead allows us to decouple the
    p2p layer from the application logic (which relies on this map to avoid
    duplicate tx requests).
    c7474657c9
  35. Change mapRelay to store CTransactions 119677249d
  36. --- [SEGWIT] begin: segnet --- 2a74ff09ab
  37. Don't check the genesis block PoW
    Inspired by Jorge Timon's "Testchain: Don't check the genesis block", but
    restricted to just PoW check.
    
    Code by Matt Corallo, originally submitted as a patch to segwit.
    efbd772eb6
  38. Create segnet4 c5a44b64c0
  39. Add segnet seed nodes f7e2a3053e
  40. qt: Work (don't crash) with -segnet ee501e9188
  41. --- [SEGWIT] begin: P2P/node/consensus --- c8f76270c2
  42. Add segregated witness transaction serialization
    Contains refactorings by Eric Lombrozo.
    Contains fixup by Nicolas Dorier.
    526b553aef
  43. Removed ppszTypeName from protocol.cpp 49d0bd978e
  44. getdata enum issue fix f822e15fa6
  45. Introduce and preferentially peer with NODE_WITNESS service bit
    Service bit logic by Nicolas Dorier.
    d1f2258fdc
  46. Witness commitment validation
    Includes a fix by Suhas Daftuar
    f5ddc462f4
  47. Script validation logic for witnesses 25d4d9e461
  48. Enable SCRIPT_VERIFY_WITNESS for mempool transactions be10fb4c1a
  49. Activate script consensus rules through BIP9 a43536a33b
  50. Only download blocks from witness peers after fork 92fc17104b
  51. Observe input amounts: verification e66b0148d8
  52. Add signature version 1 with updated sighash
    Includes simplifications by Eric Lombrozo.
    46daedfaa5
  53. Return witness data
    Includes RPC field name changes by Luke-jr.
    54eabc939c
  54. Implement block size/sigop cost rules, limits, and GBT support
    Includes changes by Suhas Daftuar and Luke-jr.
    d6c69c2266
  55. Add command line options to loosen mempool acceptance rules c730637ae7
  56. bitcoinconsensus: add method that accepts amount, and return error when verify_script receives VERIFY_WITNESS flag
    script_tests: always test bitcoinconsensus_verify_script_with_amount if VERIFY_WITNESS isn't set
    
    Rename internal method + make it static
    
    trim bitcoinconsensus_ prefix
    
    Add SERIALIZE_TRANSACTION_WITNESS flag
    fd9390f662
  57. Increase MAX_PROTOCOL_MESSAGE_LENGTH
    Witness blocks can be greater than 2MiB, but cannot be validly greater
    than 4MB.
    4d90727666
  58. Add rewind logic to deal with post-fork software updates e95b6a42e9
  59. --- [SEGWIT] begin: wallet --- da279a967a
  60. Witness script signing a5f8cbb96b
  61. Add witness address RPCs (using P2SH)
    Includes support for pushkeyhash wit v0 by Alex Morcos.
    15585e091f
  62. signrawtransaction can sign P2WSH cc61707ada
  63. --- [SEGWIT] begin: tests --- 61ff637364
  64. Signing tests 47d9337502
  65. Add rpc test for segwit
    Amended by Pieter Wuille to use multisig 1-of-1 for P2WSH tests, and BIP9
    based switchover logic.
    ab215e49cc
  66. Add transaction tests for segwit
    ...with the four types of segwit payment, as well as all sighash combinaisons.
    0ec3d4473c
  67. Add segwit support to script_tests ed9c2f877e
  68. Autogeneration support for witness in script_tests 240cc9aa7b
  69. Update p2p test framework with segwit support
    mininode now supports witness transactions/blocks, blocktools
    has a helper for adding witness commitments to blocks, and script
    has a function to calculate hashes for signature under sigversion
    1, used by segwit.
    5bd6e9ede2
  70. P2P test for segwit fb4873ead5
  71. sipa force-pushed on Apr 17, 2016
  72. jonasschnelli commented at 3:23 PM on April 19, 2016: contributor

    Closing in favor of #7910

  73. jonasschnelli closed this on Apr 19, 2016

  74. fanquake locked this on Oct 28, 2018

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-24 12:15 UTC

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