The opening supplication (du‘a’ al-istiftah) and the versions narrated in hadiths
Question

Could you tell me all the sahih versions of the opening supplication (du‘a’ al-istiftah) that have been narrated from the Prophet (blessings and peace of Allah be upon him), with their evidence and when they are to be said, and in which of the prayers they are to be said, in qiyam al-layl or in the obligatory prayers or otherwise?
Praise be to Allah.Firstly: the opening supplication (du‘a’ al-istiftah) and the versions of it that have been narrated
Several versions of the opening supplication have been narrated from the Prophet (blessings and peace of Allah be upon him), including the following versions:
1. That which was narrated by al-Bukhari (744) and Muslim (598) from Abu Hurayrah (may Allah be pleased with him), who said: The Messenger of Allah (blessings and peace of Allah be upon him) used to remain silent between the takbir and recitation, and that period of silence was brief. I said: May my father and mother be sacrificed for you, O Messenger of Allah. When you remain silent between the takbir and recitation, what do you say? He said: “I say: Allahumma ba‘id bayni wa bayna khatayaya kama ba‘adta bayna al-mashriqi wa’l-maghrib. Allahumma naqqini min al-khataya kama yunaqqa ath-thawb al-abyad min al-danas. Allahumma ighsil khatayaya bi’l-ma’i wa’th-thalji wa’l-ma’i wa’l-barad  (O Allah, put a great distance between me and my sins, as great as the distance You have made between the East and the West. O Allah, cleanse me of sin as a white garment is cleansed from filth. O Allah, wash away my sins with water and snow and hail).”
2. Abu Dawud (776) and at-Tirmidhi (243) narrated that ‘A’ishah (may Allah be pleased with her) said: When the Messenger of Allah (blessings and peace of Allah be upon him) began to pray, he said: “Subhanak Allahumma wa bi hamdik, wa tabarak asmuka wa ta‘ala jadduka wa la ilaha ghayruk (glory and praise be to You, O Allah, blessed be Your name, exalted be Your majesty; there is no god worthy of worship except You).” Classed as sahih by Shaykh al-Albani (may Allah have mercy on him) in Sahih al-Jami‘.
Shaykh ‘Abd al-‘Aziz ibn Baz (may Allah have mercy on him) said in Fatawa Nur ‘ala ad-Darb (8/182):
In the obligatory prayer, the best is to say, “Subhanak Allahumma wa bi hamdik … (glory and praise be to You…)” or “Allahumma ba‘id bayni wa bayna khatayaya… (O Allah, put a great distance between me and my sins…)”. This is what was narrated from the Prophet (blessings and peace of Allah be upon him) in the obligatory prayer. End quote.
3. Muslim (771) and an-Nasa’i (897) narrated from ‘Ali ibn Abi Talib (may Allah be pleased with him), from the Messenger of Allah (blessings and peace of Allah be upon him), that when he stood up to pray, he said: “Wajjahtu wajhiya lilladhi fatara as-samawati wa’l-ard hanifan wa ma ana min al-mushrikin. Inna salati wa nusuki wa mahyaya wa mamati Lillahi Rabb il-‘Alamin, la sharika lahu wa bidhalika umirtu wa ana min al-muslimin. Allahumma anta al-maliku la ilaha illa anta, anta rabbi wa ana ‘abduka. Zalamtu nafsi wa‘taraftu bi dhanbi, faghfir li dhunubi jami’an, innahu la yaghfir udh-dhunuba illa anta. Wahdini li ahsan il-akhlaq la yahdi li ahsaniha illa anta. Wasrif ‘anni sayyi’aha la yasrifu ‘anni sayyi’aha illa anta. Labbayka wa sa‘dayka wa’l-khayra kulluhu fi yadayka wa’sh-sharru laysa ilayka, ana bika wa ilayka, tabarakta wa ta‘alayta, astaghfiruka wa atubu ilayk… (I have set my face towards the Originator of the heavens and the earth sincerely [in Islam], and I am not among the polytheists. Indeed, my prayer, my sacrifice, my living and my dying are for Allah, the Lord of the Worlds, no partner has He. With this I have been commanded and I am one of the Muslims (those who submit to Him). O Allah, you are the Sovereign and there is no god worthy of worship except You. You are my Lord and I am Your slave. I have wronged myself, and have acknowledged my sins, so forgive all my sins, for no one forgives sins except You. Guide me to the best of attitudes, to which no one can guide except You, and save me from the worst of attitudes, from which no one can save except You. I am here and happy to serve you. All good is in Your Hands, and and evil cannot be attributed to You.  My existence is due to You and my return is to You. Blessed are You and exalted. I seek Your forgiveness and repent to You).”
Ibn al-Qayyim (may Allah have mercy on him) said in Zad al-Ma‘ad (1/196):
What is narrated is that the Prophet (blessings and peace of Allah be upon him) only used to recite this opening supplication in qiyam al-layl. End quote.
4. Muslim (770) narrated from the Mother of the Believers ‘Aa’ishah (may Allah be pleased with her) that she was asked: With what words did the Prophet of Allah (blessings and peace of Allah be upon him) start his prayer when he prayed at night? She said: When he stood to pray at night, he would open his prayer with the words: “Allahumma rabba Jibra’ila wa Mika’ila wa Israfil, Fatir as-samawati wa’l-ard, ‘alim al-ghaybi wash-shahadah, anta tahkumu bayna ‘ibadika fima kanu fihi yakhtalifun, ihdini lima ukhtulifa fihi min al-haqqi bi idhnika, innaka tahdi man tasha’u ila siratin mustaqim (O Allah, Lord of Jibra’il, Mika’il and Israfil, Originator of the heavens and the earth, Knower of the unseen and the seen, You judge between Your slaves concerning that wherein they differ. Guide me concerning that wherein they differ of the truth by Your leave, for You guide whomsoever You will to a straight path).
5. Al-Bukhari (7499) and Muslim (1758) narrated that Ibn ‘Abbas (may Allah be pleased with him) said: When the Prophet (blessings and peace of Allah be upon him) prayed tahajjud at night, he said: “Allahumma laka al-hamd anta nur us-samawati wa’l-ard. Wa laka al-hamd, anta qayyim us-samawati wa’l-ard. Wa laka al-hamd, anta rabb us-samawati wa’l-ard wa man fihinna. Anta al-haqqu wa wa‘duka al-haqq wa qawluka al-haqq wa liqa’uka al-haqq, wa’l-jannatu haqq wa’n-naru haqq, wa’n-nabiyyuna haqq, wa’s-sa‘atu haqq. Allahumma laka aslamtu wa bika amantu wa ‘alayka tawwakaltu, wa ilayka anabtu wa bika khasamtu wa ilayka hakamtu, faghfir li ma qaddamtu wa ma akhkhartu wa ma asrartu wa ma a‘lantu, anta ilahi la ilaha illa anta (O Allah, to You be praise, You are the Light of the heavens and the earth. To You be praise, You are the Sustainer of the heavens and the earth. To You be praise, You are the Lord of the heavens and the earth and everyone in them. You are the Truth, Your promise is true, Your Word is true, the meeting with You is true, Paradise is true, Hell is true, the Hour is true. O Allah, to You I have submitted, in You I have believed, in You I have put my trust, to You I repent, by Your help I have disputed, to You I refer for judgement. So forgive me my past and future sins, what I have done secretly and openly. You are my God, there is no god worthy of worship except You).
6.Muslim (600) and an-Nasa’i (901) narrated from Anas (may Allah be pleased with him) that a man came and joined the row, out of breath, and he said, Al-hamdu Lillahi hamdan kathiran tayyiban mubarakan fih (Praise be to Allah, much good and blessed praise). When the Messenger of Allah (blessings and peace of Allah be upon him) had finished praying, he said: “Which of you is the one who spoke those words?” The people remained silent. Then he said, “Which of you said them? For he did not say anything wrong.” A man said: I came, and I was out of breath, and I said them. He said: “I saw twelve angels competing to see which of them would take them up.”
7. Muslim (601) narrated that Ibn ‘Umar (may Allah be pleased with him) said: Whilst we were praying with the Messenger of Allah (blessings and peace of Allah be upon him), a man who was among the people said: Allahu akbaru kabiran wa’l-hamdu Lillahi kahiran wa subhan Allahi bukratan wa asilan (Allah is most great, much praise be to Allah, glory be to Allah morning and evening.” The Messenger of Allah (blessings and peace of Allah be upon him) said: “Who said such and such?” A man said: I did, O Messenger of Allah. He said: “I was impressed by it, for the gates of heaven were opened for it.” Ibn ‘Umar said: I never stopped saying them since I heard the Messenger of Allah (S) say that.
8. An-Nasa’i (1617) narrated that ‘Asim ibn Humayd said: I asked ‘A’ishah (may Allah be pleased with her): With what words did the Messenger of Allah (blessings and peace of Allah be upon him) start his prayer at night (qiyam al-layl)?
She said: You have asked about something which no one else asked before you. The Messenger of Allah (blessings and peace of Allah be upon him) would say “Allahu akbar (Allah is most great)” ten times, “Al-hamdu Lillahi (Praise be to Allah)” ten times, “Subhan-Allah (Glory be to Allah)” ten times, “La ilaha ill Allah (there is no god worthy of worship except Allah)” ten times and “Astaghfirullah (I seek Allah’s forgiveness)” ten times, and he would say: “Allahumm aghfir li wahdini warzuqni wa ‘afini, a‘udhu Billahi min diq il-maqam yawm al-qiyamah (O Allah, forgive me, guide me and grant me provision and well-being. I seek refuge with Allah from a difficult standing on the Day of Resurrection).” Classed as sahih by Shaykh al-Albani (may Allah have mercy on him) in Sahih Sunan an-Nasa’i.
Secondly:
Can the versions of the opening supplication be recited in both obligatory and supererogatory prayers?
Regarding the versions that have been narrated in the hadiths quoted above, some of them are mentioned in general terms, without being restricted to the night prayers. These may be recited in both obligatory and supererogatory prayers. However, in the case of the opening supplications regarding which it is stated that they were offered in the night prayers – which is most of the lengthy supplications – the Sunnah, and the best approach, is for the individual to recite them in qiyam al-layl.
For more information having to do with the opening supplication in the versions of it that have been narrated, and what is to be said in obligatory and supererogatory prayers, please see Zad al-Ma‘ad by Ibn al-Qayyim (1/195-199) and Sifat Salat an-Nabi sall Allahu ‘alayhi wa sallam [The Prophet’s Prayer Described] by Shaykh al-Albani (may Allah have mercy on him) (p. 91-94).
In the answer to question no. 225452 , we stated that the worshipper should restrict himself to one of the opening supplications, and not combine a number of such supplications in one prayer.
And Allah knows best.