Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8024C1320 for ; Sun, 26 May 2019 21:17:34 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 794CC6C5 for ; Sun, 26 May 2019 21:17:32 +0000 (UTC) Received: by mail-wr1-f50.google.com with SMTP id l17so6504049wrm.10 for ; Sun, 26 May 2019 14:17:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=pKAvvGU4sVia0o77D5uOQKilDmn01rDy59KeYRUH4IU=; b=AMR7Z8XTiPI49Y4897PvT+uB5tFw5nyjkrODjV+vfKXBpkIS+GPpPu1LNpi6KVMPKy 0jQXQqJIOyxqChWP1y8KiBLRA/VtWK2nYvgy96EDVS6Dkn0bv0uQqNJEczlrdSUMuhqy ZxVkcBd7LqbYUyfKawut4mWKzaptGe6jNVNoDdv62GvUmZJ/m8VqROMngqyQ5nmLtMBV 13MVz5zfBTiFTkbxdnFBrPSXZfYWxd5DXOXCLKDqtWA82WlqG0Vw3jrLKK3BP3Yl3h74 Y2pKHuoBmHGBJtYd9ruAaAxWcg7QnkCiFg8zKn5nuOIu5EPC8AxSllkRjsXF7sneFxPC Qcew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=pKAvvGU4sVia0o77D5uOQKilDmn01rDy59KeYRUH4IU=; b=YRkHQX6mi3cvC8cPoCsm1ahkA80aISZsT6U3EMwEhZ31qgvbw6Ej9l8YR5nzf3UlI7 J4EeCPDiSewC4FGpnMJ9Cw8nfN+z8l9O6BjOjLPcpSpMVKMDB3WJO7taCTGAznSbXafi Zt9a1kVgefveySgWiX7AyxKA9z/k3hSN4wnoyKcIdoWGBoTJzWy3+GpYmO6X7Pa8Sz5J RKP950CZz+GxK5aJR0k0kNZvDzyWhA8YVZwaiQ9idBKKK/3v4YEMKv6Ng8PI8JpzeXLG 4taMaSjZo+U2k0X6WbK1Ux2hFZPliRYclG1fu4j/DkQ0NKkdWXNmdIZWB2dxsGabIj+V VkRQ== X-Gm-Message-State: APjAAAVj7+cf+f6TBJUdVk60NczzjEhqbGqCuKUlRwRM7yQPtk5SStOC V9BG2kbnXRL/2C7Oh+WJbZE= X-Google-Smtp-Source: APXvYqxFHP9KLXQHkCTE3F3EhJ4ikOFA/4Q2a/cYA/7/fJD80XwX/gRF3LWGmSkL8tcFInVmceHesw== X-Received: by 2002:a5d:6506:: with SMTP id x6mr7923773wru.339.1558905451172; Sun, 26 May 2019 14:17:31 -0700 (PDT) Received: from ?IPv6:2a01:cb1d:44:6500:9d6d:71b2:cb71:cb17? ([2a01:cb1d:44:6500:9d6d:71b2:cb71:cb17]) by smtp.googlemail.com with ESMTPSA id l18sm24535680wrh.54.2019.05.26.14.17.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 May 2019 14:17:30 -0700 (PDT) To: Johnson Lau References: <6DFB6C65-D123-40FD-9CE3-49FFCA81EE46@xbt.hk> <253DB697-BECF-4D68-8A1E-1549B52D5AFA@xbt.hk> From: Aymeric Vitte Openpgp: preference=signencrypt Autocrypt: addr=vitteaymeric@gmail.com; prefer-encrypt=mutual; keydata= mQINBFdW8uABEAC7HJScbB2d/lmYoY5Cn9loEjJwfLs1LC3om030bWFGiH3Ceo5XeHUT94rw Pi+HaHU8ea94425SXIFsnqp/ouoT/8Ffn6vED0OoRmK0jE4fqDApXSpoL2mHX9PAGdUItMtD YrxBiBZNfM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StdE7hO vv2THuesjJDsj6aQUTgknaxKptJogNe3dDyIT+FHxXmCw0Nrbm9Q3ryl80z/G9utfFNO3Gwc q31QW3n3LJHnpqdrV3WsRzT5NwJMVtiIAGRrX8ZomtarWHT0PeEHC2xBdFzRrJtmkrwer0Wc 0nBzD7vk1XEXC9nODbmlgsesoHFgRwQBst3wClCbX1gv8aSfxQNpaf9UBC8DmyrQ621UXpBo PvcFEtWxV44vJfP0WOLCCN0Pzv2F2I66iKo7VMqbr5jlNAXJN9I1hXb7qwYJmBC9j5oeEoqv A9d44WWpxrdAr8qih4Nv89k9+9F6NoqORY3FGuVDKiW8CVhCmGT7bIvNeyicVBZFipXqPcKL VFduO2c5Ubc2npMWLUF1k9JJc9tH75l3+F/0RbYVTzGAZ+zSaudwR6h8YiCN2DBZGZkJEZbh 3X/l6jtijMN/W9sPHyyKvm/TmeEC27S3TqZPZ8PUQLxZC70V6gMbenh01JdSQsn5t8Ru0RNh Blt0g7IyZyIKCE9b+TyzbYpX6qgqEBUHia5b0vyPtQacWQlZ8uqnghAqNkLluEsy7Q/7xG6M wXUYEDsFOmB9dKOzcAOIhpxlVjSKu5mzXJ11sEtE8nyF5NJ/riCA7FGcjlki3zIpzQUNo9v7 vXl2h6Tivlk= Message-ID: <6d6766da-67fb-31e1-eceb-663bffeef74a@gmail.com> Date: Sun, 26 May 2019 23:17:30 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: fr X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE 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, 27 May 2019 14:28:45 +0000 Cc: bitcoin-dev , me@thomaskerin.io, Pieter Wuille Subject: Re: [bitcoin-dev] Two questions about segwit implementation 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: Sun, 26 May 2019 21:17:34 -0000 Well, OK, then back to non standard stuff and bitcoin considers that an OP_1 or empty scriptpubkey is something that can exist, sipa does not like my questions on this list but this is a bit frightening in fact to see that after 10 years an OP_1 scriptpubkey or empty one can be a use case, thanks Thomas also, where all of this is clearly documented so people don't bother the list not to produce approximative stuff remains mysterious Le 26/05/2019 à 19:24, Johnson Lau a écrit : > Empty scriptSig doesn’t imply segwit input: if the previous scriptPubKey is OP_1 (which does not allow witness), it could still be spent with an empty scriptSig > > Similarly, a scriptSig looking like a spend of P2SH-segwit doesn’t imply segwit input: if the previous scriptPubKey is empty, it could be spent with a push of any non-zero value. > >> On 27 May 2019, at 1:09 AM, Aymeric Vitte wrote: >> >> I did not phrase correctly in fact, what I meant is: if the validator >> sees empty or witness script in scriptSig, then this is a segwit input, >> and doing this one by one the validator can associate the correct segwit >> data to the correct segwit input, so 00 does not look to be needed >> >> Le 26/05/2019 à 18:28, Johnson Lau a écrit : >>> This is not how it works. While the transaction creator may know which inputs are segwit, the validators have no way to tell until they look up the UTXO set. >>> >>> In a transaction, all information about an input the validators have is the 36-byte outpoint (txid + index). Just by looking at the outpoint, there is no way to tell whether it is segwit-enabled or not. So there needs to be a way to tell the validator that “the witness for this input is empty”, and it is the “00”. >>> >>>> On 27 May 2019, at 12:18 AM, Aymeric Vitte wrote: >>>> >>>> ……. for the 00 number of witness >>>> data for non segwit inputs the one that is doing the transaction knows >>>> which inputs are segwit or not, then parsing the transaction you can >>>> associate the correct input to the correct witness data, without the >>>> need of 00, so I must be missing the use case >