DNA analysis is giving clues to how the vampire bat can survive on blood alone.
The bat can drink up to half its weight in blood a day unlike other relatives, which dine on fruit, nectar or insects.
Blood is low in nutrients and can harbour deadly viruses.
Vampire bats have key differences in genes involved in immunity and food metabolism compared with other bats.
The researchers say the bat's gut microbes are also distinct.
They found evidence of more than 280 types of bacteria in the bat's droppings that would have made most other mammals unwell.
"The data suggests that there is a close evolutionary relationship between the gut microbiome and the genome of the vampire bat for adaptation to sanguivory (feeding exclusively on blood)," said study author, Dr Marie Zepeda Mendoza of the University of Copenhagen in Denmark.
The common vampire bat harbours many genes that have been selected to cope with blood feeding, she added.
Blood is very high in protein (93%), but low in carbohydrate (1%) and vitamins. It may also harbour blood-borne diseases.
Vampire bats have evolved many features for such a specialised diet - from sharp teeth for severing blood vessels to changes in kidney function to deal with a protein-rich diet.
However, while such adaptations have been well studied, there has been relatively little research on the genome of the vampire bat.
International researchers analysed both the genome of the vampire bat and its microbiome - the microorganisms that live inside the gut.
They found that genome size was similar to that of other bats but the genome contained more "jumping genes" (DNA sequences that change position in the genome).
These were found in areas involved in immune response, viral defence, and both lipid and vitamin metabolism, suggesting they have played a key role in the evolution of the bat's specialised diet.
The microbiome of vampire bats is completely distinct from that of nectar-feeding, fruit-eating, and meat-eating bats, they say.
The researchers argue that microorganisms in the bat's gut may also be involved in digestion, immunity and overall health, and have evolved alongside changes in the genome.
"Adaptation to specialised diets often requires modifications at both genomic and microbiome levels," they write in the journal, Nature Ecology and Evolution.
The common vampire bat (Desmodus rotundus) is one of only three mammals that feed exclusively on blood.
They swoop down at night to feed on the blood of cattle and other animals, including, occasionally, people.
They make an incision near an artery using their teeth and then lick up the blood as it trickles out.
This impressive feat makes vampire bats, arguably, pretty amazing creatures, although Dr Mendoza joked: "I usually call them 'messed-up creatures'."
Follow Helen on Twitter.