I would like to know if there is a way on tezos to hide data in the metadata of an nft so that only the owner of the NFT can see it. or to make information visible only to the owner. Do you know if it is possible to code smart contracts with this functionality?
I can only assume that you maybe mean something like lockt.
With the Lockt tool, you can do this by first visiting lockt.io and syncing your Web3 wallet. Then specify the contract address and token ID(s) of the NFTs that you wish to add unlockable content to; give a name and description to the content to be added, and finally upload the files. Once this is done, you can share the unlockable content web link. Anyone who owns the corresponding NFTs can sync their Web3 wallet upon visiting the link, and access their content.
So with lockt you can lock the content of the NFT for the public - making it "private"