Return-Path: Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 789F6C0032 for ; Fri, 11 Aug 2023 10:07:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 4D0FD8213B for ; Fri, 11 Aug 2023 10:07:02 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 4D0FD8213B Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=satoshilabs.com header.i=@satoshilabs.com header.a=rsa-sha256 header.s=google header.b=Ucj0tHpR X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -2.099 X-Spam-Level: X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BFSRB9o6_NXn for ; Fri, 11 Aug 2023 10:07:01 +0000 (UTC) Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by smtp1.osuosl.org (Postfix) with ESMTPS id C0E258210C for ; Fri, 11 Aug 2023 10:07:00 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org C0E258210C Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-986d8332f50so256076566b.0 for ; Fri, 11 Aug 2023 03:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=satoshilabs.com; s=google; t=1691748419; x=1692353219; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=EB+tn4wMqJxKYkeF3ul/Ex90D7fQoBEKpb/5sLdkgZc=; b=Ucj0tHpR075XygIakoviQ1ocYBykYOOe/AGN8kRJEpoSFDVjEIeroxyZG1dmHSW8YL 1NPKzcTy80W0pbRlwtIEYbmJB+ZbgAr7IbgPikTmeOnW8SgnJrv7gzftg1lOtYTv5mFJ 2Oru9IwzDLRggfmJH54v1xCgOeGrGxjX0drI+/ApLZKUtNheOAWlVQZCCj6tkwBBG0uZ TQPdfb/bLd7j4bYS5FulBQutBbGV3jn0OYqJQTsiswUYCcM2+ZQu0MvmvbsoXQDzGDdG K3Rkl35J13BadNbiS9njNas2MF3J4ouOBucigY2CkOvXr7xdeHWuJQOjxkUoWJ5TIj/h iiJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691748419; x=1692353219; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EB+tn4wMqJxKYkeF3ul/Ex90D7fQoBEKpb/5sLdkgZc=; b=bdmkWKU4K2jqnx9skYDju/ES/YDk0V1kNdCgwykItGEpqOT3mVPh9yfkCRu3Y4keVt D3cxxJT3wNZXEOy2rNLiCtcAPoxoZpS8zYeytzMVZPXNXRlqR9blBDz52F8er80tElj3 Ru68Gk+yRAZzMBMYx0YfJ4IGwRrIrQCp06UKtihr9vTqobwgZI51NN0Ar/rJOWUxGfEq ZH1uPRfq66SRGO9TZy9CivCU+TMr6Vn1MJk0KM3cUar9u+SqcLehFodOMul1YFt5tp3w wIm4UU06S3o/foeSApTaB6WRqISY1AfTEvxRuceCCcUYzDPmQH7z7sfnAxQkzsUZjiNi o29w== X-Gm-Message-State: AOJu0Yxu8eM62ppwRHOFY2pzMHxIiUyODIwH4ZSaLMrLez7wvEL8BaLI FQR73fkPJTAAXrRRznUH3MEfW9ovq2wFPQsVeIgENqgIDDUYZEzsI5M= X-Google-Smtp-Source: AGHT+IFt6vMw/Dfh9uH7H066yIPHgGmuVOR1VMLwMwgJp6t5bPMnNzetp1i7mNLkKTHijVxqrePE+BKUwxBQOEoU9I0= X-Received: by 2002:a17:906:1cf:b0:99c:57ed:baf1 with SMTP id 15-20020a17090601cf00b0099c57edbaf1mr1171715ejj.51.1691748418784; Fri, 11 Aug 2023 03:06:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pavol Rusnak Date: Fri, 11 Aug 2023 12:06:22 +0200 Message-ID: To: Tobin Harding , Bitcoin Protocol Discussion Content-Type: multipart/alternative; boundary="0000000000008d28420602a2df83" Subject: Re: [bitcoin-dev] segwit naming ambiguity X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Aug 2023 10:07:02 -0000 --0000000000008d28420602a2df83 Content-Type: text/plain; charset="UTF-8" Here's my idea for a clean API: 1. `is_segwit()` returns true for a p2tr output 2. a function `segwit_version()` which returns an int according to segwit version used 3. helper functions like `is_p2wpkh()`, `is_p2tr()`, `is_p2wsh()` for all script types which all return a bool On Fri, 11 Aug 2023 at 08:41, Tobin Harding via bitcoin-dev < bitcoin-dev@lists.linuxfoundation.org> wrote: > Question for OG bitcoin API designers please. > > If you were to see the following function > > `is_segwit()` > > would you assume it returns `true` or `false` for a p2tr transaction? > > > Currently we (rust-bitcoin) are being liberal with the use of `v0` but > its a pretty ugly. Is there an official, or widely used, name for segwit > v0? > > > Thanks, > Tobin. > _______________________________________________ > bitcoin-dev mailing list > bitcoin-dev@lists.linuxfoundation.org > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev > -- Best Regards / S pozdravom, Pavol "Stick" Rusnak Co-Founder, SatoshiLabs --0000000000008d28420602a2df83 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Here's my idea for a clean API:

1. `is_segwit()` returns true for a p2tr output

2. a = function `segwit_version()` which returns an int according to segwit versio= n used

3. helper functions like `is_p2wpkh()`, `is= _p2tr()`, `is_p2wsh()` for all script types which all return a bool
=C2=A0

On Fri, 11 Aug 2023 at 08:41, Tobin Harding via bitcoin-dev= <bitcoin-dev@l= ists.linuxfoundation.org> wrote:
Question for OG bitcoin API designers please.

If you were to see the following function

=C2=A0 =C2=A0 `is_segwit()`

would you assume it returns `true` or `false` for a p2tr transaction?


Currently we (rust-bitcoin) are being liberal with the use of `v0` but
its a pretty ugly. Is there an official, or widely used, name for segwit v0= ?


Thanks,
Tobin.
_______________________________________________
bitcoin-dev mailing list
= bitcoin-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mail= man/listinfo/bitcoin-dev


--
Best Regards / S pozdr= avom,

Pavol "Stick" Rusnak
Co-= Founder, SatoshiLabs
--0000000000008d28420602a2df83--