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

P2sh support #246

Merged
merged 2 commits into from
Sep 11, 2014
Merged

P2sh support #246

merged 2 commits into from
Sep 11, 2014

Conversation

wanderingbort
Copy link
Contributor

Pay-to-script-hash addresses represent some of the better security options for bitcoin addresses. With bitcoin core talking about extending the features allowed in the hashed script, these addresses will become increasingly powerful.

From the protocol's perspective these addresses may as well be opaque addresses like pubkey-hashes. Currently, this would afford users of the protocol the ability to create M-of-N multisig addresses to hold MASTER protocol tokens.

The one caveat is that our Class B transactions use 1-of-N outputs to redeem the bitcoin spent in the service of the protocol (Note: multisig outputs are distinct from p2sh addresses which utilize multisig). OP_CHECKMULTISIG only accepts public key addresses. We are currently bridging support for pubkey-hash addresses IFF the address is in our local wallet. This PR proposes to allow the constructor/sender of the transaction to designate a public key address to redeem outputs with so that in the case of an address flavor that isn't compatible with multisig outputs the bitcoin are not lost.

this is paired with a code PR mastercoin-MSC/mastercore#102

…. OP_CHECKMULTISIG only supports public keys. No public key hashes or script hashes are allowed. As such the canonical Senders Address is the 1 of N necessary to redeem the output is not available to p2sh addresses. As it was never explicitly required in the spec that this pubkey match the senders address, it is now explicitly mentioned that it can be any address the sender designates to be the output redeemer
@dexX7
Copy link
Member

dexX7 commented Aug 30, 2014

Awesome, thanks for pushing this forward.

Any input not meeting the requirement for type (pay-to-pubkey-hash or pay-to-script-hash) will trigger the invalidation of the transaction

Is there any reason to keep this restriction instead of opening up completely?

Also +1 for letting the user choose the destination - in the utmost worst case this could default to the Exodus pubkey.

@wanderingbort
Copy link
Contributor Author

since other projects have hit problems with certain addressing schemes I feel more comfortable requiring any new pay-to standard transactions to pass analysis by the protocol team before allowing it through. For instance a pay-to-multisig input would have multiple associated pubkeys and we would need to disambiguate which of those pubkeys we would use for the mastercoin protocol "sender address" if that is the only input. This was a bug that counterparty hit which allowed someone to spend another addresses coins.

@dacoinminster
Copy link
Contributor

@CraigSellars asked me to look at our plans for p2sh with an eye toward finding corner cases or other gotchas. I can't think of any, but I think it would be safest to roll this out in stages (i.e. testnet first, and try to break it there before wider rollout).

marv-engine pushed a commit that referenced this pull request Sep 11, 2014
@marv-engine marv-engine merged commit 95f6a66 into OmniLayer:master Sep 11, 2014
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.

4 participants