The Canton of Schaffhausen is a canton of Switzerland. The principal city and capital of the canton is Schaffhausen.Schaffhausen was a city-state in the Middle Ages, documented to have struck its own coins starting in 1045. It was then known as Villa Scafhusun. Around 1049 Count Eberhard von Nellenburg founded a Benedictine monastery which led to the development of a community. This community achieved independence in 1190. In 1330 the town lost not only all its lands but also its independence to the Habsburgs.
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 Confederation in 1501. The first railroad came to Schaffhausen in 1857. In 1944 Schaffhausen suffered from a bombing raid by United States Army Air Force planes that accidentally strayed from Germany to neutral Switzerland.