Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segwit Support #1

Closed
hkalodner opened this issue Sep 6, 2017 · 1 comment · Fixed by #27
Closed

Segwit Support #1

hkalodner opened this issue Sep 6, 2017 · 1 comment · Fixed by #27
Assignees
Labels

Comments

@hkalodner
Copy link
Collaborator

hkalodner commented Sep 6, 2017

Currently BlockSci does not have segwit support and segfaults when attempting to process a block which includes segwit transactions.

Adding Segwit support to BlockSci involves a number of changes to both the parser and analysis library.

Adding support to the parser to handle the Segwit serialization format is trivial and has already been completed on a private branch. The more complex issue is how to internally handle Segwit scripts.

A solution which has been mapped out, but is still being implemented is to codify in the codebase a distinction between address type and script type. Output scripts can be viewed at two levels of abstraction:

  • At one level we have all the standard scripts types, P2PK, P2PKH, P2SH, Multsig, OP_RETURN, P2WPKH, and P2WSH. P2SH-P2WSH and P2SH-P2WPKH will are currently not planned to be considered distinct types and instead will be viewed as standard P2SH scripts.
  • At the other level we have the abstracted notion of authentication method (shorter name tbd). These many categories of script type can be divided into a shorter list of general authentication types. P2PK, P2PKH, and P2WPKH are all based on using a single public key, which could be used interchangeably to create an scriptPubKey of any of those types (Assuming that it's in compressed form). Similarly P2SH and P2WSH have the same form.

Splitting up the current Address and Script modules to operate explicitly under one or the other of these two models will allow BlockSci to easily expand to handle the new Segwit addresses while maintaining clean layers of abstraction.

@jnewbery
Copy link

jnewbery commented Jan 9, 2018

Awesome. Thanks for adding segwit support. For correct fee market analysis, BlockSci should use transaction virtual size instead of transaction size (see #43).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants