Cooking an egg is a lesson in protein denaturation. When you boil an egg, the heat causes the folded proteins in the white (mostly ovalbumin) and the yolk to uncoil and link together in a solid 3D network. A common 'everyday' problem is the green ring around the yolk of a hard-boiled egg. This is not a sign of spoilage but a chemical reaction between the sulfur in the whites and the iron in the yolks, creating ferrous sulfide. This happens when the egg is cooked for too long or at too high a temperature. To prevent it, eggs should be cooled immediately in an ice bath. This stops the cooking process and prevents the sulfur gas from migrating toward the yolk.