At the close of the Revolution, Hamilton left the army to study law. He served in the Continental Congress in 1782 and 1783, and in 1786 he played a leading role in the Annapolis Convention, called to consider the problems of interstate commerce and other matters; he also drafted the resolution that led to the Constitutional Convention in Philadelphia in 1787. At the convention, Hamilton was outvoted on every measure by antifederalists, who opposed a strongly centralized federal government. Afterward, he turned his energies to securing New York's ratification of the Constitution. He enlisted the help of American statesmen John Jay and James Madison in writing the essays subsequently collected and published under the title The Federalist. Hamilton is believed to have written at least 51 of the 85 essays.
In 1789 President George Washington appointed Hamilton first secretary of the treasury. In 1790 Hamilton submitted a report on the public credit that provided for the funding of national and foreign debts as well as federal assumption of the states' revolutionary debts. Hamilton's proposals were adopted, as were his subsequent reports calling for the establishment of a national bank and the encouragement of American manufactures by means of bounties and protective tariffs.
In 1798 President John Adams reluctantly appointed Hamilton inspector general of the army when war with France seemed imminent. Bitter quarrels between Hamilton and Adams produced factionalism within the Federalist Party and contributed significantly to its defeat by the Republican Party in 1800.