Non transferable NFTs

Hi,

There are many cases where one wants to mint NFT that are non transferable (either temporarily or permanently). An important application would be in DeFi lending using NFTs as collateral, where you borrow money to buy a given NFT, which needs to be guaranteed to stay in your wallet until the loan is fully repaid.

For example the recent FLOAT project implements non-transferability as an option for minted NFTs. However it isn’t really secure as is always possible to get around that constraint using the fact that the ownedNFTs field of the NFT collection (in the NFT standard) has public access, making it possible for the owner to withdraw and transfer his NFTs through a simple transaction.

I have tried to experiment modifying the NFT standard locally by switching ownedNFTs to “access(self)”, however that gives me the error “invalid access modifier for field: priv. private fields can never be used”. Why is that the case? Shall we modify the standard to allow for that?

Thanks,

As far as I’m aware the primary case given for having the ownedNFTs field as public rather than access(self) is to ‘empower the token owner and disempower the developer’ ie. the user should be able to access their NFT regardless of what the developer of that NFT had in mind for access.

This is a key design difference of Flow to most other chains I’m aware of, namely the user not the developer should have full control over their resources.

That said, the DeFi example you give should IMO be implemented by escrowing the NFT rather than preventing transfer of the NFT. That is more inline with real world pawn shop for example where the shop will not let you keep your item as you are borrowing against it.

There are talks of new standards that may address this issue, perhaps someone from the core team can elaborate more.

Hope it helps :slight_smile: