Mahdi is from the progeny of
«sebtain» (i.e. hassan and hussein)
the author of «eqdud-durar» in the third chapter of section no. 3 narrates from the book «sefat al-Mahdi» of hafez abu naeem esfahani who in turn narrates from ali-ibn-hallal who narrates from his father as such:
'i received the honour of visiting the messenger of Allah (s.a.w.a.) at the time when his soul was about to depart and fatemah was crying besides him. he recited the afore-said lengthy tradition and in the end of it he said: 'o fatemah, i swear by the one who rightly appointed me that Mahdi of this 'ummah' will be from those two (i.e. hassan and hussein).
the world will become such that chaos and disturbances will be intensified all path (of solution) will be served and people will fiercely fall upon one another such that neither the elders will show mercy upon the young nor the children will honour the old. when this happens, Allah will appoint someone (i.e. Mahdi) who shall conquer the deviated castles and open out the sheathed hearts (a metaphoric remark that hazrat shall dominate over the false religions and tame the deviated hearts towards islam). indeed he shall revolt at the end of time just as i revolted at my time. he shall fill the earth with justice just as it had been filled with oppression.
the author says: this tradition has been narrated by ganji from the book «netal-Mahdi» of abu na'eem esfahani and «mu'ajam kabeer» of abul qasim tabarani and most of the experts of tradition too, have narrated this tradition in their respective books with slight differences in wordings. in some of them, the words 'from us' has been written instead of 'from those two'.(43)
the author of «yanabi-ul-muwadda» on page 432 writes: 'the author of jawaher al-aqdain says; 'as per research, the effects of the holy prophet's 'dua' (invocation) at the time of marriage of ali and fatemah (peace be upon them) became apparent in the offsprings of hassan and hussein. thus, from their offspring are those who have passed away and those who are still to come, if there will not come anyone in the future except Mahdi, suffice it will be for the invocation of the holy prophet to have come into effect.
in this regard, the author says: 'just as we saw in the tradition of ali-ibn-hallal, hazrat's swearing, in spite of being truthful and trustworthy was only to emphasise the matter. from amongst the seven-fold characteristics, hazrat has set aside Mahdi and sweared by him only, showing the importance of this matter.
however the reason that Mahdi (a.s.) is from the sons of «sebtain» (a.s.) (offsprings of ali) is that hazrat baqer's mother (i.e. fatemah) was the wife of hazrat ali-ibn-hussein zain-ul-abedeen (a.s.) and daughter of hazrat abu muhammad hassan mujtaba (a.s.) and about this woman, imam baqer has said:-
'fatemah is a righteous woman. so abu jafar muhammad-ibn-ali baqer is from the sons of hassan and hussein and he and his honourable sons are amongst those who have attained this honour. Mahdi, the awaited one too is from this propitious splendour and blessed family tree because, he is muhammad-ibn - hassan-ibn-ali-ibn-muhammad-ibn-ali-ibn-musaibn-jafar-ibn-muhammad - ibn - baqir-ibn-ali-ibn-hussein-ibn-ali-ibn-abi talib amir-ul-mumineen (a.s.)
«Mahdi is from the offspring of