The Messenger of Allah ﷺ taught me the tashahhud for the middle of the prayer and for its end. We used to memorize it from Abdullah when he informed us that the Messenger of Allah ﷺ had taught it to him.He said that when he sat in the middle of the prayer or at its end on his left hip, he would 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."He said that if it was in the middle of the prayer, he would rise as soon as he finished his tashahhud, and if it was at the end, he would supplicate after his tashahhud with whatever Allah willed him to supplicate, then he would give the closing salam.
حدثنا يعقوب قال حدثني أبي عن ابن إسحاق قال حدثني عن تشهد رسول الله ﷺ في وسط الصلاة وفي آخرها عبد الرحمن بن الأسود بن يزيد النخعي عن أبيه
علمني رسول الله ﷺ التشهد في وسط الصلاة وفي آخرها فكنا نحفظ عن عبد الله حين أخبرنا أن رسول الله ﷺ علمه إياه قال فكان يقول إذا جلس في وسط الصلاة وفي آخرها على وركه اليسرى التحيات لله والصلوات والطيبات السلام عليك أيها النبي ورحمة الله وبركاته السلام علينا وعلى عباد الله الصالحين أشهد أن لا إله إلا الله وأشهد أن محمدا عبده ورسوله قال ثم إن كان في وسط الصلاة نهض حين يفرغ من تشهده وإن كان في آخرها دعا بعد تشهده ما شاء الله أن يدعو ثم يسلم