Bulugh al-Maram 312
وَعَنْ عَبْدِ اللَّهِ بْنِ مَسْعُودٍ - رضي الله عنه - قَالَ: الْتَفَتَ إِلَيْنَا رَسُولُ اللَّهِ - صلى الله عليه وسلم - فَقَالَ: «إِذَا صَلَّى أَحَدُكُمْ فَلْيَقُلْ: التَّحِيَّاتُ لِلَّهِ, وَالصَّلَوَاتُ, وَالطَّيِّبَاتُ, السَّلَامُ ⦗٩٢⦘ عَلَيْكَ أَيُّهَا النَّبِيُّ وَرَحْمَةُ اللَّهِ وَبَرَكَاتُهُ, السَّلَامُ عَلَيْنَا وَعَلَى عِبَادِ اللَّهِ الصَّالِحِينَ, أَشْهَدُ أَنْ لَّا إِلَهَ إِلَّا اللَّهُ, وَأَشْهَدُ أَنَّ مُحَمَّدًا عَبْدُهُ وَرَسُولُهُ, ثُمَّ لِيَتَخَيَّرْ مِنَ الدُّعَاءِ أَعْجَبَهُ إِلَيْهِ, فَيَدْعُو». مُتَّفَقٌ عَلَيْهِ, وَاللَّفْظُ لِلْبُخَارِيِّ. وَلِلنَّسَائِيِّ: كُنَّا نَقُولُ قَبْلِ أَنْ يُفْرَضَ عَلَيْنَا التَّشَهُّدُ. وَلِأَحْمَدَ: أَنَّ النَّبِيَّ - صلى الله عليه وسلم - عَلَّمَهُ التَّشَهُّد, وَأَمَرَهُ أَنْ يُعَلِّمَهُ النَّاسَ.
ʿAbdullah ibn Masʿud, may Allah be pleased with him, said: The Messenger of Allah ﷺ turned to us and said: "When one of you prays, let him say: 'All greetings are for Allah, and all prayers and all good things. Peace be upon you, O Prophet, and the mercy of Allah and His blessings. Peace be upon us and upon the righteous slaves of Allah. I bear witness that there is no god but Allah, and I bear witness that Muhammad is His slave and His Messenger.' Then let him choose whichever supplication he likes most, and supplicate." Agreed upon, and the wording is al-Bukhari's. And an-Nasaʾi has: "We used to say [this] before the tashahhud was made obligatory upon us." And Ahmad has: The Prophet ﷺ taught him the tashahhud and commanded him to teach it to the people.