Seismic studies have found fine-scale anomalies at the core-mantle boundary (CMB), such as ultralow velocity zones (ULVZs)1,2 and the core rigidity zone3,4. ULVZs have been attributed to mantle-related processes5-10, but little is known about a possible core origin. The precipitation of light elements in the outer core has been proposed to explain the core rigidity zone3, but it remains unclear what processes can lead to such precipitation. Despite its importance for the outer core11, the melting behaviour of Fe-Si-H at relevant pressure-temperature conditions is not well understood. Here we report observations of the crystallization of B2 FeSi from Fe-9wt%Si melted in the presence of hydrogen up to 125 GPa and 3,700 K by using laser-heated diamond anvil cells. Hydrogen dramatically increases the Si concentration in the B2 crystals to a molar ratio ofSi:Fe ≈ 1, whereas it mostly remains in the coexisting Fe liquid. The high Si content in the B2 phase makes it stable in a solid form at the outermost core temperatures and less dense than the surrounding liquids. Consequently, the Si-rich crystallites could form, float and be sedimented to the underside of the CMB interface, and that well explains the core side rigidity anomalies3,4. If a small amount of the FeSi crystals can be incorporated into the mantle, they would form dense low-velocity structures above the CMB, which may account for some ULVZs10. The B2 FeSi precipitation promoted by H in the outermost core provides a single core-driven origin for two types of anomalies at the CMB. Such a scenario could also explain the core-like tungsten isotope signatures in ocean island basalts12, after the materials equilibrated with the precipitates are entrained to the uppermost mantle by the mantle plumes connected to ULVZs.