Has anyone made a decentralized music player on ethereum using smart contracts? Say if I wanted to upload a mp3 file to IFPS and everytime someone plays the midi file the smart contract will deduct .0001 eth from the account. Has anyone done something like this?
2 Answers
IPFS' files are completely public, so there is no way to restrict the viewing of those files where users would have to pay. You could figure out a way to encrypt the file on IPFS and then reveal the key to anyone who paid, but there would still have to be some centralization.
-
When uploading files to IPFS, do I have to keep my IPFS server up in order for the files to stay on IPFS? Or do I get to just upload it once and it stays forever? Commented Jun 29, 2018 at 15:03
-
Not possible with IPFS alone. You can encrypt the music file and host it on IFPS so that if someone does get access to it then it will be gibberish. You will need a central server acting as a mediator. One possible flow is to have the user pay the smart contract which emits an event. The mediating server can have a listener on the events that the user has paid, which then it decrypts the music asset and streams it to that individual user.
-
-
@Patoshiパトシ pretty much, the encrypted storage is decentralized– MiguelCommented Jul 18, 2018 at 20:51