Until recently it was thought that feathers first appeared in an early member of the lineage of theropods that leads to birds. In 2009, however, Chinese scientists announced the discovery of a bristly-backed creature, Tianyulong, on the ornithischian branch of the dinosaur family tree—about as distant a relative of theropods as a dinosaur can be. This raised the astonishing possibility that the ancestor of all dinosaurs had hairlike feathers and that some species lost them later in evolution. The origin of feathers could be pushed back further still if the "fuzz" found on some pterosaurs is confirmed to be feathers, since these flying reptiles share an even older ancestor with dinosaurs.
There's an even more astonishing possibility. The closest living relatives of birds, dinosaurs, and pterosaurs are crocodilians. Although these scaly beasts obviously do not have feathers today, the discovery of the same gene in alligators that is involved in building feathers in birds suggests that perhaps their ancestors did, 250 million years ago, before the lineages diverged. So perhaps the question to ask, say some scientists, is not how birds got their feathers, but how alligators lost theirs.
If feathers did not evolve first for flight, what other advantage could they have provided the creatures that had them? Some paleontologists have argued that feathers could have started out as insulation. Theropods have been found with their forelimbs spread over nests, and they may have been using feathers to shelter their young.
Another hypothesis has gained strength in recent years: that feathers first evolved to be seen. Feathers on birds today come in a huge range of colors and patterns, with iridescent sheens and brilliant streaks and splashes. In some cases their beauty serves to attract the opposite sex. A peacock unfolds his iridescent train, for instance, to attract a peahen. The possibility that theropods evolved feathers for some kind of display got a big boost in 2009, when scientists began to take a closer look at their structure. They discovered microscopic sacs inside the feathers, called melanosomes, that correspond precisely in shape to structures associated with specific colors in the feathers of living birds. The melanosomes are so well preserved that scientists can actually reconstruct the color of dinosaur feathers. Sinosauropteryx's tail, for example, appears to have had reddish and white stripes. Perhaps the males of the species flashed their handsome tails when courting females. Or perhaps both sexes used their stripes the way zebras use theirs—to recognize their own kind or confuse predators.