Al-Bukhārī, Muslim, Abū Dāwūd, al-Nasāʾī, al-Ṭayālisī, Aḥmad, and al-Bayhaqī all transmit this report through several chains that go back to Abū al-Tiyāḥ from Anas with the same wording. Ibn Mājah also records it, through Ḥammād ibn Salamah from Abū al-Tiyāḥ, in an abridged form. Aḥmad and al-Tirmidhī likewise relate it—through Shuʿbah from the same narrator—with the phrasing that “he used to pray in sheepfolds.” Al-Bukhārī has another version, from ʿĀʾishah, in the account of the Hijrah; it parallels Anas’s narration but contains the additional phrases placed in square brackets.
Building a mosque carries tremendous merit and a vast reward. Allah the Exalted says: “The mosques of Allah are cared for only by those who believe in Allah and the Last Day, establish the prayer, give the zakāt, and fear none but Allah; it is they who are expected to be among the rightly guided” (al-Tawbah, 9:18). The Messenger of Allah (peace and blessings be upon him) said: “Whoever builds a mosque for Allah—[even as small as a sand-grouse’s nesting place] [or smaller] [in which Allah’s name is mentioned]—Allah will build for him a similar house in Paradise.”
This ḥadīth was narrated by ʿUthmān ibn ʿAffān—may Allah be pleased with him—and was recorded by al-Bukhārī, Muslim, and al-Bayhaqī through the isnād of Ibn Wahb, who said: “ʿAmr informed me that Bukayr told him that he heard ʿUbayd Allah al-Khawlānī relate …”