Mashin is the spirit of an ancient dragon king who was said to be able to grant wishes to his human followers.
Mashin was once the leader of all the dragons in the world, long before humans could utilize ninjutsu and genjutsu. He gathered a great many followers of different species because it was thought that he could grant the wishes of those who gathered under him. He made this as a lie however- he did not grant the wishes with magic, but instead through physical means. For example, if one wanted to be rich, he'd pretend to create a gem when he actual released it from a seal on his hand. He reigned over the known world for over 300 years. His longevity is due to a pact he made with God of Death. In exchange for not allowing his followers access to medical services, he himself could live forever.
There was a further price though. The Death God only promised his soul would remain on Earth forever. His body could be destroyed, and it was by the first ninja, Rikudo Sennin. Mashin's spirit watched as the empire he had built was split up into several nations ruled by humans and his draconian brethren were killed one by one, thought to be monsters. The ones that were not killed offered their services to ninja clans or left the continent entirely. He waited in a mountain cave for someone to find him and grant him a new body. This someone was Fu, a young female samurai who had entered the cave to commit seppuku due to failing to protect her lord. He seduced Fu into giving up her body as a host for his soul, and used her to gather a small army of missing-nin and mercenaries. He also used her to revive several deceased ninja. A few did not join his army, but most did, including Kin Tsuchi, Zabuza Momochi, Kidomaru, and Yugito Nii.
Mashin is an unusual being. Due to the pact he made with the God of Death, his spirit cannot perish, however, his body can. He is able to possess the body of another being, but only with the being's permission. If he wishes to, he can also instead become a symbiont with the being, etching a tattoo on their body. From this tattoo, he'll drain some of the being's energy. In exchange, he can offer to the owner of tattoo an immortality similar to Hidan's- that is the being will remain alive even if severed. The only point on the being's body that can be attacked successfully is the tattoo itself. If enough damage is done, the host will be killed and Mashin will be rejected from the deceased's body. Also, the being with the tattoo can use almost all known Fire jutsu of B-rank and below, and can create a physical projection of Mashin from the tattoo. This projection has powerful jaws and claws that it can use to attack.
He also forged an odd sword called the Spirit Sword. Using shards of the sword, he can revive dead ninja freely. The only drawback to the sword's technique is that the revived are capable of free will, and so he has to win their loyalty.