public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Johnson Lau <jl2012@xbt.hk>
To: Aymeric Vitte <vitteaymeric@gmail.com>
Cc: bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] Two questions about segwit implementation
Date: Mon, 27 May 2019 00:28:57 +0800	[thread overview]
Message-ID: <253DB697-BECF-4D68-8A1E-1549B52D5AFA@xbt.hk> (raw)
In-Reply-To: <e342cb8f-a909-a806-bd76-91580234cd7f@gmail.com>

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 <vitteaymeric@gmail.com> 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




  reply	other threads:[~2019-05-26 16:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-25 23:56 [bitcoin-dev] Two questions about segwit implementation Aymeric Vitte
2019-05-26 14:33 ` Johnson Lau
2019-05-26 16:18   ` Aymeric Vitte
2019-05-26 16:28     ` Johnson Lau [this message]
2019-05-26 17:09       ` Aymeric Vitte
2019-05-26 17:24         ` Johnson Lau
2019-05-26 21:17           ` Aymeric Vitte
2019-05-26 17:54 ` Pieter Wuille
2019-05-26 19:34 ` Thomas Kerin
2019-05-27  7:26 ` Kostas Karasavvas

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=253DB697-BECF-4D68-8A1E-1549B52D5AFA@xbt.hk \
    --to=jl2012@xbt.hk \
    --cc=bitcoin-dev@lists.linuxfoundation.org \
    --cc=vitteaymeric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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