To be honest, i still don’t see the problem. it’s easy to securely associate a public key to your Ethereum account:
- if you’re an EOA, post it as an entry in some contract, exactly like how ENS does.
- if you’re a contract, just expose a public pure function returning the key.
Where is this defined in the EIP? Sure, there’s numerous ways to do this but our wallet team can’t implement against any of this as none of this is defined.
i’m sorry, but this doesn’t compute. you would call some “get public key” function exposed by the dapp. the dapp would deliver the public key. you would locally encrypt under that key. you would then send the ciphertext to the dapp. what’s wrong with this?
actually this is a much less difficult case, since the public key depends only on the dapp, not the user. so it could even be hardcoded in the static front-end. if you wanted to authenticate the public key, you would use the technique in the post above.
If the dApp is a SPA running locally in my browser with only static front end code, how is the private key loaded in? Also, why do I need to encrypt a message to a dApp in that case? Who’s the adversarially actor I’m trying to maintain confidentiality from in that case? This architecture you’ve described with a completely stateless front end and a public backend (the ETH blockchain) doesn’t need confidentiality via encryption. I guess this is why I’m confused is I never saw this as a usecase where this was necessary.
and then post the ciphertext somewhere the dapp can see it, say, on-chain
If the dApp is not ran in a server and is ran entirely via smart contracts for backend logic and static code for front end logic where is the dApp’s private key kept?
the arguably more interesting case is where a user wants to encrypt to another user . here, you can imagine a sort of “on-chain encrypted email” Dapp.
I’ve eliminated this use case from practicality because of the inherent cost of gas fees. storing messages on chain is impractical. Assuming only SMS style messages were used with a 160 character limit and 4.1 trillion messages sent (numbers pulled from this link MMS vs SMS - Difference and Comparison | Diffen) this equates to a max bound of 656 terabytes of storage required (per year) if we were to entirely replace SMS with this. Now, I can presume the counter argument to this would be “we don’t want to replace SMS it would just be used for limited use cases of X,Y,Z”. So let’s downscale this to say that 1 billion messages are sent per year at 160 character limit. Practically speaking this means 1/8th of the world gets to send only 1 message per year of 160 characters. That still comes out to 160GB of storage (per year) and doesn’t even account for the additional demand for the mempool. Putting all this together just makes this an infeasible architecture in my eyes. I’d rather handle this off chain (there’s additional security/privacy benefits to this I’ve highlighted above) and make the chain a mechanism for discovery on how to find another persons off chain inbox server.
Hopefully, this illuminates my perspective a bit more clearly on this. This is why I was trying to get us to detail out the use cases more clearly above. I knew we’d end up talking past each other if we didn’t align on that first. This is just inherently how standards conversations go by the very nature of the way standards get built from what I’ve learned. If I knew a faster, more fluid way to do this I’d certainly jump to use it, but I don’t have one so I resort to the method I’ve found to build consensus and ship running code.