How should one pay one’s debt to a creditor who’s deceased and his heirs are unknown?
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions and all those who follow his footsteps until the Last Day.
In Arabic, it is known as al-qardh (القَرضَ). Al-Qardh lexically means cut. According to the al-Misbah al-Munir dictionary : ‘قَرَضْتُ الشَّيْءَ قَرْضًا’ means I cut something. The noun of this word means an item given to another person on loan. This word is used in Arabic for it (the debt) to cut the rights of ownership of the owner on the item.
According to the jurists, the terminology is giving over ownership of something to another person on the condition that the other person will return it without any additions. In Arabic, this process is named qardh for this process cuts the ownership rights to be given to the debtor. This is in line with the meaning of qardh lexically. 
In the issue of receiving and giving a loan, serious emphasis is given by Allah SWT that a long verse in the Quran is dedicated to discussing comprehensively the matters related to debt. The following is the statement of Allah SWT:
يَا أَيُّهَا الَّذِينَ آمَنُوا إِذَا تَدَايَنتُم بِدَيْنٍ إِلَىٰ أَجَلٍ مُّسَمًّى فَاكْتُبُوهُ
“O you who have believed, when you contract a debt for a specified term, write it down.” 
Matters that are encouraged during a loaning process according to the above verse are:
- Write the loan (the details of the loan clearly)
- The person drawing up the loan agreement must be from those who are just and fair.
- Do note reduce anything from the loan.
- For the weak, he should be represented by the wali (guardian).
- Get witnesses (two men or one man and two women)
- Have taqwa to Allah SWT throughout the transaction.
Referring to the above question, for the debtor who is unable to return the debt (money or asset) to its owner (the deceased), then the debtor must return it to the heirs of the deceased. However, if the debtor couldn’t find the deceased’s heirs, then the debt can be channelled for the maslahat of the Muslims. Or it can also be donated to the poor and needy.
Imam al-Nawawi cited the opinion of Imam al-Ghazali who said: “Whoever keeps prohibited property (assets that aren’t his or a debt to someone else) and he wanted to repent from his acts and free himself from the prohibited property, he should search and find the rightful owner of the asset. When the rightful owner is dead, the asset should be returned to the owner’s heirs. However, if the rightful owner cannot be found or is unknown, then it can be distributed for the maslahah of the Muslims such as to build bridges, mosques, protecting the country’s border and other sectors which are beneficial for all Muslims as a whole. Or it can also be donated to the poor and needy.” 
In the book Syarh Riyad al-Solihin, the author said that the asset can also be donated in the deceased’s name and set the intention to Allah SWT that he rewards are for the deceased. Thus, the debt is donated in his name sincerely. And Allah SWT knows it and will grant it to the person (owner of the asset). 
Debt is an immense matter and it affects a Muslim’s life in this world as well as in the hereafter. Especially, if the debt involves the right of people that should first be settled when he is alive. According to the above arguments, in our opinion, the debtor must strive and try his best to find the heirs (of the deceased) to settle his debt. However, if he couldn’t find them after his best efforts, then the money or asset should be passed to the state baitulmal so that it can be used for the general public’s benefit.
Every debtor should be determined to settle his debt no matter what. For those who are capable to pay off their debts, then they should hasten to do so.
From Abu Hurairah RA, the Prophet PBUH said:
مَطْلُ الْغَنِيِّ ظُلْمٌ، فَإِذَا أُتْبِعَ أَحَدُكُمْ عَلَى مَلِيٍّ فَلْيَتْبَعْ
“Delay in payment by a rich man is injustice, but when one of you is referred for payment to a wealthy man, he should accept the reference.” 
With this explanation, it is hoped that it opens the thoughts of Muslims to hasten in fulfilling the rights (debt) of others. The reason is that the punishments for those who delay and take the property of others are grave. Thus, there can’t be any excuse to avoid paying the rights of others that is in our assets.
 See al-Misbah al-Munir, 2/497
 See al-Fiqh al-Manhaji, 4/121-122
 See Majmu’ Syarh Muhazzab, 9/351
 See Syarh Riyad al-Solihin, 1/89
 Narrated by al-Bukhari (2288)