<oembed><type>rich</type><version>1.0</version><author_name>npub17ty4mumkv43w8wtt0xsz2jypck0gvw0j8xrcg6tpea25z2nh7meqf4qgyd</author_name><author_url>https://nostr.ae/npub17ty4mumkv43w8wtt0xsz2jypck0gvw0j8xrcg6tpea25z2nh7meqf4qgyd</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2014-01-12&#xA;📝 Original message:You can always just extend the payment protocol with the new fields as&#xA;well, vs making very long addresses. If this technique can be made to work&#xA;well, it would have applicability in both fixed textual address context,&#xA;and for a fixed/upload-once payment protocol file. That has the advantage&#xA;of backwards compatibility as well - the new addresses would not be&#xA;clickable or acceptable by old wallets, but with the payment protocol you&#xA;can always craft a bitcoin URI that contains a regular current style&#xA;address, and a link to a fixed payment protocol file (uploaded to a&#xA;pastebin type site), and modern wallets would ignore the address and use&#xA;the ECDH based system instead.&#xA;&#xA;&#xA;&#xA;On Sun, Jan 12, 2014 at 11:33 AM, Jeremy Spilman &lt;jeremy at taplink.co&gt; wrote:&#xA;&#xA;&gt; &gt; Oh, sorry, I forgot to mention it in my first write-up but you can&#xA;&gt; &gt; easily make stealth addresses include a second pubkey for the purpose of&#xA;&gt; &gt; the communication that either isn&#39;t used in the scriptPubKey at all, or&#xA;&gt; &gt; is part of a n-of-m multisig. (n&gt;=2) Interestingly that also means you&#xA;&gt; &gt; can give a third-party that key and out-source the effort of scanning&#xA;&gt; &gt; the blockchain for you.&#xA;&gt;&#xA;&gt; Great point. Even if it&#39;s not a 3rd party, I think it&#39;s really important&#xA;&gt; to be able to scan for transactions with a key which can&#39;t actually spend&#xA;&gt; the funds.&#xA;&gt;&#xA;&gt; The first approach is just one-pass ECDH. I think you&#39;re saying the second&#xA;&gt; approach is two rounds of ECDH but re-using the same e/P (usually referred&#xA;&gt; to as r/R in ECIES). I think this is safe, unlike reusing an ephemeral key&#xA;&gt; for signing operations.&#xA;&gt;&#xA;&gt;    Payee: Publish Q, Q2                     [d, d2 are privkeys, Q, Q2 are&#xA;&gt; pubkeys]&#xA;&gt;    Payer: 1) Generate ephemeral key: e / P  [e is privkey, P is pubkey]&#xA;&gt;           2) S = e * Q                      [first shared secret]&#xA;&gt;           3) S2 = e * Q2                    [second shared secret, reusing&#xA;&gt; &#39;e&#39;]&#xA;&gt;           4) Q&#39; = Q + H(S)                  [pay-to stealth address]&#xA;&gt;           5) Q2&#39; = Q2 + H(S2)               [stealth &#39;marker&#39;]&#xA;&gt;&#xA;&gt;    Watch: 1) Look for TxOut with OP_RETURN &lt;P&gt;&#xA;&gt;           2) Q2&#39; = Q2 + H(d2 * P)&#xA;&gt;           3) Check for Q2&#39; elsewhere in the Tx&#xA;&gt;&#xA;&gt; S/MIME for example, allows reuse of the ephemeral keypair. When reusing an&#xA;&gt; ephemeral keypair where A reuses (x, X) to encrypt different messages to&#xA;&gt; more than one user, A should verify the static public keys to prevent&#xA;&gt; small-subgroup attacks.[1][2]&#xA;&gt;&#xA;&gt; Let&#39;s say you pay-to Q&#39; and then Q2&#39; value has to be somewhere else in the&#xA;&gt; transaction. You could put it next to the shared P in OP_RETURN. OP_RETURN&#xA;&gt; &lt;P&gt; &lt;Q2&#39;&gt; would be 66 bytes.&#xA;&gt;&#xA;&gt; But then Mallory could generate transactions with the right Q2&#39; but with&#xA;&gt; his own pubkey in Step 2 instead of Q. So your scanner would detect a&#xA;&gt; payment, but you wouldn&#39;t be able to spend it, and Mallory could.&#xA;&gt;&#xA;&gt; That&#39;s a good argument for putting Q2&#39; in a 2-of-2 multisig so that&#xA;&gt; pulling this trick would at least make the transaction unspendable for&#xA;&gt; both parties, which may be good enough deterrent, but you&#39;re still going&#xA;&gt; to want to check it against your &#39;d&#39; before fulfilling a large order. Your&#xA;&gt; online watch process could queue the matching transactions, which you&#xA;&gt; could move to your offline machine, decrypt your key, and verify the&#xA;&gt; transactions are spendable.&#xA;&gt;&#xA;&gt; Now, you would need to get two pubkeys to the payer, throw in a prefix to&#xA;&gt; help standardize it, and end up with addresses that could look like (for&#xA;&gt; example):&#xA;&gt;&#xA;&gt;&#xA;&gt; xSTLxsn59oaupR6ZKt2yddQ4dp5hcFinnTWkvsDiXtHgAEDg5ajNVzTY8MMQsmqnEn3ZMKxQzrfC3pDimfTWMkiUb7x3jX3J26JSX&#xA;&gt;&#xA;&gt; tSTLcpwzupCFL3maVZkSiB9ib3BXsCAfkhMLgckQEyoj8Tk83ANzofeuDdbX6bSPqNRfACLLFYK8EwVo1jdjxNDFNDWxhnQiAy4ba&#xA;&gt;&#xA;&gt; Those addresses are 74 bytes:&#xA;&gt; &lt;Prefix&gt;&lt;CompressedPubKey1&gt;&lt;CompressedPubKey2&gt;&lt;Checksum&gt;&#xA;&gt;&#xA;&gt;    xSTL Prefix = 0xC0CB9270&#xA;&gt;    tSTL Prefix = 0xB2E27D50&#xA;&gt;    NOTE: I do NOT have the corresponding privkeys for these four pubkeys!&#xA;&gt;&#xA;&gt; Those just happened to be the first matching prefixes I found for 74 byte&#xA;&gt; addresses. I could try to find ones which start with a specific byte if&#xA;&gt; that&#39;s somehow better, like 0x04 to match BIP32.&#xA;&gt;&#xA;&gt; Unfortunately, I don&#39;t think you can just derive a second public key from&#xA;&gt; the first to keep the address shorter, and still keep the first private&#xA;&gt; key secure, even if the second private key is stolen. You only get&#xA;&gt; equivalent security as BIP32 public derivation, where you can&#39;t lose a&#xA;&gt; child private key.&#xA;&gt;&#xA;&gt; Do we also want xSTL (or whatever user friendly string) prefixes for&#xA;&gt; single pubkey (41 byte) stealth addresses?&#xA;&gt;&#xA;&gt; I&#39;ll wait a couple days for feedback, then I&#39;ll try to implement the&#xA;&gt; following prototypes:&#xA;&gt;&#xA;&gt; 1) Pay to STL addresses&#xA;&gt; 2) Watcher process to detect and queue STL payments for a given d2/Q2&#xA;&gt; 3) Offline verifier to take output from Watcher and verify spendable given&#xA;&gt; encrypted d/d2&#xA;&gt;&#xA;&gt; Obviously extending QT directly for #1 would be ideal, I may even be able&#xA;&gt; to do that since supporting a new address type should be fairly contained.&#xA;&gt; But if not I&#39;ll punt to writing a node.js or python script which connects&#xA;&gt; to bitcoind via RPC.&#xA;&gt;&#xA;&gt; Thanks,&#xA;&gt; Jeremy&#xA;&gt;&#xA;&gt; [1] - On Reusing Ephemeral Keys in Diffie-Hellman Key Agreement Protocols&#xA;&gt;        http://www.math.uwaterloo.ca/~ajmeneze/publications/ephemeral.pdf&#xA;&gt;&#xA;&gt; [2] - Validation of Elliptic Curve Public Keys&#xA;&gt;        http://www.iacr.org/archive/pkc2003/25670211/25670211.pdf&#xA;&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt; ------------------------------------------------------------------------------&#xA;&gt; CenturyLink Cloud: The Leader in Enterprise Cloud Services.&#xA;&gt; Learn Why More Businesses Are Choosing CenturyLink Cloud For&#xA;&gt; Critical Workloads, Development Environments &amp; Everything In Between.&#xA;&gt; Get a Quote or Start a Free Trial Today.&#xA;&gt;&#xA;&gt; http://pubads.g.doubleclick.net/gampad/clk?id=119420431&amp;iu=/4140/ostg.clktrk&#xA;&gt; _______________________________________________&#xA;&gt; Bitcoin-development mailing list&#xA;&gt; Bitcoin-development at lists.sourceforge.net&#xA;&gt; https://lists.sourceforge.net/lists/listinfo/bitcoin-development&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20140112/2c0d73d8/attachment.html&gt;</html></oembed>