Effectively an early form of trademark and quality-mark. Hallmarks were stamps placed by guilds on goods, which, after inspection met their minimum standards for quality. The use of hallmarks is most commonly associated with silver and goldsmiths and most notably attested to the minimum silver or gold content of an item.
Hallmarks were so known because they were applied at the city guildhall or at the hall of the relevant city guild, and thus each hallmark also served to identify the city of manufacture and the actual maker (the maker’s mark). Guilds had charters granted by the city or state, which often granted them quite draconian powers to prohibit the counterfeiting of marks.
Over time the closed shop tendency of guilds (full membership often became effectively hereditary) caused craftsmen who had completed their apprenticeships to leave for cities that lacked a relevant-guild or where a manufacturing technique was unknown, giving rise to early patents of importation. Hallmarks remain in use today, though access to the right to apply a hallmark is much easier and generally regulated by the city/state directly rather than by the guilds.