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 implementation #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Segwit implementation #26

wants to merge 2 commits into from

Conversation

oleganza
Copy link
Owner

@oleganza oleganza commented Jan 2, 2018

Initial work done by @mgpnd in #25, this is a refactoring follow-up.

@oleganza
Copy link
Owner Author

oleganza commented Jan 2, 2018

From #25 (comment):

  1. You can use BTC.hash256() instead of BTC.sha256(BTC.sha256()).
  2. New signature_hash function uses dup on the transaction. But current version of dup does not duplicate witness field. This is not a bug for sighash, but should be addressed as soon as a subclass is introduced. (That is, lets not forget the new field txin.witness.)
  3. I'd recommend not creating a subclass at all. I'd rather extend BTC::Transaction with segwit serialization and sighash options, in the same way BTC::TransactionInput simply adds witness.

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

Successfully merging this pull request may close these issues.

2 participants