Refactor wallet layout recovery with public derivation