Schaffhausen was a city state in the Middle Ages, documented to have struck its own coins from 1045. About 1050 the counts of Nellenburg founded the Benedictine monastery of All Saints, which became the centre of the town. Perhaps as early as 1190, certainly in 1208, it was an imperial free city, while the first seal dates from 1253. The powers of the abbot were gradually limited and in 1277 the Emperor Rudolf I gave the town a charter of liberties. In 1330 the emperor Louis of Bavaria pledged it to the Habsburgs. In the early 15th century, Habsburg power over the city waned. By 1411 the guilds ruled the city. Then, in 1415 the Habsburg Duke Frederick IV of Austria sided with the Antipope John XXIII at the Council of Constance, and was banned by the Emperor Sigismund. As a result of the ban and Frederick's need of money, Schaffhausen was able to buy its independence from the Habsburgs in 1418. The city allied with six of the Swiss confederates in 1454 and allied with a further two (Uri and Unterwalden) in 1479.
Schaffhausen became a full member of the Old Swiss Confederacy in 1501. It issued its own coinage until the formation of the modern federal state of Switzerland in 1848 which imposed a single currency in 1850, replacing all former cantonal and city currencies.