Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 017A9DCD for ; Tue, 30 Apr 2019 04:29:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-40135.protonmail.ch (mail-40135.protonmail.ch [185.70.40.135]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 3E179608 for ; Tue, 30 Apr 2019 04:29:21 +0000 (UTC) Date: Tue, 30 Apr 2019 04:29:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1556598559; bh=+/ur1j5so4mZ6i/JA3LuOJ6AVq8+9YmlolMuTmL3dSA=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References: Feedback-ID:From; b=Xqwyszt4KTWKYdWLxoxaP0WUJ4bFCR2b5K5+GiQZy44sofubq7WCZmjG7YYUIKa/9 CpFuauO0TJ4jrWcE2nQrUA2mHU3YqvUkTVb+YjwAqHNWB3oxGDb038jKOBkBh4wajT RKTuHjP8ylRLVZcAjo1ySiW0ByaXSZLDIXmg7FSs= To: Aymeric Vitte From: ZmnSCPxj Reply-To: ZmnSCPxj Message-ID: In-Reply-To: <56b67b57-dc11-183a-1f4e-5a8c296b64cc@gmail.com> References: <21346b3c-dad5-c666-9234-8916aa5a56e4@gmail.com> <201904290301.43459.luke@dashjr.org> <56b67b57-dc11-183a-1f4e-5a8c296b64cc@gmail.com> 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: Thu, 02 May 2019 23:19:41 +0000 Cc: "bitcoin-dev@lists.linuxfoundation.org" Subject: Re: [bitcoin-dev] IsStandard 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: Tue, 30 Apr 2019 04:29:23 -0000 Good morning Aymeric, 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 Monday, April 29, 2019 5:30 PM, Aymeric Vitte w= rote: > ZmnSCPxj, OK, but you can put whatever you like in the different > standard output script you mention (my example below whether legacy or > segwit) > I am uncertain what you mean by this. For P2PKH and P2WPKH, you must present a hash of a public key. You cannot present a hash of anything else. The P2PKH template can be interpreted as a script, but is actually recogniz= ed as a template by most current nodes (in a way that is consistent with in= terpreting it as a script). For P2SH and P2WSH, you must present a hash of a script. It is more helpful to consider that *today* nodes recognize particular patt= erns (P2PKH, P2WPKH, P2SH, P2WSH) as templates and not as scripts to be exe= cuted. In any case, if you want to make anything more complicated than "single sig= ner" you should use P2SH or P2WSH regardless, and give your script. If you want to assure somebody that a particular P2SH or P2WSH commits to a= particular policy, just expose the policy script to them and have them (i.= e. their client software) verify that the policy is what the user wants and= that when hashed it matches the P2SH/P2WSH. As Luke said, nodes can have any policy for propagating transactions. However it is generally expected that P2PKH, P2WPKH, P2SH, and P2WSH will b= e propagated by a majority of nodes, if only because those are reliably "pa= ssed" by `isStandard` in the default latest Bitcoin Core and most people wi= ll not modify the Core code. Generally, anything that isn't P2PKH, P2WPKH, P2SH, or P2WSH will not likel= y be propagated by the network. You *could* still coordinate with one or more miners to get it mined: you c= an put anything in the block, it is simply that most nodes will not inform = miners about transactions that do not pay out to P2PKH, P2WPKH, P2SH, or P2= WSH. Regards, ZmnSCPxj