The Messenger of Allah ﷺ taught me the tashahhud to recite in the middle of the prayer and at its end.We used to memorize this from Abdullah when he told us that the Messenger of Allah ﷺ had taught it to him. He said that when he sat in the middle of the prayer and at its end on his left thigh, he would say, "All greetings, prayers, and pure things 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 messenger."He said, "Then, if it was in the middle of the prayer, he would rise once he finished his tashahhud. If it was at the end of the prayer, he would supplicate after his tashahhud with whatever Allah willed him to supplicate, then give the salam."
علمني رسول الله ﷺ التشهد في وسط الصلاة وفي آخرها. فكنا نحفظ عن عبد الله حين أخبرنا أن رسول الله ﷺ علمه إياه قال: فكان يقول: إذا جلس في وسط الصلاة وفي آخرها على وركه اليسرى: التحيات لله، والصلوات والطيبات، السلام عليك أيها النبي ورحمة الله وبركاته، السلام علينا وعلى عباد الله الصالحين، أشهد أن لا إله إلا الله، وأشهد أن محمدا عبده ورسوله. قال: ثم إن كان في وسط الصلاة نهض حتى يفرغ من تشهده، وإن كان آخرها دعا بعد تشهده بما شاء الله أن يدعو، ثم يسلم.
Imam Ahmad narrated it (4382) from Yaqub, who said, My father narrated to me, from Ibn Ishaq, who said, I was told about the tashahhud of the Messenger of Allah ﷺ, and at the end of it is Abdul-Rahman bin Aswad bin Yazid Nakhai, from his father, from Abdullah, and he mentioned the hadith.Its chain is hasan because of Muhammad bin Ishaq, for he is a mudallis, and when he explicitly states that he heard directly, his hadith is hasan.Ibn Khuzayma graded it sahih (702) and narrated it through the route of Muhammad bin Ishaq with his chain, except that he did not mention his statement, "in the middle of the prayer."Malik, may Allah have mercy on him, adopted this view and said, "He sits in the tawarruk position in every case," meaning in the middle of the prayer and at its end.The sitting between the two prostrations is like the sitting for the tashahhud, and the explanation of "the middle" has come, as will follow, in his statement, "When you sit after every two rakahs."The reality of tawarruk is that one keeps the right foot upright, places the sole of the left foot beneath the right thigh, and places both buttocks on the ground. This is what Kharaqi said, see Mughni (1/225).As for the Hanafis, they made the two tashahhuds equal, saying, "He sits on his left foot and keeps the right one upright."