We did not know what to say when we prayed, so the Prophet of Allah ﷺ taught us comprehensive words. He said to us, "Say, 'All greetings, prayers, and good things belong to Allah. Peace be upon you, Prophet, and the mercy of Allah and His blessings. Peace be upon us and upon the righteous servants of Allah. I bear witness that there is no god but Allah, and I bear witness that Muhammad is His servant and Messenger.'"Ubaydullah said that Zayd reported from Hammad, from Ibrahim, from Alqama, who said, "I saw Ibn Masud teaching us these words just as he taught us the Quran."
أخبرني محمد بن جبلة الرافقي قال حدثنا العلاء بن هلال قال حدثنا عبيد الله وهو ابن عمرو وعن زيد بن أبي أنيسة عن حماد عن إبراهيم عن علقمة بن قيس
كنا لا ندري ما نقول إذا صلينا فعلمنا نبي الله ﷺ جوامع الكلم فقال لنا قولوا التحيات لله والصلوات والطيبات السلام عليك أيها النبي ورحمة الله وبركاته السلام علينا وعلى عباد الله الصالحين أشهد أن لا إله إلا الله وأشهد أن محمدا عبده ورسوله قال عبيد الله قال زيد عن حماد عن إبراهيم عن علقمة قال لقد رأيت ابن مسعود يعلمنا هؤلاء الكلمات كما يعلمنا القرآن
[Sahih] Reported by Abu Dawud, Chapter on Prayer, Section on Tashahhud, no. 970, from the hadith of Alqama bin Qays, and it is also in Kubra, no. 755.