Due to the concentration of high density of trapping sites such as dislocations and vacancies, special grain boundaries (GBs) can be considered as the potential zone for trapping hydrogen, resulting into the slowdown of hydrogen diffusion in materials. A new approach was proposed that the rare earth element Ce was added into the electrodeposition of Ni to enhance the resistance of coating against hydrogen diffusion, which could be attributed to the decrease of grain size and the increased fraction of special boundaries in deposits.