<oembed><type>rich</type><version>1.0</version><author_name>npub1sgs97fe0n9wehe6zw7drcxdz4cy9yt9pfqjv8gasz5jlk4zezc0quppx3c</author_name><author_url>https://nostr.ae/npub1sgs97fe0n9wehe6zw7drcxdz4cy9yt9pfqjv8gasz5jlk4zezc0quppx3c</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2015-02-23&#xA;📝 Original message:Mike,&#xA;&#xA;Before addressing other issues I could use some clarification on your&#xA;intent.&#xA;&#xA;In one statement you refer to derivation of a session key from a bitcoin&#xA;address (passed via NFC):&#xA;&#xA;&gt; doing ECDH over secp256k1 to derive a session key means we can reuse&#xA;&gt; the address that was put in the URI already for pre-BIP70 wallets&#xA;&#xA;In another statement you refer to derivation of a session key from a&#xA;public key (passed via  BT):&#xA;&#xA;&gt; The public key can then be provided in full in the clear over the&#xA;&gt; Bluetooth connection and the session key derived.&#xA;&#xA;I don&#39;t see how you propose to treat the bitcoin address as a secp256k1&#xA;public key, or do you mean something else?&#xA;&#xA;e&#xA;&#xA;On 02/23/2015 02:58 AM, Mike Hearn wrote:&#xA;&gt;     DHKE will not improve the situation. Either we use a simple method to&#xA;&gt;     transfer a session key or a complex method.&#xA;&gt; &#xA;&gt; You&#39;re right that just sending the session key is simpler. I originally&#xA;&gt; suggested doing ECDHE to set up an encrypted channel for the following&#xA;&gt; reasons:&#xA;&gt; &#xA;&gt;  1. URIs are put in QR codes more often than NFC tags. QR codes have&#xA;&gt;     limited space. The more stuff you pack into them, the slower and&#xA;&gt;     flakier the scanning process becomes.&#xA;&gt; &#xA;&gt;     For normal wallets, doing ECDH over secp256k1 to derive a session&#xA;&gt;     key means we can reuse the address that was put in the URI already&#xA;&gt;     for pre-BIP70 wallets, thus we don&#39;t have to expand the URI at all&#xA;&gt;     except perhaps to flag that crypted Bluetooth connections are&#xA;&gt;     supported. Win!&#xA;&gt; &#xA;&gt;  2. If the wallet is a watching wallet, this won&#39;t work and in that case&#xA;&gt;     you would need to put a separate key into the URI. However, this key&#xA;&gt;     is ephemeral and does not need to be very strong. So we can generate&#xA;&gt;     a regular secp256k1 key and then put say 5-8 prefix bytes into the&#xA;&gt;     URI as a new parameter. The public key can then be provided in full&#xA;&gt;     in the clear over the Bluetooth connection and the session key&#xA;&gt;     derived. If we put the session key into the URI in full, then we&#xA;&gt;     could not use this trick. Win!&#xA;&gt; &#xA;&gt;  3. It&#39;s quite common in low tech scenarios like little coffee shops to&#xA;&gt;     just print a QR code and put it in the menu, or sticky tape it to&#xA;&gt;     the back wall of the shop.&#xA;&gt; &#xA;&gt;     In these cases, it&#39;s possible that the device is actually hanging&#xA;&gt;     around in the shop somewhere but having the QR code somewhere larger&#xA;&gt;     and more accessible than the shop devices screen is highly&#xA;&gt;     convenient. However it means the data is entirely static.&#xA;&gt; &#xA;&gt;     Putting/reusing an identity key from the URI means the session keys&#xA;&gt;     are always unique and known only to both devices, even though the&#xA;&gt;     bootstrap data is public.&#xA;&gt; &#xA;&gt;  4. Doing ECDHE to derive the keys means we can derive a MAC key as well&#xA;&gt;     as an AES key. Otherwise you have the issue of exchanging both,&#xA;&gt;     which again uses up valuable bootstrap space.&#xA;&gt; &#xA;&gt; So for a small increase in session setup complexity we potentially avoid&#xA;&gt; troubling problems down the line where people the same functionality&#xA;&gt; from NFC and QR code based bootstrap, but we can&#39;t provide it.&#xA;&gt; &#xA;&gt; These discussions keep coming up. I think the next step is for someone&#xA;&gt; to upgrade Andreas&#39; wallet to support encrypted connections and the&#xA;&gt; TBIPs, to see what happens.&#xA;&gt; &#xA;&gt; Re: the h= parameter. I only objected to requiring this when the payment&#xA;&gt; request is also signed. It adds complexity, uses space, and the&#xA;&gt; rationale was &#34;the PKI can&#39;t be trusted&#34; even though it&#39;s been used to&#xA;&gt; protect credit card payments for 20 years without any issues. In the&#xA;&gt; case of unsigned payment requests, sure ... but with a proper&#xA;&gt; implementation of an encrypted Bluetooth channel it&#39;d be unnecessary as&#xA;&gt; the channel establishment process would guarantee authenticity anyway.&#xA;&gt; &#xA;&gt; But don&#39;t let me hold you guys back! I&#39;d rather see something that works&#xA;&gt; than an endless debate about the perfect arrangement of hashes and URI&#xA;&gt; parameters :)&#xA;&gt; &#xA;&#xA;-------------- next part --------------&#xA;A non-text attachment was scrubbed...&#xA;Name: signature.asc&#xA;Type: application/pgp-signature&#xA;Size: 473 bytes&#xA;Desc: OpenPGP digital signature&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20150223/ec6fbecf/attachment.sig&gt;</html></oembed>