Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Segwit/segnet development support #49

@braydonf

Description

@braydonf

Here is a rough breakdown of tasks needed to bring segwit support to bitcore libraries:

Bitcore Library:

  • Address
    • New address type for pay-to-witness-public-key-hash and pay-to-witness-script-hash (BIP0142) DEFERRED
    • Expand associated address methods to use the new formats to build the corresponding scripts DEFERRED
  • Transaction
    • New transaction serialization format, expand toBuffer/fromBuffer for bitcore-lib to include additional support for segwit serialization format. This is mostly identical to existing implementation with an additional flag that indicates segwit tx, and a new field for scriptWitness on the input (BIP0144) IMPLEMENTED
    • New transaction hash that does not include witness, and one that does include the witness (BIP0144) IMPLEMENTED
    • Support signing inputs with the new witness programs for pay-to-witness-public-key-hash and pay-to-witness-script-hash (BIP0141)
    • Support signing inputs and making transactions with traditional P2SH with segwit (BIP0141). IMPLEMENTED
  • Network
    • Add segnet network alongside and similar to regtest network options IMPLEMENTED
  • Script
    • Add script evaluation for witness data (BIP0141) IMPLEMENTED (needs more tests)
  • Block
    • New block size rule that discounts signatures/witnesses (BIP0141)
    • Support getting the witness merkle commitment for a block (BIP0141)

Bitcore P2P Library

  • New handshake p2p message for "havewitness" sent after "verack" (BIP0144)
  • New inventory types for MSG_WITNESS_TX and MSG_WITNESS_BLOCK for getdata messages (BIP0144)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions