A method to prepare nanohydrogel comprising the steps of: - hydrophobic functionalization, wherein a polysaccharide is functionalized with a hydrophobic compound self-assembling, wherein the functionalized polysaccharide obtained from the preceding step is subject to a self- assembling process in a water environment for the formation of nanohydrogel. The hydrophobic compound is riboflavin, or a derivative thereof, to which an alkyl group having a functional group suited to form a covalent bond with the polysaccharide has been bonded.