Return-Path: Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id D825CC0032 for ; Sat, 12 Aug 2023 01:05:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id A56F8400D8 for ; Sat, 12 Aug 2023 01:05:21 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org A56F8400D8 Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=lifewithalacrity-com.20221208.gappssmtp.com header.i=@lifewithalacrity-com.20221208.gappssmtp.com header.a=rsa-sha256 header.s=20221208 header.b=gQSG7Tdx X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -1.399 X-Spam-Level: X-Spam-Status: No, score=-1.399 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=no autolearn_force=no Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EHJvXuwI08jt for ; Sat, 12 Aug 2023 01:05:20 +0000 (UTC) Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) by smtp2.osuosl.org (Postfix) with ESMTPS id 46C53400C5 for ; Sat, 12 Aug 2023 01:05:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 46C53400C5 Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-583b3aa4f41so26240387b3.2 for ; Fri, 11 Aug 2023 18:05:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lifewithalacrity-com.20221208.gappssmtp.com; s=20221208; t=1691802319; x=1692407119; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=i3aaWKB0v05jbJsazKGOufOuIyW9G0pgAlq5VxrEgFc=; b=gQSG7TdxQw+graGN2z7D8EUqVwzmlfUXaM9p4C4UQJW5AKHBs5Jx0isTspwzQMRKWJ 6YYYeJ/mNlxSSt4KB2MYa72KKej53o+Fh87QwkWX+9YNo+o+tGoJYiL71jhTvQaMlrXH GNwzTkztSs7uh6g7MddCmurDoeRDvub3U1X+PLjlPV1kSg+5eFz3Gh21ua/Ydd/l9Wu+ WffgBMQ3JEDvjHbb2D1JYAW4g4UKN/w77DC9SNy30dIK1MX67nqBcJ/eQbi52OB0nUdC waj4hqWDNYoNRkHmPblUDL2iWpWrh+Eh4S9aF4uoyVHLZZmB9+Bkm76xylKmVgqesgA1 z71w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691802319; x=1692407119; h=cc: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=i3aaWKB0v05jbJsazKGOufOuIyW9G0pgAlq5VxrEgFc=; b=gOFFMvriWz5rlSbUR98wesTxDOfXkwyL7n0Ks2uCPH7Oe4PrPDUw0+TfB1fPf4B2xf 1gxctMEQLXX8JRiCVMb3zMRqyqCzBi28QgLw1FV9hoEooVhdCqFR2P6y+3Ubh4xKqDDh abu9jcEDVL50bmBXwmxZpx/O4AQTNkkzDh8ZrsADbhzTdXW1b5Th34G0d+46i1N5OR3k 9+izAafxf5Or5qLmNV4bxD4i9KNjEXtGdHsVQgdCWiWGXNhIZJ/dMiqxv2cvLDXn9Yx9 UryNKY4qIpgGLYsuXHOq1YhnLFEAiyqcigUPG8N6MJSRWZZK66vd4VT32gJVvaC7/Dn8 aeTg== X-Gm-Message-State: AOJu0YzgZ7m/bsw4L8rN/sHjQ/EV7yc+hSpiDUQ4mNXD/MpwOxlzJ90p WYInpdLAcxu+USusFDBdZ3bYYNkfApqvJGoMA5xRTd5R/F0= X-Google-Smtp-Source: AGHT+IEEZigl5zifDIWExy4sxs28+R9xWpjmeX6Ub2W4KwwfEvSHWAKZXdGslVcv2rDDoNvsTqYqyPC2uVkD2sX/+RA= X-Received: by 2002:a0d:f3c6:0:b0:577:2fda:f181 with SMTP id c189-20020a0df3c6000000b005772fdaf181mr3117168ywf.44.1691802318829; Fri, 11 Aug 2023 18:05:18 -0700 (PDT) MIME-Version: 1.0 References: <50A19B79-46A1-4F21-AA53-74356F4B0CBA@ngould.dev> In-Reply-To: From: Christopher Allen Date: Fri, 11 Aug 2023 18:05:06 -0700 Message-ID: To: Bitcoin Protocol Discussion , symphonicbtc Content-Type: multipart/alternative; boundary="0000000000003e80bb0602af6cfe" X-Mailman-Approved-At: Sat, 12 Aug 2023 09:31:22 +0000 Cc: Dan Gould Subject: Re: [bitcoin-dev] BIP for Serverless Payjoin (AdamISZ) 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: Sat, 12 Aug 2023 01:05:21 -0000 --0000000000003e80bb0602af6cfe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Aug 11, 2023 at 3:29 PM symphonicbtc via bitcoin-dev < bitcoin-dev@lists.linuxfoundation.org> wrote: > Quick little nit I noticed as well, are you sure base64 encoding is the > best choice for the psk in the URI? You may find that having to urlencode > the special characters in base64 it impacts readability and adds a layer = of > complexity if a human wanted to extract the psk from the URI for some > reason. I suggest using something like [base64url]( > https://datatracker.ietf.org/doc/html/rfc4648#section-5) which modifies > base64 slightly to be more suited to this purpose. Yes, the URI version of base64 is better. > However, If you plan to display these via QRs, either will double the density of the QR as QR libraries treat them as binary data (like hex of hex data). Thus you may want to use UR encoding, which is what over a dozen bitcoin wallets use to encode PSBTs. URs are very efficient with QRs, and have the optional benefit that if the data carried becomes too large, they can be animated. The have other advantages. * A top level link about URs: https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/README= .md#uniform-resources-urs * About the base64 encoding with QRs problem: https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-0= 03-uri-binary-compatibility.md * The base UR tech spec: https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-0= 05-ur.md * List of bitcoin wallets using UR for PSBTs: https://github.com/blockchaincommons/gordian-developer-community#urs * List of UR libraries: https://github.com/BlockchainCommons/crypto-commons#bc-ur Let me know if you=E2=80=99re interested. =E2=80=94 Christopher Allen > --0000000000003e80bb0602af6cfe Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Aug 11, 2023 at 3:29 PM symphonicbtc via bitcoin= -dev <bitcoin-dev@lists.linuxfoundation.org> wrote:
Quick little nit I noticed as well, are you sure base= 64 encoding is the best choice for the psk in the URI? You may find that ha= ving to urlencode the special characters in base64 it impacts readability a= nd adds a layer of complexity if a human wanted to extract the psk from the= URI for some reason. I suggest using something like [base64url](https://datatracker.ietf.org/doc/html/rfc4648#section-5= ) which modifies base64 slightly to be more suited to this purpose.

Yes, the URI version= of base64 is better.

However, If you plan to display th= ese via QRs, either will double the density of the QR as QR libraries treat= them as binary data (like hex of hex data). Thus you may want to use UR en= coding, which is what over a dozen bitcoin wallets use to encode PSBTs. URs= are very efficient with QRs, and have the optional benefit that if the dat= a carried becomes too large, they can be animated. The have other advantage= s.=C2=A0

* A top level l= ink about URs:=C2=A0

* Abou= t the base64 encoding with QRs problem:=C2=A0

* The base UR tech spec:=C2=A0

*= List of bitcoin wallets using UR for PSBTs:=C2=A0

* List of UR libraries:=C2=A0
<= br>
Let me know if you=E2=80=99re interested.
<= div dir=3D"auto">
=E2=80=94 Christopher Allen
--0000000000003e80bb0602af6cfe--