I'm trying to create a smart contract in Solidity that the accounts can access the digital content only after paid some tokens.
For example, assuming Account 1 is a buyer and Account 2 is a seller. Account 1 has some external web service to host the data and Account 2 has also some external web app to consume the data.
Account 1pays some tokens toAccount 2to access some data (the data will be hosted in a Web service app externally, the URL can be stored in the smart contract.)Account 2uses Oracle to notify its external web app to encrypt the data using the public key ofAccount 1and the private key of itself.- The user of
Account 1can download (maybe a web app) the encrypted data now and decrypted it using its private key and the public key ofAccount 2.
Is it the right way to do it? It seems cumbersome to encrypt/decrypt the data using public/private keys. And how to get keys if needed?