 After having established the first mosque in Medina and obtaining residence with Abu Ayyub al-Ansari, he then set about the establishment of a pact known as the Constitution of Medina.This document was a unilateral declaration by Muhammad, and deals almost exclusively with the civil and political relations of the citizens among themselves and with the outside.The source of authority was transferred from public opinion to God.