The nucleation and growth of nanostructures due to friction