Reaction-diffusion mechanisms for the chemical shrink process of nanofabrication