An alloy and an implant having a three-dimensional structure based on such alloy. The alloy comprises a MgZnCa alloy containing nanosized precipitates being less noble than the Mg matrix alloy and having a Zn content ranging 0.1 wt. % Zn to 2 wt. % Zn and a calcium content ranging from 0.2 wt. % to 0.5 wt. %, and having one or more other elements, with the remainder being Mg. Any second phase generated during the solidification process may be completely dissolved by a solution heat treatment. Finely dispersed nanosized precipitates can then be generated by a subsequent aging heat treatment step. These precipitates are used to "pin" the grain boundaries and to prevent the coarsening of the grain structure during further processing to achieve grain sizes below 5 µm.