The precise dating of the Constitution of Medina remains debated but generally scholars agree it was written shortly after the hijra (622). It effectively established the first Islamic state. The Constitution established: the security of the community, religious freedoms, the role of Medina as a haram or sacred place (barring all violence and weapons), the security of women, stable tribal relations within Medina, a tax system for supporting the community in time of conflict, parameters for exogenous political alliances, a system for granting protection of individuals, a judicial system for resolving disputes, and also regulated the paying of Blood money (the payment between families or tribes for the slaying of an individual in lieu of lex talionis).
After emigration to Medina, Muhammad drafted the Constitution of Medina, "establishing a kind of alliance or federation" among the eight Medinan tribes and Muslim emigrants from Mecca, which specified the rights and duties of all citizens and the relationship of the different communities in Medina (including that of the Muslim community to other communities specifically the Jews and other "Peoples of the Book").
Montogmery Watt suggests that the constitution must have been written in the early Medinan period. He supports his view by arguing that had the document been drafted later, it would have had a favorable attitude towards Quraysh, and given Muhammad a prominent place. Hubert Grimme believes the Constitution was drafted in the post-Badr period, while Cetani argues that the document was complete before the Battle of Badr.
According to R.B. Serjeant, verses 101-104 of sura 3 of the Qur'an make reference to the Constitution. He proposes that this section of the Qur'an underwent recension (a hypothesis first proposed by Richard Bell). In its first recension, this text sanctioned the establishment of a confederation. In its second, it admonished the Aws and Khazraj to abide by their treaty. In its third, in conjunction with the proceeding verses, it is an encouragement of Muhammad's adherents to face the Meccan forces they eventually fought at Uhud. He states that even if this proposal of three recensions be unacceptable, it must be affirmed that these verses make reference to the two different treaties.
Legal Scholar L. Ali Khan says the Constitution of Medina was a social contract derived from a treaty and not from any fictional state of nature or from behind the Rawlsian veil of ignorance. The contract was built upon the concept of one community of diverse tribes living under the sovereignty of One God.
Dr. Muhammad Tahir-ul-Qadri has written a book called the Constitutional Analysis of the Constitution of Madina which states an analysis and review of the Constitution. He has categorised the headings of the articles according to the modern legal constitutions consisting of 63 articles.
The Medina Constitution also instituted peaceful methods of dispute resolution among diverse groups living as one people but without assimilating into one religion, language, or culture. Welch in Encyclopedia of Islam states: "The constitution reveals his Muhammad's great diplomatic skills, for it allows the ideal that he cherished of an ummah (community) based clearly on a religious outlook to sink temporarily into the background and is shaped essentially by practical considerations."