Following my previous question on this topic Is there a way to store and share a private key through blockchain?, I might have a solution but I would like to improve the process.
Image that A is the owner of some private data, and want to give the ownership of this data to B, another member of the blockchain. The data is a private key so it can not be public, but it can be encoded using A or B public key.
So:
- Secret data is encoded with A public key, and stored in A informations data /
- B want to by A secret data
- A decode the secret data (using his private wallet key) and encode the secret data with B public key
- Ownership of the data is given to B
- Now only B (and A also but that's a different story) can decode secret data.
Is there a way to simplify this process using smart contract? I assume a smart contract have access to A and B public key, but can a data be encoded/decoded with private key of the one executing the smart contract?