Several centuries ago, a group of Borneo natives left their villages and headed deep into the jungle, searching for a home away from the Dutch colonialists who had begun spreading across their island. Eventually, they found a nice spot in the lowland rainforests near the mountains in Borneo's centre. They built houses and cultivated crops, and caught fish from the Burak river. All was well. Then children began vanishing.

One at a time, the kids disappeared, leaving behind baffled and frantic adults. This happened eight days in a row. Was it the work of a forest ghost, or jungle nomads, or a big carnivore like a clouded leopard? To find out, the villagers set a trap and baited it with another child, sacrificing one more life to stop the slaughter.

The creature that finally emerged from the river was huge, limbless and covered in scales. It was a snake, but one so overgrown they called it a dragon.

They found two huge, chocolate-brown adult dragons

From their hiding place, the people watched as the dragon took the child to a den on an island in the river. Then they made axes, spears and shovels from the forest's strong ironwood trees, and dug a tunnel right into the dragon's home.

When the villagers charged in, they found two huge, chocolate-brown adult dragons, each as big around as an oil barrel. With them was a smaller dragon, the width of a coconut palm, which was colourful and had a yellow belly.

In retaliation for the killings, the people cut the two adults in half. But they spared the young dragon, believing it to be innocent. They also made an agreement with it that is still binding today: neither humans nor dragons shall harm the other, on pain of death.

Later, the people returned to less remote villages. But they say the dragons are still around.

I first heard this story in late July 2014, when I sat by a fragrant campfire listening to Pak Rusni, an elder from the Dayak village of Tumbang Tujang, recount his ancestral tale. Rusni is 54 years old, with gentle, dark eyes. He mostly spoke softly, and the cicadas threatened to drown out his words. But when he got to the crux of the tale, Rusni became loud and animated. He drew me a diagram depicting the dragon den, the tunnel, and the riverbank settlement. And then he gestured upriver.

Our campsite was near the northern border of Indonesian Borneo, along the Burak river. If we journeyed upriver for another day and a half, Rusni said, we would find the remnants of the village besieged by dragons.

Fascinated by Rusni's story, I wanted to find out which of the local snakes might be closest to the dragons of the story. So many centuries later, I didn't expect to find a definitive answer. But there were two questions that I could nail down, which might offer pointers. Were there any snakes in Borneo that grew so monstrously large? And could any kill children that quickly?

I soon realised there were many possible culprits. The Borneo rainforest is 140 million years old, one of Earth's oldest, so its inhabitants have had plenty of time to diversify. What's more, during the last ice age land bridges linked Borneo to mainland Asia and other Indonesian islands. Species emigrated from the mainland to the islands, seeding Borneo with an astonishing array of organisms. When the ice age ended, flooding the land bridges, Borneo's creatures were free to evolve in relative isolation.

The locals sometimes refer to our field site as the 'Land of the Man-Eating Snakes'

The snakes are particularly diverse. There may be about 150 species on the island, possibly more. "It's like every family of snake somehow managed to get to Borneo," says Sara Ruane of the American Museum of Natural History in New York. "And no doubt there's undiscovered species."

Some live underground, others in the leaves littering the forest floors. Some surf through the treetops, flying from tree to tree. Others prefer to live underwater, or in caves. Many use the structures built by humans: they sneak into the nooks beneath roofs or hide under decks.

Several are dangerous to humans. I was told the locals sometimes refer to our field site as the "Land of the Man-Eating Snakes": that's presumably a reference to Rusni's story, but might also reflect a present-day truth. So before we set out, I asked our expedition leader Peter Houlihan, of the Barito River Initiative for Nature Conservation and Communities, which local snakes were most deadly. He was not reassuring. "It gets to a certain point where it doesn't really make a difference."

Since they first appeared between 100 and 150 million years ago, snakes have evolved rapidly. A lot of that has gone into creating new ways to kill other animals, in particular snakes' infamous venoms.

"Most snakes do have venom, even the so-called harmless ones," says Robert Stuebing, a Borneo-based herpetologist. "There's a lot more out there than we ever realized."

That variety might be a response to the challenges involved with living life as a tube. "You think of being a tube as a simplification, but that actually makes life harder," says David Pollock of the University of Colorado in Denver. So to ease the strain of hunting without limbs, snakes have developed highly specialized ways of killing things – ways that could, conceivably, account for vanishing village children.

Snake venoms contain a bewildering array of proteins that work together to bring down prey. Some, like king cobra venom, have more than 100 different kinds.

These toxic cocktails are hugely variable. Not only do different species produce different mixtures, but snakes of the same species can mix different drinks as well. What's more, a snake's venom may change as it ages.

The venom seems to be evolving extremely rapidly

This might be the result of an evolutionary arms race, with venom mixtures evolving to work best on each snake's most common prey. Alternatively, it could be that some snakes have evolved a range of toxins that lets them bring down different types of prey. "If it doesn't really cost the snake anything, you might as well have this huge array of weapons," says Ryan McCleary of the National University of Singapore.

Scientists are just beginning to trace the evolutionary history of the serpents' deadly potions. But it is clear that the genes coding for snake venom proteins have evolved rapidly. Last year McCleary, Pollock and their colleagues published the sequence of the king cobra genome, and found that base pairs were being swapped and shifted unusually often. "The rest of the snake is still going along like normal," says McCleary. "But the venom seems to be evolving extremely rapidly."

So which of Borneo's snakes might be capable of killing a small child? Here are the prime suspects.

Red-headed krait

The red-headed krait (Bungarus flaviceps) is elegant but deadly. Its shiny black body is bookended by a bright red head and tail. "It's one of the most beautiful snakes I've ever seen," says Houlihan. "But you don't want to be in the water with a krait."

Many people just don't wake up the next morning

Krait venoms disable their prey's nervous system. They block the junctions that convey messages from nerves to muscles, making it impossible to breathe or move.

"Antivenom really doesn't work unless you get it in very quickly," says Nicholas Casewell of the Liverpool School of Tropical Medicine in the UK. In 2001, a many-banded krait in Myanmar bit herpetologist Joseph Slowinski on the hand. Too far afield to find proper medical attention, he died in just over a day.

But kraits don't fit the profile of dragons. Red-headed kraits can be two metres long, but they are thin, and the dragons were fat. Plus, kraits are sluggish in the day. Most bites happen at night, when the snakes stay near a sleeping human for warmth. "Many people just don't wake up the next morning," Casewell says. "Or they wake up paralyzed."

Blue coral snake

What about Borneo's many coral snakes? Some have abnormally large venom glands.

Take the Malayan blue coral snake (Calliophis bivirgatus), a nocturnal blue serpent with a bright red belly. As with other snakes, the venom gland begins behind the eye. But it stretches for more than a third of the snake's length, which can reach 1.5 metres. That means a blue coral snake's venom gland could be longer than your foot. "Nobody knows why," says McCleary.

But despite their humongous venom glands, coral snakes aren't even close to being dragons. They hide among the leaves littering the ground, and mostly eat other snakes – often small, burrowing ones. That means their fangs are too small to easily pierce human skin. "They have to get you sort of between the fingers in order to inject venom," Stuebing says.

Now this looks more like it. Reaching lengths of 5 metres, king cobras (Ophiophagus hannah) are the longest venomous snakes alive. And they can rear up, raising the first third of their body from the ground. "You could have a cobra looking you in the eye," Houlihan says.

Many who have worked with king cobras say they have a curiosity that sets them apart from other snakes. "They just have this kind of alertness," says Matt Goode of the University of Arizona in Tucson.

Sleek and lithe, cobras are active during the day, often hunting other snakes. Goode and his team have tracked them using implanted radio transmitters and found that they travel surprisingly large distances.

But cobras probably weren't the dragons either. Although they are dangerous, they rarely bite. "They're absolutely not aggressive, compared to some snakes," says Ron Lilley, who runs a snake retrieval service in Bali. "They have so much venom in them, but they're very reluctant to bite people."

Pit vipers are like heat-seeking missiles. They have specialized pits on their heads that detect heat, giving them a kind of infrared vision that few prey animals can evade.

But unlike the fast-moving cobras, pit vipers are ambush predators. They lurk in trees or bushes, waiting for critters to wander close enough to strike. "They're pretty sluggish, but that strike is very fast," says Frank Burbrink of the City University of New York. "It's a completely different lifestyle."

They wait for their prey to come to them instead of chasing it down

Pit vipers also use a different kind of venom, targeting the cardiovascular system rather than the nervous system. Their venoms do things like preventing blood from coagulating or causing blood pressure to drop dangerously low. Many also directly attack and kill cells. "The pit vipers really hurt. You'll be in excruciating pain. They're blowing up your cells," Burbrink says.

As we walked through the Bornean jungle, it was the pit vipers we were told to look out for. A few days after we arrived, we found a Sumatran pit viper (Trimeresurus sumatranus) hanging out in a tree near our camp. It was probably digesting a meal and might have stayed put for days, but we moved it to the opposite bank anyway.

Nevertheless, pit vipers don't fit the story either. "Their reputation is different from the dragons that are referred to in the Dayak stories," Houlihan says. "The arboreal pit vipers in Borneo are more sit-and-wait predators. They wait for their prey to come to them instead of chasing it down."

So if none of these snakes are likely related to the dragons, what is? The best contenders are probably Borneo's pythons, which are among the largest snakes on Earth. Instead of relying on venom, these massive serpents squeeze their prey to death.

The reticulated python (Python reticulatus) is the longest snake in the world, capable of reaching over 10 metres in length. But shrinking forests and fearful humans mean that really large pythons haven't been found for a long time. "The biggest python I've seen caught here, which was put in a cage and treated like a sacred animal, was a 4-metre python that came out of a drain in downtown Denpasar," says Lilley.

Still, a python doesn't need to be the length of a bus to eat something person-sized. Snakes like the African rock python regularly eat pigs or deer, and attacks on humans do happen. A 2011 study reported that one-quarter of the villagers on a Philippines island had described being attacked by these giant snakes. A World Health Organization report on snake bites in south-east Asia contains images of a reticulated python that swallowed a farmer on Sulawesi. Last December, a 4-metre reticulated python strangled a security guard outside a hotel in Bali.

Nevertheless, there are problems with the idea that the Bornean dragons were pythons.

Pythons are ambush predators that mostly lounge around, either digesting a meal or waiting for the next one to wander close enough to be throttled and swallowed. "They're sit-and-wait foragers," says Stephen Secor of the University of Alabama in Tuscaloosa.

A python can wait over a year until its next meal

There is another problem. Those binge-eating dragons, swallowing one child a day, were definitely not on the python diet. The best estimates suggest that wild pythons eat every month or six weeks. "Pythons don't eat every day," Burbrink says.

That's because pythons can handle meals 1.5 times their size, by ramping up their digestive systems. When a python catches a meal, its heart, pancreas, and other organs enlarge, sometimes doubling in size, to support its digestive system. "Their metabolic rate goes way up," Secor says. "Rates go up as much as 40 times for huge, huge meals."

Afterwards, the python hunkers down, lowers its metabolic rate, and deactivates its digestive system. It can wait a long time until its next meal, sometimes over a year, says Secor.

It's possible that the dragons in the story are based on several snakes: perhaps the king cobra's hunting skills, the krait's deadly venom, and a python's imposing size. We can't be sure.

The dragons are black and shiny, and as big around as oil drums

Nevertheless Houlihan, who has spoken with the Tujang residents about the tale, points the finger at pythons: "massive pythons that were big enough to make people disappear without a trace," he says. "When the forest floods, during the wet season, colossal pythons could be anywhere. It's enough to instil fear in even the bravest and most experienced of elders - thus, the proliferation of these stories to this day."

Today, the area where the dragons appeared is called Teluk Naga. Naga is the Dayak word for dragon, and the Sanskrit word for snake. The remains of the village, including the ironwood tools used to slay the dragons, are still there, says Suri, a Tujang resident who fishes nearby. But Suri says the island where the dragons lived was split in two by the river when the villagers' tunnel flooded.

Rusni and the others say they still see dragons near the water. The dragons are black and shiny, and as big around as oil drums. But they never stick around for long. They can appear and disappear at will, Rusni says, and have transcended their physical bodies to become mystical creatures.

I asked if they scared him. "Of course I'm afraid of them," he says. "But they don't disturb us. And we never try to bother them."