The blue-green colour around the yolk of hard-boiled eggs is iron (ferrous) sulphide. It is produced by a reaction between iron in the yolk and hydrogen sulphide in the white--which is why you see it around the edge where the yolk and white join.
The iron in the yolk is attached to a yolk protein called phosvitin. Protein molecules are long strings of amino acids and in raw eggs these long molecules are folded into particular shapes. This gives them the physical properties for doing the job that nature intended them to do--allowing a chick to grow inside the egg. But if you boil an egg, these proteins partly unfold. This is what makes both the yolk and white go hard, and it also releases iron from the yolk phosvitin.
Similarly, hydrogen sulphide is released from sulphur-containing proteins in the egg white as they unfold during cooking. Smell a hard-boiled egg--it has a very faint whiff of hydrogen sulphide.
Rotten eggs smell far more strongly of hydrogen sulphide because microorganisms cause much more complete breakdown of the sulphur containing proteins than occurs if you just boil eggs for 10 minutes.
As the egg cools, the yolk contracts slightly and pulls a little away from the white. The blue-green iron sulphide forms at the boundary. You may have noticed a darker colour in older eggs. This is because the yolks of older eggs are slightly more alkaline, so more of the iron is released.
Now you know.