Delivery-date: Fri, 26 Apr 2024 02:46:07 -0700 Received: from mail-yw1-f191.google.com ([209.85.128.191]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s0I9e-0005Ce-Hk for bitcoindev@gnusha.org; Fri, 26 Apr 2024 02:46:07 -0700 Received: by mail-yw1-f191.google.com with SMTP id 00721157ae682-61aecbcb990sf33669967b3.1 for ; Fri, 26 Apr 2024 02:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1714124760; x=1714729560; darn=gnusha.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-sender:mime-version :subject:references:in-reply-to:message-id:to:from:date:sender:from :to:cc:subject:date:message-id:reply-to; bh=2Yb7jFw+TmRh47Zr/Zhv5Zmy26Huwi4uhUh1R7Zn/9g=; b=gGgTUErmjHaR4igyw+Q1i+KujnhubO/bYFQ7QwyuBjIHvS7/Ds4qARpaYPjO/nnrKN xkEcJ+E6l8Tv7djDbUEbUq3G5ek2H/RXjpzPTq+hgUEpZPWK3L7eJq7cNEdWbbcbU3Il hJKz4+9vqSFBOvJ6AgSLRT0DbbJvDo/w36lmSMG4i79s4hffSGaJxl3V6hgGtCgthDeu J4B5rgqHguLgLwcVAYkEXlw9cPpnYRqmI684lncDoGp/H4/iwrnwOP5jva2TvUlEZLlR 8BmItqHT9XSUpYAiT28riAm0vW/zPS8WGGqaIsrYJ2X1UmY8KXsJ+rDChITDQDc9ms5m GOZA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714124760; x=1714729560; darn=gnusha.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-sender:mime-version :subject:references:in-reply-to:message-id:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=2Yb7jFw+TmRh47Zr/Zhv5Zmy26Huwi4uhUh1R7Zn/9g=; b=Et9LTCw2I2v30hAO9wOM2ROZ5ySoGwJVF5IP4NOxXDvahXuZTWxJZ7fbdm9QfV0gmc Xc7H6RnU3g/wVM60yMaGSj3G536mr1BYWbWol2u+RNztTcHH2wYCgCfnZa/jbHHlM8Yo 78AGRflrRGXq6JW99Tqh7AZdlMCVZ4oj3EB/N5Nq+y8HVG/F9pq41uDdBDEBbCd4xBuq S13AyDXwrINSjdBSu0x1svY3ALjKNWUujKDR9ZNqh3YKwqvMLxw693jkmpB1O+yz9e2M RMOC+kd36dDS3f+YuXIuU7sB4293gH/oitdUhwCIQQltiq1ms9IyO5b7zYf72O9jpKz5 6lNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714124760; x=1714729560; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-sender:mime-version :subject:references:in-reply-to:message-id:to:from:date:x-beenthere :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=2Yb7jFw+TmRh47Zr/Zhv5Zmy26Huwi4uhUh1R7Zn/9g=; b=rDCXbXu913W0GzlUuSuGqInBeQ1AMxMklcmG+80GRUywcoWi6fljlt72vf26yzWq1i mgAdN4v4oYcwzuKSivU/WnEXY6Seh9TYErgy2n7UDXJ9JMlH4q3+z4ff5N+4btDZgiL9 2rvT6HpeT3VC+TUZVM0aebNtrsPDivLp8Gp4TM3uiy+832sKOFbxMK02CVXHyocTITMT qdqm5eArnlE82H5tUPw9I8fgGCPk9PCtaTxvM3kwRTxzoalBN/+2kebum8bm7WG/TXh4 +ky16cgIl86w9lUaEf0iRsYAKvaY4pZD5K0ccWdLymVSIV9ap6wglPF7gN+nONxWLQaH E9ng== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=1; AJvYcCUJ69ZxA6QDprK0MGKTXBMhhJFxdNfkPI4mVT0J65vpowBmdYvSUwfI6GeXCDE+4IEKWHk6I7tXuxKLM8RsyWSlJgj0AsY= X-Gm-Message-State: AOJu0YyyYsWSXm/v68B6E42XyFyv/Y2xHsa9CjNxXl4bmhpSim98yeN1 JKw7OThiC2NPNUYv3vHvvLoVJ/TnmSDCCiKJeyrvXzH4FV8TPv8n X-Google-Smtp-Source: AGHT+IHKDRpR8O6Y2R6OrIG1l74QCsOUd8t86Qn8C9zzV4EJ2mA8Rb37qhg8SqVqBzXl6gv/FW6G4A== X-Received: by 2002:a25:8703:0:b0:de5:5037:8861 with SMTP id a3-20020a258703000000b00de550378861mr2154926ybl.48.1714124759942; Fri, 26 Apr 2024 02:45:59 -0700 (PDT) X-BeenThere: bitcoindev@googlegroups.com Received: by 2002:a25:2748:0:b0:de5:49a0:e397 with SMTP id 3f1490d57ef6-de5861ea01dls355380276.2.-pod-prod-07-us; Fri, 26 Apr 2024 02:45:58 -0700 (PDT) X-Received: by 2002:a0d:dd0d:0:b0:61b:737:1a86 with SMTP id g13-20020a0ddd0d000000b0061b07371a86mr472964ywe.10.1714124758365; Fri, 26 Apr 2024 02:45:58 -0700 (PDT) Received: by 2002:a05:690c:9:b0:61a:e84a:c592 with SMTP id 00721157ae682-61ba917c6bbms7b3; Fri, 26 Apr 2024 01:09:25 -0700 (PDT) X-Received: by 2002:a05:6902:20ca:b0:de4:6624:b763 with SMTP id dj10-20020a05690220ca00b00de46624b763mr695633ybb.0.1714118964532; Fri, 26 Apr 2024 01:09:24 -0700 (PDT) Date: Fri, 26 Apr 2024 01:09:24 -0700 (PDT) From: Garlo Nicon To: Bitcoin Development Mailing List Message-Id: In-Reply-To: References: Subject: [bitcoindev] Re: BIP for OP_INTERNALKEY MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_444_1130141159.1714118964184" X-Original-Sender: garlonicon@gmail.com Precedence: list Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com List-ID: X-Google-Group-Id: 786775582512 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Score: -0.5 (/) ------=_Part_444_1130141159.1714118964184 Content-Type: multipart/alternative; boundary="----=_Part_445_1334399062.1714118964184" ------=_Part_445_1334399062.1714118964184 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I wonder, what is the reason to pick 0xcb as OP_INTERNALKEY, when we had=20 pseudo-words OP_PUBKEY (assigned to 0xfe) and OP_PUBKEYHASH (assigned to=20 0xfd). Of course, those opcodes are invalid in the non-Taproot scripts, but= =20 they were intended to be used in cases like "OP_PUBKEY OP_CHECKSIG", and=20 "OP_DUP OP_HASH160 OP_PUBKEYHASH OP_EQUALVERIFY OP_CHECKSIG". So, I guess= =20 we could reuse those opcodes, and make it a general rule, that OP_PUBKEY=20 picks the next key from the stack (which in this specific case will give us= =20 the internal key, but I can imagine leaving some room for extending it in= =20 the future, with scripts like "OP_PUBKEY OP_CHECKSIGVERIFY OP_PUBKEY=20 OP_CHECKSIG", where each of those OP_PUBKEYs will give us a different key,= =20 and act somewhat like OP_FROMALTSTACK, but working on a separate stack of= =20 public keys instead, where the first key of that stack would be the=20 internal Taproot key). czwartek, 25 kwietnia 2024 o 12:41:04 UTC+2 Brandon Black napisa=C5=82(a): > Hello list, > > I'm currently failing to find the original reference discussion for > adding OP_INTERNALKEY to tapscript. I believe it was in the context of > the SIGHASH_ANYPREVOUT proposal which opted instead to access the > internalkey as a special key with value `0x01`. Regardless, here[0] is a > BIP for adding OP_INTERNALKEY to tapscript to allow access to the > taproot internal key. As noted below, this helps certain classes of > script come closer to matching segwitv0 in byte efficiency, which can be > particularly useful for protocols such as Lightning where the same > signers may need to sign a script path in some cases, and a key path in > others. > > ------------ > ## Abstract > > This BIP describes a new tapscript opcode (`OP_INTERNALKEY`) which > pushes the taproot internal key to the stack. > > ## Specification > > When verifying taproot script spends having leaf version `0xc0` (as > defined in [BIP 342]), `OP_INTERNALKEY` replaces `OP_SUCCESS203` (0xcb). > `OP_INTERNALKEY` pushes the taproot internal key, as defined in [BIP > 341], to the stack. > > ## Motivation > > ### Key spend with additional conditions > > When building taproot outputs, especially those secured by an aggregate > key representing more than one signer, the parties may wish to > collaborate on signing with the taproot internal key, but only with > additional script restrictions. In this case, `OP_INTERNALKEY` saves 8 > vBytes. > > ### Mitigated control block overhead for scripts using hash locks > > In cases where script path spending is not desired, the internal key may > be set to a NUMS point whose bytes would otherwise be required in a > tapscript. This could be used with any hash locked transaction, for > example, to save 8 vBytes. > > Note: The internal key must be the X coordinate of a point on the > SECP256K1 curve, so any such hash must be checked and modified until it > is such an X coordinate. This will typically take approximately 2 > attempts. > > ## Reference Implementation > > A reference implementation is provided here: > > https://github.com/bitcoin/bitcoin/pull/29269 > > ## Backward Compatibility > > By constraining the behavior of an OP_SUCCESS opcode, deployment of the > BIP can be done in a backwards compatible, soft-fork manner. If anyone > were to rely on the OP_SUCCESS behavior of `OP_SUCCESS203`, > `OP_INTERNALKEY` would invalidate their spend. > > ## Deployment > > TBD > > ## Copyright > > This document is licensed under the 3-clause BSD license. > > [BIP 341]: https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki > > [BIP 342]: https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki > > ------------ > > [0]: https://github.com/bitcoin/bips/pull/1534 > > --=20 > --Brandon > --=20 You received this message because you are subscribed to the Google Groups "= Bitcoin Development Mailing List" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to bitcoindev+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/= bitcoindev/f95ca346-fc95-4cc7-9ded-1393e8dc827en%40googlegroups.com. ------=_Part_445_1334399062.1714118964184 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I wonder, what is the reason to pick 0xcb as OP_INTERNALKEY, when we had ps= eudo-words OP_PUBKEY (assigned to 0xfe) and OP_PUBKEYHASH (assigned to 0xfd= ). Of course, those opcodes are invalid in the non-Taproot scripts, but the= y were intended to be used in cases like "OP_PUBKEY OP_CHECKSIG", and "OP_D= UP OP_HASH160 OP_PUBKEYHASH OP_EQUALVERIFY OP_CHECKSIG". So, I guess we cou= ld reuse those opcodes, and make it a general rule, that OP_PUBKEY picks th= e next key from the stack (which in this specific case will give us the int= ernal key, but I can imagine leaving some room for extending it in the futu= re, with scripts like "OP_PUBKEY OP_CHECKSIGVERIFY OP_PUBKEY OP_CHECKSIG", = where each of those OP_PUBKEYs will give us a different key, and act somewh= at like OP_FROMALTSTACK, but working on a separate stack of public keys ins= tead, where the first key of that stack would be the internal Taproot key).=

czwartek, 25 kwietnia 2024 o=C2=A012:41:04 UTC+2 Brandon Black napisa=C5= =82(a):
Hello= list,

I'm currently failing to find the original reference discussion for
adding OP_INTERNALKEY to tapscript. I believe it was in the context of
the SIGHASH_ANYPREVOUT proposal which opted instead to access the
internalkey as a special key with value `0x01`. Regardless, here[0] is = a
BIP for adding OP_INTERNALKEY to tapscript to allow access to the
taproot internal key. As noted below, this helps certain classes of
script come closer to matching segwitv0 in byte efficiency, which can b= e
particularly useful for protocols such as Lightning where the same
signers may need to sign a script path in some cases, and a key path in
others.

------------
## Abstract

This BIP describes a new tapscript opcode (`OP_INTERNALKEY`) which
pushes the taproot internal key to the stack.

## Specification

When verifying taproot script spends having leaf version `0xc0` (as
defined in [BIP 342]), `OP_INTERNALKEY` replaces `OP_SUCCESS203` (0xcb)= .
`OP_INTERNALKEY` pushes the taproot internal key, as defined in [BIP
341], to the stack.

## Motivation

### Key spend with additional conditions

When building taproot outputs, especially those secured by an aggregate
key representing more than one signer, the parties may wish to
collaborate on signing with the taproot internal key, but only with
additional script restrictions. In this case, `OP_INTERNALKEY` saves 8
vBytes.

### Mitigated control block overhead for scripts using hash locks

In cases where script path spending is not desired, the internal key ma= y
be set to a NUMS point whose bytes would otherwise be required in a
tapscript. This could be used with any hash locked transaction, for
example, to save 8 vBytes.

Note: The internal key must be the X coordinate of a point on the
SECP256K1 curve, so any such hash must be checked and modified until it
is such an X coordinate. This will typically take approximately 2
attempts.

## Reference Implementation

A reference implementation is provided here:

http= s://github.com/bitcoin/bitcoin/pull/29269

## Backward Compatibility

By constraining the behavior of an OP_SUCCESS opcode, deployment of the
BIP can be done in a backwards compatible, soft-fork manner. If anyone
were to rely on the OP_SUCCESS behavior of `OP_SUCCESS203`,
`OP_INTERNALKEY` would invalidate their spend.

## Deployment

TBD

## Copyright

This document is licensed under the 3-clause BSD license.

[BIP 341]: https://github.com/bitcoin/bips/bl= ob/master/bip-0341.mediawiki

[BIP 342]: https://github.com/bitcoin/bips/bl= ob/master/bip-0342.mediawiki

------------

[0]: https:/= /github.com/bitcoin/bips/pull/1534

--=20
--Brandon

--
You received this message because you are subscribed to the Google Groups &= quot;Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to bitcoind= ev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg= id/bitcoindev/f95ca346-fc95-4cc7-9ded-1393e8dc827en%40googlegroups.com.=
------=_Part_445_1334399062.1714118964184-- ------=_Part_444_1130141159.1714118964184--