public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Pieter Wuille <pieter.wuille@gmail.com>
To: Bitcoin Dev <bitcoin-development@lists.sourceforge.net>
Subject: [Bitcoin-development] BIP62 and future script upgrades
Date: Tue, 4 Nov 2014 05:29:46 -0800	[thread overview]
Message-ID: <CAPg+sBjygohgFf2hE9cGH3ZmV0MaeniZDDNO+hFxOxo-s_d81A@mail.gmail.com> (raw)

Hi all,

one of the rules in BIP62 is the "clean stack" requirement, which
makes passing more inputs to a script than necessary illegal.

Unfortunately, this rule needs an exception for P2SH scripts: the test
can only be done after (and not before) the second stage evaluation.
Otherwise it would reject all spends from P2SH (which rely on
"superfluous" inputs to pass data to the second stage).

I submitted a Pull Request to clarify this in BIP62:
https://github.com/bitcoin/bips/pull/115

However, this also leads to the interesting observation that the
clean-stack rule is incompatible with future P2SH-like constructs -
which would be very useful if we'd ever want to deploy a "Script 2.0".
Any such upgrade would suffer from the same problem as P2SH, and
require an exception in the clean-stack rule, which - once deployed -
is no longer a softfork.

Luke suggested on the pull request to not apply this rule on every
transaction with nVersion >= 3, which indeed solves the problem. I
believe this can easily be generalized: make the (non mandatory) BIP62
rules only apply to transaction with strict nVersion==3, and not to
higher ones. The higher ones are non-standard anyway, and shouldn't be
used before there is a rule that applies to them anyway - which could
include some or all of BIP62 if wanted at that point still.

Opinions?



             reply	other threads:[~2014-11-04 13:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04 13:29 Pieter Wuille [this message]
2014-11-04 13:38 ` [Bitcoin-development] BIP62 and future script upgrades Mike Hearn
2014-11-04 13:50   ` Pieter Wuille
2014-11-04 14:01 ` Gavin Andresen
2014-11-04 19:13 ` Peter Todd
2014-11-04 19:56   ` Jeff Garzik
2014-11-04 20:00     ` Pieter Wuille
2014-11-04 20:07       ` Peter Todd
2014-11-05  7:53         ` Pieter Wuille

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPg+sBjygohgFf2hE9cGH3ZmV0MaeniZDDNO+hFxOxo-s_d81A@mail.gmail.com \
    --to=pieter.wuille@gmail.com \
    --cc=bitcoin-development@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox