Is there a way to encrypt a message using someone else’s address and decrypt only allowing this user to decrypt his message using his private key on-chain?

Cryptocurrency News and Public Mining Pools

Is there a way to encrypt a message using someone else’s address and decrypt only allowing this user to decrypt his message using his private key on-chain?

Say for example I would like encrypt a message using an ETH address (I don't have the private key for this public key). I store the hash in an NFT data. Now I send this NFT to the address I've used for the encryption. This user will be the only one that can decrypt this message using his private key. Does this exist yet? I've done a lot of research and it's possible but not using metamask for example, as it won't let you use the private key for message decryption.

Thanks

EDIT: Adding more info: There is this methods of encryption and decryption:

https://docs.metamask.io/guide/rpc-api.html#eth-decrypt https://docs.metamask.io/guide/rpc-api.html#eth-getencryptionpublickey https://docs.metamask.io/guide/rpc-api.html#encrypting

The only problem is that in order to use eth_getEncryptionPublicKey I need to have access to the account. Which means I can't get the encryption public key from any eth address

submitted by /u/Randomizer91
[link] [comments]