Energy storage/generating using nanostructure