Muslim scholars and philosophers have always claimed that God does not prohibit that which is good or beneficial. Therefore, when scripture comes down prohibiting something that seems to have some benefit, jurists have argued that the prohibition must necessarily be due to the potential or actual presence of some hidden harm. For example, in the case of wine and gambling, the Qur’an admits that there is some benefit for people, but he evil of these vices outweighs the benefit (Qur’an 2:219). For this reason, the Qur’an eventually completely outlaws wine and gambling for the Prophet (pbuh) and his community. However, the existence of hidden harm is not sufficient to warrant complete. In the economic sphere, financing is absolutely required for an economic system to function, and the core of financing is the trading in credit and risk. Trading in credit is usually identified as riba (interest or usury) and trading in risk is identified as gharar (uncertainty or unknown). We find that there are two pre-Islamic forms of financing that contain such kinds of credit and risk trades but were condoned by the Prophet (pbuh). Even after the death of the Prophet (pbuh), classical Islamic legal texts condoned and elaborated the restrictions on their use to avoid uncontrolled and unregulated transfers of credit and risk.
The first case is prepaid forward sales known as salam, and it was used to finance the production of agricultural goods with prepayment from the consumer of those goods to the producer of those goods. Likewise, the second case is known as istisna, and it was used to finance the production of nonagricultural (manufacturing) goods with prepayment from the consumer of those goods to the producer of those goods. Why were salam and istisna condoned while wine and gambling were condemned? The answer is that wine and gambling are not essential to society, hence their complete prohibition was legislated. On the other hand, financing large agricultural and manufacturing ventures are critical to the development and prosperity of a wide-spanning society like the early Muslim empire and for international trade in the modern age. Therefore, even though these two types of transactions contain signiﬁcant risk and uncertainty, as the object of sale does not yet even exist, this gharar is small compared to the benefits that the entire society can reap from ﬁnancing agriculture and manufacturing. This kind of beneﬁt analysis was used by Muslim jurists to allow these kinds of contracts despite their inherent gharar. They argue that this emulates the Prophet’s permission to use these instruments with certain limits to avoid abuse.
Islamic Law aims to protect every individual by preserving and safeguarding certain rights. Classically these rights are the right to Religion, Life, Intellect, Family, and Wealth. As part of preserving wealth, stealing and gambling are absolutely forbidden. In addition, riba is forbidden to prevent individuals from falling into an endless cycle of debt from which they cannot possibly escape. Historically, people can indulge in short-sighted and destructive borrowing if left to their own whims and inclinations. Adherence to religious restrictions can protect individuals by serving as a means of precommitment mechanism to ensure that individuals do not abuse the availability of credit to their own detriment.
To this end, assuming mutual consent, Muslim jurists stipulated several conditions for the validity of any business contract:
A concluded ﬁnancial contract was deemed valid if it avoided six main factors: (1) ignorance about object, price, time-period, and the like, (2) coercion, (3) conditions contrary to a contract’s nature (e.g., sale for a ﬁxed period, or wherein the buyer ’s use of his property is restricted), (4) unnecessary ambiguity in contract language, (5) encroachment on others’ property rights, and (6) unconventional conditions that beneﬁt one party at the other’s expense.
When deriving or inferring rulings, there are many tools of jurisprudence that the scholars had at their disposal. Local custom (urf) was used by both Hanif and Maliki jurists as a basis for various rulings. Juristic approbation (istihsan) was used primarily in Hanafi jurisprudence. Benefit analysis (istislah) was used primarily in Maliki jurisprudence. Analogy (qiyas) was first proposed by Al-Shaﬁ’i, but it gained greater traction in classical circles by the 5th and 6th Hijri centuries. Al-Shafi’i was famous in his denouncement of juristic methods besides ‘analogy’ due to his fear that this would open the doors to rulings based on faulty reasoning or fallible whims and sentiments.  His philosophy has become the default position of many contemporary scholars. One of the reasons the Islamic finance industry seems fixated on the forms and names of various premodern contracts is the idea that juristic inference should be restricted to “reasoning by analogy.” However, many of the classical jurists can be shown to have used juristic approbation or benefit analysis as their guiding principles in deriving economic rulings and law. Ibn Rushd (d. 594 A.H./1198 C.E.) even wrote that that these two methodologies are interchangeable: “in most cases, juristic approbation means consideration of beneﬁts and justice.”
In general, jurists listed four conditions for using beneﬁt analysis: (1) allowing apparent beneﬁt, (2) preventing apparent loss/harm, (3) preventing means of circumventing the Law, and (4) consideration of speciﬁc circumstances in time and place. It is the opinion of many progressive scholars that beneﬁt analysis should be the guide in developing Islamic ﬁnance instruments instead of formalist analogies to premodern contracts. Abdul-Wahhab Khallaf, the Azhari jurist and legal theorist, went so far as to conclude that the final determiner of financial law rulings should be beneﬁt analysis:
Beneﬁt analysis and other legal proofs may lead to similar or diﬀerent rulings. …In this regard, maximizing net beneﬁt is the objective of the law for which rulings were established. Other legal proofs are means to attaining that legal end [of maximizing net beneﬁts], and objectives should always have priority over means.
He reminds that the famous principle of jurisprudence is permissibility by default, and only legal proofs to the contrary can render a new situation or transaction impermissible. However, this rich juristic heritage of engaging the texts and engaging the circumstances with shrewdness and insight is lost in modern times due to a mindset of only allowing contracts that resemble previous contract precedents. This myopia means that any truly novel transaction is not categorized or judged correctly.
 (El-Gamal 2006, 47)
 (El-Gamal 2006, 54)
 (El-Gamal 2006, 29)
 (Khallaf 1972, 141)