public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Jeremy <jlrubin@MIT.EDU>
To: bitcoin-development@lists.sourceforge.net
Subject: [Bitcoin-development] Pay to MultiScript hash:
Date: Wed, 16 Jul 2014 13:56:54 -0400	[thread overview]
Message-ID: <CAD5xwhgyCOdJwnXw+YchptfXjtshDi_VVEGOjR-hG2qV=u6m2g@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1524 bytes --]

Hey all,

I had an idea for a new transaction type. The base idea is that it is
matching on script hashes much like pay to script hash, but checks for one
of N scripts.

A motivating case is for "permission groups". Let's say I want to have a
single "root user" script, a 2 of 3 group, and a 2 of 2 group able to spend
a utxo. This would allow for any one of these permission groups to spend.

Right now, this could be expressed multiple ways (ie, using an op_dup if
then else chain) , but all would incur additional costs in terms of
complicated control flows. Instead, I would propose:

OP_HASH160 [20-byte-hash-value 1]...[20-byte-hash-value N] OP_N
OP_MULTISCRIPTHASHVERIFY


could be spent with

...signatures... {serialized script}


​And the alternative formulation: (more complex!)​

​OP_HASH160 OP_DUP [20-byte-hash-value 1]​
​ OP_IF OP_EQUAL​
​ OP_VERIFY OP_ELSE   <OP_DUP  [20-byte-hash-value 2]​​  OP_IF......>
OP_ENDIF​



Of course, the permission group example is just one use case, there could
be other interesting combinations as well
​.


There is an implication in terms of increased utxo pool bloat, but also an
implication in terms of increased txn complexity (each 20 byte hash allows
for a 500 byte script, only one of the 500 byte scripts has to be
permanently stored on blockchain).


Looking forward to your feedback -- the idea is a bit preliminary, but I
think it could be exciting.

Best,

Jeremy




-- 
Jeremy Rubin

[-- Attachment #2: Type: text/html, Size: 3176 bytes --]

             reply	other threads:[~2014-07-16 17:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16 17:56 Jeremy [this message]
2014-07-17  4:52 ` [Bitcoin-development] Pay to MultiScript hash: Jeff Garzik
2014-07-17  5:59   ` Jeremy
2014-07-17  6:21     ` Jeff Garzik
2014-07-17 19:55       ` Jeremy
2014-07-17 20:08 ` Gregory Maxwell

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='CAD5xwhgyCOdJwnXw+YchptfXjtshDi_VVEGOjR-hG2qV=u6m2g@mail.gmail.com' \
    --to=jlrubin@mit.edu \
    --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