The file is too big to be stored on the blockchain, so it is stored on IPFS. Only the person who owns a unique Non Fungible Token (or a Security Token) can access it.

Of course I can encrypt the file in such a way that only the token owner can read it. However, when the owner sells the token, he must lose the access to it, and IPFS does not guarantee that the file will disappear from the network immediately.

Is it possible to implement such an access control?

Edit: Any tools are welcome if they allow to solve the problem, such as Zero Knowledge Proof protocols or other cryptographic (or non) tools which I 'm not aware of.

2 Answers 2


No, this is not possible. Here is a more general explanation which is relevant and then application to your specific instance.

ENTRIKEN'S LAW: Your ownership of assets on a ledger is only as valid as your trust in the custodian who has physical control of the assets.

In your case, IPFS is the custodian which physically controls access to the media. So no, there is nothing that can be done on the blockchain layer or the ERC-721 layer to achieve what you want.

I have consulted on many projects that wanted to sell access to licensed media using IPFS and access controls over blockchain. The answer is simple: make people value your service more, charge more for it and then pay for access using traditional file storage providers.


The main problem will be that all information on the blockchain is public. So you will not be able to store anything secret there. Therefore the process needs to include some elements outside the blockchain.

Another problem you will face (as you noticed) is how to revoke access to the IPFS file. The only way I can think of is for the requests to come through your backend so your backend decides whom to give the file.

One option for checking access to the NFT is using the private key of a token holder in some fashion (of course without revealing it to anyone but the holder) as with that you can prove you own a NFT. Some suitable encryption scheme might work here.

Overall this whole idea is not very suitable for blockchain and IPFS due to transparency and immutability.

  • I do not exclude using cryptography techniques such as Zero Knowledge Proofs to hide info or verify on chain if needed, or other cryptography techniques which I'm probably not aware of. Jul 30, 2019 at 21:20
  • Yes I understood that. My main point is that you will probably have to do a lot of the stuff off chain. Jul 31, 2019 at 10:11
  • Related to your NFT proof of ownership, shouldn't there be a way for the connected wallet to have access to a resource on IPFS, the same way as it can prove it owns an NFT? Dec 6, 2021 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.