Private Key – How to Create Contract with Private Data Access

encryptionprivate-key

I want to create a contract that stores encrypted data that is accessible only a selected user on the blockchain.

A ideal scenario would be to encrypt the data using the user's public key, such that the user can decrypt the data using their private key. Is there a public and private key equivalent on the Ethereum blockchain?

Best Answer

Is there a public and private key equivalent on the Ethereum blockchain?

It is possible to do public private key encryption with ethereum addresses: How to encrypt a message with the public-key of an Ethereum address