The Messenger of Allah ﷺ taught me the tashahhud with my hand between his hands, just as he would teach me a surah from the Quran. He said, "All greetings, prayers, and pure words are for 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 His Messenger."This was while he was still among us. After he passed away, we said, "Peace be upon the Prophet."
حدثنا أبو نعيم حدثنا سيف قال سمعت مجاهدا يقول حدثني عبد الله بن سخبرة أبو معمر قال سمعت
علمني رسول الله ﷺ التشهد كفي بين كفيه كما يعلمني السورة من القرآن قال التحيات لله والصلوات والطيبات السلام عليك أيها النبي ورحمة الله وبركاته السلام علينا وعلى عباد الله الصالحين أشهد أن لا إله إلا الله وأشهد أن محمدا عبده ورسوله وهو بين ظهرانينا فلما قبض قلنا السلام على النبي
Its isnad is sahih. Bukhari related it, 11:47-48, from Abu Naeem, from Sayf. Hafiz pointed out in Fath al-Bari, 2:260, that Abu Awana also related it in his Sahih, as did Sarraj, Jawzaqi, Abu Naeem Asbahani, Bayhaqi, and Abu Bakr bin Abu Shayba, all of them relating it from the hadith of Abu Naeem, who is Fadl bin Dukayn, the teacher of Ahmad and Bukhari. Its meaning has already come up several times, most recently at 3921. In this narration there is an addition, that after the death of the Messenger of Allah ﷺ they used to say, "Peace be upon the Prophet," using the third person, instead of "Peace be upon you, O Prophet," using the direct address.