Delivery-date: Tue, 22 Jul 2025 15:03:51 -0700 Received: from mail-oo1-f55.google.com ([209.85.161.55]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ueL5S-0004xp-Vu for bitcoindev@gnusha.org; Tue, 22 Jul 2025 15:03:51 -0700 Received: by mail-oo1-f55.google.com with SMTP id 006d021491bc7-61594e7b862sf6398597eaf.0 for ; Tue, 22 Jul 2025 15:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1753221825; x=1753826625; 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:message-id:to:from:date:sender:from:to:cc:subject:date :message-id:reply-to; bh=od3vbguTPJMaqa0q9Y3aSqsY8whARMkCZSeKIbJr78U=; b=TIjzMnyUKrqNUn7V4EE0t8no1GKWRGJpO4QID1JWrW6UXFo1NNMwFXqUNUbxfcR06U oS+9l0hdkbJhOgyA3g9t34s8xKXFh75TwQZCrmFPO3I8Pp3I4Lblo6zyGtNQEX9LFhBi 2Y0tn7EnkLgbI8iA24Q2FKZwrLjrKj+0puFuZcfCh+OqGjwm8ACWC5Z6lhupcQiiiiKw VnG96wnY1pf9iHtpgJ0Yp7oQZBZupk+7DXbJkKx2orN46jbaXTjrU/uIRyFHPRnVToRh eQ693LxEoYL+qoBZ9hXtVdvU7oXmy+sT1//acRxRY5dc5qU6SkXjQjkU//YcnoYlX9h/ +kKA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753221825; x=1753826625; 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:message-id:to:from:date:from:to:cc:subject:date:message-id :reply-to; bh=od3vbguTPJMaqa0q9Y3aSqsY8whARMkCZSeKIbJr78U=; b=cjpDMLzTo67o/kM0n/F9ftBMicY/8q3aDLDWbYqUkIq4z4mpOETjPd06fn6/IJ2iHW R5oU+cxZi/XuJdEQlOCUGQ6KHFu+S+Z2Chyd2qp8oMF66+MXjkgn11yHtd9fNoAq3cYN Qeop6gwcxu3kSv5ITbs4zSAhkQB50v4kfpBxxW5bfRypeXLwESvRt3ESbXVd+UNPMfQ/ GvQxU2FyQoyRi1rJ6k1dpSVM+CVjIG0wj+pxUl2/M8yEmLiXXk/D5q3d1KLaSJRpZmWp k+WFDJiF9CTgemqSvGUAQoBd92XfnOCb3AI3JZt9BNpSR4dLLkLYEBtMaaePl0o6ozxJ G9pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753221825; x=1753826625; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-sender:mime-version :subject:message-id:to:from:date:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=od3vbguTPJMaqa0q9Y3aSqsY8whARMkCZSeKIbJr78U=; b=aCPx17QFaitP2YVTX4d2YL9mcXqgmFAyZ7tB5BXNMIqHCAjh8cgSZJAUzMk5R5OzKm uzUnR3QAew3LOWwqy6kxIC0ObkN4PfttkDi9IYZdrx+dp/meKZf0SmQ0XFvOknHbUC0u uORpDjFRjvyvevDcnoCSDdBgnKC6Tt6238yj/M1i55SSrUSC+34WJGUAyNOrJ+cQxsmz n+Ksx08ZMxt7AgYzyZSWNBYrF9vjIIWmFr5QphVPNQBWQ8by/63TphxIPc2NI1VpLe4s Vr1/qKCb7k5yDmQYyfP+8o1/E2xK+XMqOZmDVDw5YnHX7r0+TzPU0G3SV4u/EccFLn+f YUxA== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=1; AJvYcCXDgCFs94NOy+1iidvL+nTNeDIkGUKyOy6fzc/pbKS+tWwqGRuNVMdbs10cYiVDKnXkY/fVVFl341pF@gnusha.org X-Gm-Message-State: AOJu0Yy/Vf40djfFYSTY6ZfxKn4Dn0IrUqo05XNg47+68Tejd34Ag+Ob QZl19eb1fhAKQHI5hn/mI6NTtUJAFHzxp51ui4lut5Zc+owCXu11uiMu X-Google-Smtp-Source: AGHT+IE/VmYIY5Q/ePn03vwyKVaNi3C5XzYBVO39Z+mndyn2zLTF3/Jqpm1GZFYPIGRMyrCvt0K+6A== X-Received: by 2002:a05:6808:17a9:b0:40b:4230:387b with SMTP id 5614622812f47-426c42f756cmr689554b6e.6.1753221824496; Tue, 22 Jul 2025 15:03:44 -0700 (PDT) X-BeenThere: bitcoindev@googlegroups.com; h=AZMbMZeruRQuspTZr4WFTkX0WTdVze3NSyDbNrWjvTsJeSRYhw== Received: by 2002:a05:6820:530c:b0:611:af23:1d9e with SMTP id 006d021491bc7-615ac57d8bfls1735548eaf.0.-pod-prod-01-us; Tue, 22 Jul 2025 15:03:41 -0700 (PDT) X-Received: by 2002:a05:6808:1985:b0:421:4d86:67b with SMTP id 5614622812f47-426c6434dffmr857838b6e.26.1753221821168; Tue, 22 Jul 2025 15:03:41 -0700 (PDT) Received: by 2002:a81:dc0a:0:b0:711:63b1:720 with SMTP id 00721157ae682-719b29f903ams7b3; Tue, 22 Jul 2025 14:44:03 -0700 (PDT) X-Received: by 2002:a05:690c:3683:b0:719:5d76:74b with SMTP id 00721157ae682-719b42d1908mr9666717b3.33.1753220642563; Tue, 22 Jul 2025 14:44:02 -0700 (PDT) Date: Tue, 22 Jul 2025 14:44:02 -0700 (PDT) From: Josh Doman To: Bitcoin Development Mailing List Message-Id: <8fbe1fe3-425d-4056-8387-993f6ecc1been@googlegroups.com> Subject: [bitcoindev] Revisiting secp256r1 signatures (i.e. P256, mobile HSM support) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1096_1724980226.1753220642283" X-Original-Sender: joshsdoman@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: 2.6 (++) ------=_Part_1096_1724980226.1753220642283 Content-Type: multipart/alternative; boundary="----=_Part_1097_1344044231.1753220642283" ------=_Part_1097_1344044231.1753220642283 Content-Type: text/plain; charset="UTF-8" A brief search on gnusha.org suggests that it's been over 10 years since the Bitcoin community last discussed adding secp256r1 support (also known as P256). The most in-depth discussions I found were on BitcoinTalk in 2011 and 2013 . Since then, P256 has gained widespread adoption across the modern internet and on mobile. Most notably, millions of users now possess mobile devices capable of generating and storing private keys in secure enclaves (see Apple iCloud Keychain and Android Keystore). Millions of users might be able to immediately use this to start self-custodying bitcoin, except this hardware only supports P256 signatures, which is incompatible with the secp256k1 curve that Bitcoin currently uses. Reading through old discussions, it appears that the primary concern the community had with P256 is the possibility of a NIST backdoor. Putting the likelihood of this aside, it seems reasonable to me that in 2025, users should at least have the option of using P256, if they wish. Native HSM support would significantly improve the onboarding experience for new users, increase the security and accessibility of hot wallets, and potentially reduce the cost of collaborative multisigs. Meanwhile, the community can continue to use secp256k1 as the ideal curve for private keys secured in cold storage. At a technical level, Tapscript makes P256 mechanically straightforward to adopt, because it has built-in support for new types of public keys. For example, we could define a 33-byte public key as one requiring a P256 ECDSA signature, while continuing to use 32-bytes for keys requiring Schnorr signatures over secp256k1. A secondary concern that I came across is that P256 can be 2-3x slower to validate than secp256k1. Assuming this cannot be improved, we can account for slower validation by doubling or tripling the validation weight cost for a P256 signature. Users can then pre-commit in their script to this additional weight or commit to it in the annex, as intended by BIP341 . P256 support would grant apps the ability to use platform APIs to access the secure HSM on user's mobile devices, but alone, P256 is insufficient for non-custodial WebAuthn / passkey-based wallets. To verify a WebAuthn signature, we'd additionally need CSFS and CAT, so we can compute a WebAuthn message from a sighash and the necessary WebAuthn data on the stack. Alternatively, we could create a dedicated WebAuthn opcode to verify a WebAuthn message without enabling recursive covenants. Regardless, the ability to verify a P256 signature would be an important primitive. In summary, *given the widespread hardware adoption and industry usage, is it worth revisiting adding P256 support to Bitcoin?* Josh Doman -- 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 email to bitcoindev+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/8fbe1fe3-425d-4056-8387-993f6ecc1been%40googlegroups.com. ------=_Part_1097_1344044231.1753220642283 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable A brief search on gnusha.org suggests that it's been over 10 years since the Bitcoin c= ommunity last discussed adding secp256r1 support (also known as P256). The = most in-depth discussions I found were on BitcoinTalk in 2011 and 2013.

Since then, P256 ha= s gained widespread adoption across the modern internet and on mobile. Most= notably, millions of users now possess mobile devices capable of generatin= g and storing private keys in secure enclaves (see Apple iCloud Keychain an= d Android Keystore). Millions of users might be able to immediately use thi= s to start self-custodying bitcoin, except this hardware only supports P256= signatures, which is incompatible with the secp256k1 curve that Bitcoin cu= rrently uses.

Reading through old discussions, it appears that t= he primary concern the community had with P256 is the possibility of a NIST= backdoor. Putting the likelihood of this aside, it seems reasonable to me = that in 2025, users should at least have the option of using P256, if they = wish. Native HSM support would significantly improve the onboarding experie= nce for new users, increase the security and accessibility of hot wallets, = and potentially reduce the cost of collaborative multisigs. Meanwhile, the = community can continue to use secp256k1 as the ideal curve for private keys= secured in cold storage.

At a technical level, Tapscript makes = P256 mechanically straightforward to adopt, because it has built-in support= for new types of public keys. For example, we could define a 33-byte publi= c key as one requiring a P256 ECDSA signature, while continuing to use 32-b= ytes for keys requiring Schnorr signatures over secp256k1.

A sec= ondary concern that I came across is that P256 can be 2-3x slower to valida= te than secp256k1. Assuming this cannot be improved, we can account for slo= wer validation by doubling or tripling the validation weight cost for a P25= 6 signature. Users can then pre-commit in their script to this additional w= eight or commit to it in the annex, as intended by BIP341.

P= 256 support would grant apps the ability to use platform APIs to access the= secure HSM on user's mobile devices, but alone, P256 is insufficient for n= on-custodial WebAuthn / passkey-based wallets. To verify a WebAuthn signatu= re, we'd additionally need CSFS and CAT, so we can compute a WebAuthn messa= ge from a sighash and the necessary WebAuthn data on the stack. Alternative= ly, we could create a dedicated WebAuthn opcode to verify a WebAuthn messag= e without enabling recursive covenants. Regardless, the ability to verify a= P256 signature would be an important primitive.

In summary, = given the widespread hardware adoption and industry usage, is it worth revi= siting adding P256 support to Bitcoin?

Josh Doman

--
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 visit https://groups.google.com/d/msgid/bitcoind= ev/8fbe1fe3-425d-4056-8387-993f6ecc1been%40googlegroups.com.
------=_Part_1097_1344044231.1753220642283-- ------=_Part_1096_1724980226.1753220642283--