large onion, chopped (2 cups)
3/4 lb carrots (3 large) cut into 1/3-inch dice
1/2 lb yellow-fleshed potatoes such as Yukon
Gold (3 large), peeled and cut into 1/3-inch dice
1/4 tsp salt
3/4 tsp black pepper
3/4 cup heavy cream
1/4 cup Madeira
1/4 cup chopped fresh flat-leaf parsley
6 eggs (optional)
Cook duck legs, skin sides down, in a 12-inch cast-iron or heavy nonstick skillet over moderate heat, turning over once, until skin is golden and some of fat is rendered, about 8 minutes total. Transfer duck to a cutting board, reserving fat in skillet. When duck legs are cool enough to handle, remove skin with any visible fat, then chop skin and fat into 1/2-inch pieces and return to skillet (reserve meat). Cook over moderate heat, stirring occasionally and pressing down on larger pieces, until fat is rendered and skin is deep golden and crisp all over, about 5 minutes. Remove skin with a slotted spoon and drain on paper towels.
Pour off all but 3 tablespoons fat from skillet, then add onion and cook over moderate heat, stirring occasionally, until golden brown, about 15 minutes. Add carrots, potatoes, 1/2 teaspoon salt, and 1/4 teaspoon pepper and cook, stirring frequently, until vegetables are browned, 20 to 30 minutes.
Meanwhile, coarsely shred duck meat, discarding bones and any gristle.
Stir duck into vegetables along with cream, Madeira, parsley, fried duck skin, and remaining 3/4 teaspoon salt and 1/2 teaspoon pepper, and stir until combined. Reduce heat to moderately low, then smooth top of mixture and cook, undisturbed, until bottom of hash is golden when lifted with a spatula, 4 to 8 minutes.
Feel free to add a sunny side up or poached running egg on top!