mastercoin-MSC / mastercoin-tools

GNU Affero General Public License v3.0
9 stars 12 forks source link

Add P2SH support starting at block height 306000 #66

Closed dexX7 closed 8 years ago

dexX7 commented 10 years ago

Please review, test and discuss. A similar pull request was created for the Masterchest library.

dexX7 commented 10 years ago

Just to be clear, the block height was chosen arbitrarily and this should not be considered as a request or anything alike, but rather as something that may be used, if needed.

ghost commented 10 years ago

DexX, was this decided in the spec? I thought we disallowed p2sh as inputs, definitively?

dexX7 commented 10 years ago

See the "support multisig recipients on simple send" thread - it's not finalized and wasn't coordinated, but I was inspired after reading Ron's request. ;)

But that aside, I'd remove the input restrictions altogether actually, which should be secure, because this time history is not affected. Consider this pull request as "the patch is available, if needed and wanted".

ghost commented 10 years ago

:) Cool, this might come in handy :)

dacoinminster commented 10 years ago

Is this pull request really what I think it is?! Ability to do everything MSC does on P2SH??

Last I heard, P2SH was our best long-term plan for better obfuscation (getting rid of 1Exodus). Very interested in other devs opinion of this pull request.

On Thu, Jun 12, 2014 at 11:28 AM, Faiz Khan notifications@github.com wrote:

:) Cool, this might come in handy :)

— Reply to this email directly or view it on GitHub https://github.com/mastercoin-MSC/mastercoin-tools/pull/66#issuecomment-45929692 .

dexX7 commented 10 years ago

No, it's not. It allows to send MSC from and to escrow addresses (those starting with a 3), which is currently prohibited on a protocol level.

dacoinminster commented 10 years ago

Interesting. Still a step in the right direction though. Not sure whether we should wait for Master Core before making changes like this though.

On Fri, Jun 13, 2014 at 12:28 PM, dexX7 notifications@github.com wrote:

No, it's not. It allows to send MSC from and to escrow addresses (those starting with a 3), which is currently prohibited on a protocol level.

— Reply to this email directly or view it on GitHub https://github.com/mastercoin-MSC/mastercoin-tools/pull/66#issuecomment-46050776 .

dexX7 commented 10 years ago

I'm not sure about the plans and level of cooperation, but as far as I know Ron raised the need of this in relation to Trust Trade (the winner of the hackathon). I have quite a few ideas myself related to this, but without any time pressure.

If this comes up in an internal discussion about adopting it or not, I'd like to underline that it would make sense to be less restrictive in the input selection altogether instead of whitelisting some of the input types. - These restrictions were only introduced to disallow P2SH (escrow) as source or recipient - thus it's moot with this patch. Please just ping me, if this needs an update.

ghost commented 10 years ago

"...but without any time pressure."

I'd be interested to hear more of what those ideas could be, and if they're worth breaking out into a separate branch

dexX7 commented 10 years ago

Here are a few examples why P2SH is useful:

  1. Allow escrow/multisig transactions, e.g.: https://github.com/mastercoin-MSC/Master_Protocol_Product_Requirements/issues/8
  2. Oracles - tokens are sent to multisig address and can only be redeemed, if the oracle agrees. Think of an oracle as external entity which may sign such a transaction under certain circumstances. Neither Bitcoin nor Mastercoin have any knowledge about real life events, but say for example there is a website which fills this role and allows to specify criteria under which a transaction is signed, for example: "block 307500 is even", "dexX7 became the new president of the United Bitcoin Islands" or whatever you may think of. A few first steps for general knowledge databases are done here: https://www.realitykeys.com/ or https://earlytemple.com:8181/
  3. The part that excites me the most: contracts. Contracts in the context of what Bitcoin wizards call "contracts": https://en.bitcoin.it/wiki/Contracts (might not be the best introduction)
  4. Micropayment channels, cross-chain trading, ...

Most of this may sound confusing, but I lack of some practical examples right at the moment.. ;)

ghost commented 10 years ago

The first two examples I get :)

Contracts, from that wiki, not so much, micropayments sounds familiar, cross-chain/side-chains too... This is a pretty great topic and I'd love some more reading if you have any sort of articles in mind :)

ripper234 commented 10 years ago

I just ran into it, not sure I saw it before. great work @dexX7 !

mastercoin-tools is deprecated, I don't think we should be spending time integrating that, but this pull request can serve as a basis to code it on Master Core (see issue I just opened).

dexX7 commented 8 years ago

Implemented in Omni Core. /close