I have recently looked into cNFTs and was wondering if it was possible to access their metadata on chain within a program as their information is technically stored off-chain right?
2 Answers
As you noticed, the metadata is not stored on-chain, so there's no way to access from an on-chain program.
It is possible to modify metadata even though it's stored off chain
Metaplex Bubblegum provides an Update function which you're u can use for this.
The Update instruction can be used to modify the metadata of a Compressed NFT. The Merkle root is updated to reflect the propagated hash of the data, and RPC providers who conform to the Metaplex DAS API will update their index of the cNFTs.
More Info https://developers.metaplex.com/bubblegum/update-cnfts