Replacing platinum-group metals by Ni-based catalysts for the alkaline hydrogen oxidation reaction (HOR) is highly desired for anion-exchange membrane fuel cells (AEMFCs), while huge challenges still exist due to the sluggish kinetics and oxidative deactivation of the Ni active centers. Herein, we report an ingenious design of the microstructured Ni-based electrocatalysts featured by nanoparticulate NiMo alloy cores encapsulated by N-doped carbon layer shells (NiMo-5%@NC) to address these problems. Electrochemical experiments and theoretical calculations confirm that the confinement effect can rationally weaken the binding energy to oxygenated species through direct interactions with the carbon layers rather than relying on the traditionally regulated electronic structures of NiMo surfaces. This ultimately reduces the energy barrier for water formation, the potential-determining step for the alkaline HOR undergoing the bifunctional path. Moreover, the incorporation of carbon layers not only enhances the passivation resistance of Ni-based surfaces but also alleviates the oxidative dissolution of the alloyed Mo-species, resulting in obviously improved stability. As a result, NiMo-5%@NC exhibits significantly improved HOR activity and stability compared to the counterpart without the protection of the shells (NiMo-5%). This work shows comprehensive insights into the confinement effect exerted by carbon layer shells, providing a different light on the guidelines to deal with the sluggish kinetics and oxidative deactivation of the Ni active centers for AEMFCs.