public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Gavin Andresen <gavinandresen@gmail•com>
To: Amir Taaki <zgenjix@yahoo•com>
Cc: "bitcoin-development@lists•sourceforge.net"
	<bitcoin-development@lists•sourceforge.net>
Subject: Re: [Bitcoin-development] Pull 748 pay to script hash
Date: Sat, 7 Jan 2012 20:12:35 -0500	[thread overview]
Message-ID: <CABsx9T26Uit2jHkKeZSHOW51p8H31osmBo7JYp8Md6RaBDWPhw@mail.gmail.com> (raw)
In-Reply-To: <1325977874.57604.YahooMailNeo@web121006.mail.ne1.yahoo.com>

> what is the purpose behind counting the number of sig ops after you have executed the script in ConnectInputs?
> Seems like it would be too late then.

The purpose is to comply with the "a block shall not contain more than
MAX_BLOCK_SIGOPS (20,000)" rule, under both the old way of counting
(look at the scriptPubKeys and count CHECKMULTISIGs as 20 sigops no
matter what) and the new way (look at both scriptPubKeys and
pay-to-script-hash scripts in the scriptSig, but count CHECKMULTISIGS
preceded by OP_1/2/3/... as 1/2/3 operations).

RE: too late:

Excellent point. I'll refactor ConnectInputs further, and do something like:

FetchInputs()
AreInputsStandard() <-- reject from memory pool if nonstanard
ComputeSigOps()
ComputeFees() <-- reject if too little fees per byte / sigop
ConnectInputs()

Pieter's compressed-public-keys patch (which was just pulled)
interacts with pay-to-script-hash to make ECDSA denial-of-service
attempts less expensive; I think we need to think hard again about
transaction fees before releasing 0.6, and maybe tweak the fee policy
so denial-of-service attacks using compressed public keys and 1-of-3
CHECKMULTISIG transactions is expensive enough to deter would-be
attackers.

-- 
--
Gavin Andresen



  reply	other threads:[~2012-01-08  1:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-07 17:21 Amir Taaki
2012-01-07 22:48 ` Gavin Andresen
2012-01-07 23:11   ` Amir Taaki
2012-01-08  1:12     ` Gavin Andresen [this message]
2012-01-08 16:12       ` 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=CABsx9T26Uit2jHkKeZSHOW51p8H31osmBo7JYp8Md6RaBDWPhw@mail.gmail.com \
    --to=gavinandresen@gmail$(echo .)com \
    --cc=bitcoin-development@lists$(echo .)sourceforge.net \
    --cc=zgenjix@yahoo$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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