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 - witness script templates #602

Merged
merged 3 commits into from
Jul 14, 2016
Merged

SegWit - witness script templates #602

merged 3 commits into from
Jul 14, 2016

Conversation

dcousens
Copy link
Contributor

@dcousens dcousens commented Jul 11, 2016

A derivative of the preparatory work done by @rubensayshi in #520.
This purely encompasses the script changes and adds relevant tests for them.

This change should be atomic enough such that it can be merged easily.
Before merge, an integration test showing the full process of steps to inter-operate with SegWit should be added.

@dcousens dcousens added this to the 2.3.0 milestone Jul 11, 2016
@dcousens dcousens self-assigned this Jul 11, 2016
@rubensayshi
Copy link
Contributor

are you gonna have more for the transaction de/seralializing and signing? or should I clean up my PR and rebase on this?

var buffer = compile(script)

return buffer.length === 22 &&
buffer[0] === OPS.OP_0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+    buffer[1] === 0x14 

is worth checking in addition to checking the buffer size, so you know the data push is actually 20 bytes

@dcousens
Copy link
Contributor Author

are you gonna have more for the transaction de/seralializing and signing?

I was going to keep it atomic, but I guess for the proposed integration test, I'll need to.

No TransactionBuilder changes at this time though.

@dcousens
Copy link
Contributor Author

dcousens commented Jul 12, 2016

@afk11 resolved your comments in e88e39a. Great suggestions :)

classifyOutput: classifyOutput,
classifyInput: classifyInput,
pubKeyOutput: pubKeyOutput,
pubKeyHashOutput: pubKeyHashOutput,
scriptHashOutput: scriptHashOutput,
witnessPubKeyHashOutput: witnessPubKeyHashOutput,
witnessScriptHashInput: witnessScriptHashInput,
witnessScriptHashOutput: witnessScriptHashOutput,
Copy link
Contributor Author

@dcousens dcousens Jul 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rubensayshi I also opted for witness* such that it conformed to the standard we had used elsewhere, which was to follow the P2SH, P2PKH, P2WPKH, P2WSH notation, but, without the P2.

@rubensayshi
Copy link
Contributor

No TransactionBuilder changes at this time though.

so you don't want bitcoinjs-lib to be able to sign segwit?
afaik my PR doesn't BC break anything, it just touches quite a few things internally

@dcousens
Copy link
Contributor Author

dcousens commented Jul 14, 2016

@rubensayshi I'm just doing it in small byte sized PRs. The TransactionBuilder changes are going to require more thought and eyes IMHO

I just wanted to able to start on it, so I went with the minimal change required (this PR) to do that?

Perhaps for now, lets not add the Transaction code to this PR yet, and just merge if we're all happy with this interface.

@dcousens
Copy link
Contributor Author

dcousens commented Jul 14, 2016

@rubensayshi/@jprichardson please ACK if you're happy with this interface, and we'll then look to rebasing the other PR such that we can iterate the Transaction and TransactionBuilder API's

@dcousens dcousens mentioned this pull request Jul 14, 2016
20 tasks
@rubensayshi
Copy link
Contributor

ACK

@dcousens dcousens merged commit 94cab09 into master Jul 14, 2016
@dcousens dcousens deleted the swscripts branch July 14, 2016 10:16
@jprichardson
Copy link
Member

ACK

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 this pull request may close these issues.

4 participants