This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Do not derive Eth-DM Key from Ethereum Key #411
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the point of this protocol anymore. More specifically, why is there still the link with Ethereum keys?
There was the (privacy related) discussion in the past in the original PR as to why it is called Eth-DM and why Ethereum keys are being used: #365 (review)
I understood that it was because of specific use cases related to assets on the account that is receiving end of the messages.
Now it is changed so that the receiving end (Bob) must use a newly generated key-pair, and not store assets there.
I get the point of privacy obviously, but that was the initial remark also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading your initial comment: #365 (review)
It could make sense to change from "Direct" to "Private" -> Ethereum Private Message -> Eth-PM.
You are write, it does not need to be Ethereum Key for the purpose of asymmetrical encryption of the messages. I got carried away, will correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the comment!
I am not clear on the issue you are highlighting. Please allow me to clarify few things so you can point me to the issue you are seeing.
What link are you referring too?
The user story is still: As Alice, I want to be able to send a encrypted message to Bob. I only know Bob's Ethereum address. I am using a Web3 wallet.
Due to the limitation of Web3 API, it is not possible to:
Because of this limitation, we need to generate a new key pair for encryption and decryption purposes, let's call it eth-dm keypair.
Initially, the eth-dm keypair was hackish-ly derived from the Ethereum account, this is being removed with this PR after @arnetheduck's feedback.
Because Alice only knows Bob's Ethereum address, then Bob needs someway to give his eth-dm public key to Alice, and prove that he is the owner of his Ethereum address. He signs his eth-dm public key with his Ethereum account and publishes it to the network
Thanks to that, Alice can retrieve his eth-dm public key and use it to encrypt her message.
Bob then decrypt the message using his eth-dm private key.
For convenience purposes, the Eth-DM key pair is a SECP256k1 keypair. I agree that the initial wording was confusing, please let me know if the latest update helps.
Also, if this explanation clarified the issue, can you please let me know what part is unclear in the spec?
Yes the privacy concerns still hold. See The Limitations section.
The aim here is to provide an example on how a given DApp could add encryption using js-waku, it is not to redo the work done by Status in terms of privacy.
I hope that one day we'll be able to ship a module that brings in the status chat protocol for dev to simply plug in to Status chats in their dApp, but this day is not today.
Yes, the user story is Alice wants to message Bob only knowing Bob's Ethereum address.
I hope the first section clarified.
Because we are restricted by Web3 API, Bob has no choice but generate a new keypair that the dAPP can have full control on.
Please note that Metamask provide an encryption/decryption API that I will look into and would allow Bob to not have to generate a new keypair.
I hope my comments above helps. Please let me know if I am missing something.
Again, thank you for taking the time to review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant just the fact that you use "Ethereum" keys, or rather, that you name it Ethereum / Eth-DM, while it are just secp256k1 key-pairs.
But, that was a misunderstanding on my side, as there is still an actual link that I missed, the signature as proof of account holder. See further down in this comment.
When you need to create a new key-pair, which has no link with your wallet (or at least, it doesn't need to as you are not allowed to use it for storing assets), I was curious as to why it is still called Eth-dm keypair, as it is simply a secp256k1 key-pair.
Originally this protocol was using the Ethereum root HD public key for being able to initiate communication. I have failed to follow-up the further development of this protocol, and blindly assumed that due to dropping most of that original development, and just generating a new key-pair, that this original link with the Ethereum account got dropped. I understand now that there is still the signature part that gets published over the network.
Right, this use case was not evident for me from just the specification.
So this Ethereum account linkability is there to have an initial way of identification?
And then the user/DApp needs to listen on the published messages containing the public key + signature, so it can start from there.
This is rather different from what Status chat does, and thus not really the "simple, less privacy, example" equivalent. That should be made clear. It is a different use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
Yes
I am not sure we want to flag all toy specs as "this is not used in Status Chat", especially when the spec already states
@oskarth, thoughts?