From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YC4KC-0006O4-IX for bitcoin-development@lists.sourceforge.net; Fri, 16 Jan 2015 10:40:20 +0000 Received: from mail-we0-f180.google.com ([74.125.82.180]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YC4K9-0002oE-Bs for bitcoin-development@lists.sourceforge.net; Fri, 16 Jan 2015 10:40:20 +0000 Received: by mail-we0-f180.google.com with SMTP id w62so19497868wes.11 for ; Fri, 16 Jan 2015 02:40:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=p35v9HTRRauDd83gcIKilhtIxkiyRA6X21layfGNRlY=; b=YkXSmEmi4VD6IaxBhbr8xu1EZyhAL8dEAzPfUq1eA2HktzxXgZbnoNfUzP+FxTOXxo AAsWErTNV9drkymiJcrgvvzfGnIjoxTSa9VNU8RjpKsgOi8ydYB7iIMvOuJscmSzwiWl lY6zquJmM1AdwwOSW3LX3Kq0jHXQIHNJwSNsDnx2LzNzDIwDhnBC4wtP7WprjDXc7/Gn zzjz2tXeRQNmMghA6Zxe15FgPM28QpMiZRcq7ef9WrifWMABMORPc9iqTmpCMS3IrEBq /81c4QWe8PeiJFsJuqwGfJVeHW7maxHXkW6opoYcDVypy8qR/lH0rRxNtsKd5vQ8U74i uxPw== X-Gm-Message-State: ALoCoQkCRARs9/wZKgfBSpWCafysTNxQL7LeYX1H/u6XdBdM7MduUZhofylLyjhycZTL7v64n4aD MIME-Version: 1.0 X-Received: by 10.194.193.4 with SMTP id hk4mr27649789wjc.38.1421403416215; Fri, 16 Jan 2015 02:16:56 -0800 (PST) Received: by 10.27.11.34 with HTTP; Fri, 16 Jan 2015 02:16:56 -0800 (PST) In-Reply-To: References: <6E575287-887C-4628-834C-282B67AFAA94@eeqj.com> <3382316.6TbFyFjyI6@crushinator> Date: Fri, 16 Jan 2015 11:16:56 +0100 Message-ID: From: Ruben de Vries To: Wladimir Content-Type: multipart/alternative; boundary=047d7bb03946b4ddc8050cc24558 X-Spam-Score: 1.0 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 1.0 HTML_MESSAGE BODY: HTML included in message X-Headers-End: 1YC4K9-0002oE-Bs Cc: Bitcoin Dev , Jeffrey Paul Subject: Re: [Bitcoin-development] convention/standard for sorting public keys for p2sh multisig transactions X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2015 10:40:20 -0000 --047d7bb03946b4ddc8050cc24558 Content-Type: text/plain; charset=UTF-8 Since we only need the sorting for creating the scriptPubKey, wouldn't it make the most sense to sort it by the way it represented in that context? On Thu, Jan 15, 2015 at 2:03 PM, Wladimir wrote: > On Thu, Jan 15, 2015 at 1:17 AM, Matt Whitlock > wrote: > > On Wednesday, 14 January 2015, at 3:53 pm, Eric Lombrozo wrote: > >> Internally, pubkeys are DER-encoded integers. > > > > I thought pubkeys were represented as raw integers (i.e., they're > embedded in Script as a push operation whose payload is the raw bytes of > the big-endian representation of the integer). As far as I know, DER > encoding is only used for signatures. Am I mistaken? > > OP_CHECKSIG (and OP_CHECKSIGVERIFY) takes a DER-encoded pubkey and a > DER-encoded signature on the stack. > > Possibly you're confused with OP_HASH160 OP_EQUALVERIFY as > used in outputs, which compares the 160-bit hash of the pubkey against > the given hash (usually taken from a bitcoin address). > > It doesn't help understanding to consider either as integers. They are > binary blob objects with either a fixed format (DER) or a fixed size > (hashes). > > Wladimir > -- BlockTrail B.V. Barbara Strozzilaan 201 1083HN Amsterdam The Netherlands Phone: +31 (0)612227277 E-mail: ruben@blocktrail.com Web: www.blocktrail.com Github: www.github.com/rubensayshi BlockTrail B.V. Is registered with the Dutch Chamber of Commerce in Amsterdam with registration No.:60262060 and VAT No.:NL853833035B01 --047d7bb03946b4ddc8050cc24558 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Since we only need the sorting for creating the scriptPubKey,= =C2=A0
wouldn't it make the most sense to sort it by the way it represe= nted in that context?


On Thu, Jan 15, 2015 at 2:03 PM, Wladimir <laanwj@gmai= l.com> wrote:
On Thu, Jan 15, 2015 at 1:17 AM, Matt Whitlock &= lt;bip@mattwhitlock.name> w= rote:
> On Wednesday, 14 January 2015, at 3:53 pm, Eric Lombrozo wrote:
>> Internally, pubkeys are DER-encoded integers.
>
> I thought pubkeys were represented as raw integers (i.e., they're = embedded in Script as a push operation whose payload is the raw bytes of th= e big-endian representation of the integer). As far as I know, DER encoding= is only used for signatures. Am I mistaken?

OP_CHECKSIG (and OP_CHECKSIGVERIFY) takes a DER-encoded pubkey = and a
DER-encoded signature on the stack.

Possibly you're confused with OP_HASH160 <hash160> OP_EQUALVERIFY= as
used in outputs, which compares the 160-bit hash of the pubkey against
the given hash (usually taken from a bitcoin address).

It doesn't help understanding to consider either as integers. They are<= br> binary blob objects with either a fixed format (DER) or a fixed size
(hashes).

Wladimir



--
BlockTrail B.V.
<= div>Barbara Strozzilaan 201
1083HN Amsterdam<= /font>
The Netherland= s

Phone: +31 (0)612227277

BlockTrail B.V. Is registered with the Dutch Chamber o= f Commerce in Amsterdam with registration No.:60262060 and VAT No.:NL853833= 035B01
--047d7bb03946b4ddc8050cc24558--