During the reign of Kosambika in Kosambī, two brahmins, Dīpāyana and Mandavya, gave away their vast wealth and lived for fifty years as ascetics in Himavā. After that, while on a pilgrimage to Benares, they were entertained by a householder who was also named Mandavya. Dīpāyana journeyed on while the ascetic Mandavya remained in a cemetery near Benares. There some robbers left some stolen goods outside his hut, and Mandavya, being charged before the king, was impaled, but by virtue of his great powers he continued to live. Dīpāyana came to see his friend, and finding him thus and learning that he bore no ill-will towards anyone, took up his abode under his impaled body. Gouts of gore fell from Mandavya's wound on to Dīpāyana's golden body and there dried, forming black spots; so he came to be called Kanha-Dīpāyana. When the king heard of this, he had Mandavya released with a piece of the stake still inside him, on account of which he came to be called āni-Mandavya. Dīpāyana returned to the householder Mandavya, whose son Yaññadatta he helped to heal by an Act of Truth, the child having been bitten by a snake while playing ball. The lad's parents then performed acts of Truth. In this declaration of Truth it was disclosed that Dīpāyana had no desire for the ascetic life, that the father did not believe in the fruits of generosity, and that the mother had no love for her husband. They thereupon admonished each other and agreed to mend their ways.
The Mandavya of the story was Ananda, his wife Visākhā, the son Rāhula, āni-Mandavya Sāriputta and Kanha-Dīpāyana the Bodhisatta (J.iv.27ff). The occasion for the story is the same as that for the Kusa Jātaka. In one verse Kanha-Dīpāyana is addressed merely as Kanha (Ibid., p.33).
The story is also given in the Cariyāpitaka (p.99f).