Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id CB93FDB9 for ; Mon, 29 Jul 2019 01:46:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-40130.protonmail.ch (mail-40130.protonmail.ch [185.70.40.130]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 079E35E4 for ; Mon, 29 Jul 2019 01:46:47 +0000 (UTC) Date: Mon, 29 Jul 2019 01:46:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1564364805; bh=dxW1gShqHAGC47zhyGBTsaAKQSqEpCdhQo8DYfiPo3Y=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References: Feedback-ID:From; b=IB3nqPaj7kmoAyp/viEDMLXLUA8ru3LqJ6QJyQA/76oAMwVGTjLccrBusvD2/5kmp QF+ZxUq/r9C48Crfvg5GKstx5azzh+IK3EBs159sYRohVjV5iiUqH/0l+vZaky1FZW e9gDvmqGBef71KO5cW8I5Wz7dZ2tjBlDXwDkElCc= To: Mike Brooks From: ZmnSCPxj Reply-To: ZmnSCPxj Message-ID: In-Reply-To: References: Feedback-ID: el4j0RWPRERue64lIQeq9Y2FP-mdB86tFqjmrJyEPR9VAtMovPEo9tvgA0CrTsSHJeeyPXqnoAu6DN-R04uJUg==:Ext:ProtonMail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Mailman-Approved-At: Mon, 29 Jul 2019 02:53:15 +0000 Cc: Bitcoin Protocol Discussion , "pieter.wuille@gmail.com" Subject: Re: [bitcoin-dev] PubRef - Script OP Code For Public Data References X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2019 01:46:49 -0000 Good morning Mike, Sent with ProtonMail Secure Email. =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Sunday, July 28, 2019 4:03 AM, Mike Brooks wrote: > Hey ZmnSCPxj, > > As to your first point.=C2=A0 I wasn't aware there was so much volatility= at the tip, also 100 blocks is quite the difference!=C2=A0 I agree no one = could references a transaction in a newly formed blocks, but I'm curious ho= w this number was chosen. Do you have any documentation or code that you ca= n share related to how re-orgs are handled? Do we have a kind of 'consensus= checkpoint' when a re-org is no longer possible? This is a very interestin= g topic. > Miner coinbases need 100 blocks for maturity, which is the basis of my sugg= estion to use 100 blocks. It might be too high, but I doubt there will be good reason to be less than= 100. There is a potential for a targeted attack where a large payout going to a = `scriptPubKey` that uses `OP_PUBREF` on a recently-confirmed transaction fi= nds that recently-confirmed transaction is replaced with one that pays to a= different public key, via a history-rewrite attack. Such an attack is doable by miners, and if we consider that we accept 100 b= locks for miner coinbase maturity as "acceptably low risk" against miner sh= enanigans, then we might consider that 100 blocks might be acceptable for t= his also. Whether 100 is too high or not largely depends on your risk appetite. >=C2=A0 A validator only needs an array of PUSHDATA elements and can then v= alidate any given SCRIPT at O(1).=C2=A0=C2=A0 Data derived from > 220Gb of perpetually-growing blockchain is hardly, to m= y mind, "only needs an array". Such an array would not fit in memory for many devices that today are pract= ical for running fullnodes. It is keeping that array and indexing it which is the problem, i.e. the dev= il in the details. Reiterating also, current pruned nodes did not retain that data and would b= e forced to re-download the entire blockchain. Unless you propose that we can refer only to `OP_PUSHDATA` after activation= of `OP_PUSHREF`. Regards, ZmnSCPxj