One Piece's Kaidō and Yamato don't have a lot in common. The only things they seem to share are their strength, their fighting styles, and their genes. With that said, there is one distinguishing feature that these two both have-- their horns.
For some reason, both Kaidō and Yamato have grown horns growing from their heads. Not only that, but many of the Beast Pirates also seem to have horns. Normally, humans can't grow horns, so there must be something special about these people that lets them have these extra outgrowths. Obviously, they're far from normal humans, but perhaps there's more to it. Here's a look at what's known about Yamato, Kaidō, and the Beast Pirates and how that knowledge may explain what the story is behind their horns.
It's important to note that Yamato and Kaidō's horns are in fact parts of their bodies. A possible explanation for them would be that they're simply wearing headpieces that look like horns, which means that they're still technically ordinary humans. However, when they transform using their Zoan Devil Fruits, the animals they become clearly have their horns attached to their heads.
It's also worth noting that their horns are probably not a byproduct of their Devil Fruits. Kaidō turns into an Azure Dragon, which is traditionally depicted with antlers; in Kaidō's case, he has his horns in addition to the antlers of his Devil Fruit. In contrast, Yamato's fruit turns her into an Ōkuchi -no-Makami, a wolf deity that isn't depicted with horns traditionally; despite this, Yamato still maintains her horns even when transformed. It's apparent that their horns are a part of their base forms rather than something carried over from their Devil Fruit forms.
Kaidō and Yamato might not actually be humans at all, but rather another creature entirely known as oni. Generally, when people talk about Kaidō, they refer to him as a "creature" or a "thing," but never a man or a person. This could have been interpreted as a metaphor for his inhuman strength, but it's possible that he is, in fact, some sort of beyond-human monster.
Besides the horns, there are several more hints to suggest that Kaidō and Yamato might actually be oni. Their weapon of choice is the kanabō, which is commonly associated with oni. They live on the island of Onigashima (鬼ヶ島), which literally translates to "island of oni." Kaidō's dialogue in Chapter 1025, "Twin Dragons," makes humans sound like a different species from himself and Yamato. While the details of their race haven't been specified, all the signs point to them being some sort of oni.
It's also possible that Yamato and Kaidō are an undisclosed subset of humans. There are plenty of races of humans with non-human traits like wings or a third eye. Such races have also fallen victim to slavery and worse at the hands of ordinary humans. If Kaidō and Yamato are from such a persecuted people, then it would explain the former's dialogue and contemptuous attitude toward humans shown in Chapter 1025.
As for the rest of the Beast Pirates, the odds are that they're mostly human. Their horns are probably accessories designed to emulate the look of their captain. There are definitely members of the Beast Pirates who have been seen both with and without horns. There are, of course, Beast Pirates who look like they've grown horns naturally, but the odds of them all having real horns are astronomically low.
Adding to this theory is the Ninja-Pirate-Mink-Samurai Alliance, who all had to dress up like Beast Pirates for the Raid on Onigashima; most of them also had horns coming out of their heads, despite obviously never having them before. Since most in the raid group only wear horns as accessories, the same should hold true for the Beast Pirates.
For now, the truth behind Yamato and Kaidō's horns remains largely unknown. They seem to be part of their bodies, in which case Yamato most likely inherited her own horns from her father. They may be a new race of humans that hasn't yet been fully elaborated on. In any case, it's clear that Yamato's horns are something she was born with.
About The Author