<oembed><type>rich</type><version>1.0</version><author_name>npub1sm6zhjmk5scuz294jmpkw99wwwjzetjgwp4fu4gn6utqgdz87hkqamnq7h</author_name><author_url>https://nostr.ae/npub1sm6zhjmk5scuz294jmpkw99wwwjzetjgwp4fu4gn6utqgdz87hkqamnq7h</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2014-01-18&#xA;📝 Original message:*Avoiding ECDH calcs on every blockchain transaction (and avoiding the&#xA;prefix thing):*&#xA;&#xA;Can we skip the whole ECDSA/ECDH thing, and use the second key pair for&#xA;encryption instead?  Then we don&#39;t need any ephemeral keys.  We use the&#xA;much simpler scheme like I mentioned before (just root keys and&#xA;multpliers), but instead of requesting a multiplier from the person&#xA;receiving the money, the payer can create their own multiplier and&#xA;encrypt it into an OP_RETURN msg (using the secondary public key of the&#xA;receiver).  When they do this, they append a deterministic identifier to&#xA;it, so that the receiver can immediately identify it upon decryption.&#xA;&#xA;Basically, the receiver simply attempts decryption of every OP_RETURN&#xA;message, and if the identifier is there, they immediately know that the&#xA;tx is theirs, and that the other bytes of the decrypted message is the&#xA;multiplier used.&#xA;&#xA;Of course, using something like ECIES and forcing the receiver to&#xA;attempt decryption of every OP_RETURN tx may not be any faster than the&#xA;ECDH we&#39;ve already talked about here.  But with this, we are not tied to&#xA;any particular crypto.  Isn&#39;t there a much faster asymmetric scheme that&#xA;we can use?  I&#39;ve heard people talk about ed25519, though I&#39;m not sure&#xA;it can be used for encryption.  I&#39;d bet money there is an asymmetric&#xA;_/encryption/_//algorithm that would be fast enough to not burden the&#xA;receiver.&#xA;&#xA;Here&#39;s how I envision it:&#xA;&#xA;--Alice gives out her business card that has public key X (BIP32 root),&#xA;and public key Y (fastCrypto)&#xA;--Bob generates a random 32-byte nonce, and EC-multiplies Alice&#39;s public&#xA;key by it.   He prepares a transaction sending coins to that address (Z)&#xA;--Bob also computes a deterministic identifier, perhaps hash(pubKeyX ||&#xA;addrZ)[8:].  Bob appends the those 8 bytes to the multiplier, and&#xA;encrypts all of it with Alice&#39;s fastCrypto key, Y.   He puts that&#xA;message in the OP_RETURN output.&#xA;--Alice&#39;s wallet will attempt decryption of every OP_RETURN message. &#xA;First she computes hash(pubKeyX, addrZ)[8:], and then decrypts the&#xA;message with the fastCrypto private key.  If the tx is actually hers,&#xA;the last 8 bytes will match the identifier, and she knows to use the&#xA;other 32 bytes as a multiplier.  If it doesn&#39;t, it&#39;s irrelevant to her&#xA;and she moves on.&#xA;&#xA;[**Should probably use 24-byte values for the multipliers (or hashes of&#xA;24-byte values), so that adding 8 bytes makes the whole message an even&#xA;32 bytes which is better for encryption]&#xA;&#xA;Doesn&#39;t this have the exact same properties as the original proposal&#xA;(including compatibility with CoinJoin)?  But it all depends on having&#xA;fast asymmetric encryption.&#xA;&#xA;-Alan&#xA;&#xA;&#xA;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20140117/ef9e2937/attachment.html&gt;</html></oembed>