In movies and TV shows emperors, kings and sultans always just keep all their gold in a room in their palace. Suppose I'm a medieval Sultan or byzantine emperor, where do I keep my personal wealth?

by grapp
Czechbro

This perception, created by film and TV, is accurate in that the "Treasury" building was often located in the Palace, but inaccurate in that it greatly simplifies the actual process of what is happening in the context of the Treasury generally. To confine the question a little bit, let's consider a building which you can actually still visit - the Topkapi Palace used by the Ottoman Sultans. The Topkapi palace built upon the plan of early palaces built by the Sultans at Konya, Bursa, and ultimately, Byzantine and earlier Islamic palatial plans, such as those build by the Abbasid and Fatimid caliphates. While Topkapi obviously changed over time, it was from its earliest inception a series of courtyards with a clear division between "public" i.e. administrative, and "private" (residential) functions. Have a look at the overall plan: https://en.wikipedia.org/wiki/Topkap%C4%B1_Palace#/media/File:Topkapi_Palace_overview_EN.svg Needless to say, governing a large empire is not easy. It requires thousands of officials, functionaries, tax collectors, etc. By and large, these officials of the Court worked in the First (outermost) Courtyard. Attached to the Courtyard is the site of the Imperial Mint. (see picture in link below)

https://en.wikipedia.org/wiki/Topkap%C4%B1_Palace#/media/File:Mint_Topkapi_Istanbul_2007.jpg

Naturally, the Mint would have been full of officials and workers busy producing the coinage of the realm. We can envision rows of men seated on the floor (chairs not being common in the Ottoman Empire) in front of their desks, each with an abbacus and weights and measures, carefully monitoring the quality of the coins as they are struck.

Near to the Mint, still in the outer part of the Palace, the old Byzantine Church of Hagia Eirene was converted into a storehouse for weapons, as well as ad-hoc treasury for recently acquired campaign loot. (Necipoğlu, Gülru (1991). Architecture, ceremonial, and power: The Topkapi Palace in the fifteenth and sixteenth centuries. Cambridge, Massachusetts: The MIT Press. ISBN 0-262-14050-0.) Have a look at the interior space and just imagine how much could have been stored there: https://en.wikipedia.org/wiki/Hagia_Irene#/media/File:Hagia_Eirene_Constantinople_2007.jpg

Naturally, the storehouse of Hagia Irene would have been guarded night and day by the Janissaries, the Sultan's elite royal bodyguard of slave-soldiers. Arguably, this fits the definition of a "Treasury" although it is a very specific type for a particular use.

Moving further into the Palace, away from the outer "public" spaces and towards the "private" sphere, we can find two additional "Treasury" spaces.

In the 3rd Courtyard the "outer treasury" (turkish: "dış hazine") was the location where the Pashas and other dignitaries of the Empire gathered to offer their annual tribute payments to the Sultan. The elite Janissary corps also received their payment here. Tax and administrative officials would probably have been in near-permanent residence, overseeing the affairs of the Empire and keeping accounts. You can see that today it is used as an Arms and Armor museum:

https://en.wikipedia.org/wiki/Topkap%C4%B1_Palace#/media/File:Armory_Second_Court_Topkapi_Istanbul_2007_panorama.JPG

Finally, there is the "Inner Treasury," which might be the closest to what you are thinking about. Known as the "Conqueror's Pavilion," it housed a large series of vaulted chambers where the Sultan could safeguard objects of particular personal use or significance - magnificent gifts received from kings and princes, jewel-encrusted swords from his royal ancestors, solid gold drinking vessels, etc. ( Topkapi Palace Museum (2001). The Imperial Treasury. Istanbul: MAS Publications. ISBN 975-7710-04-0.) See a picture below: https://en.wikipedia.org/wiki/Topkap%C4%B1_Palace#/media/File:Conqueror_Pavillon_March_2008pano.jpg

Access to this "inner treasury" was strictly controlled, and the overseeing official or "Hazinedarbaşı" held an important ceremonial post in the Court.

TL;DR: There several of types of Royal Treasuries which were in common use, at least in the Ottoman Empire. The stereotypical room filled with sacks of gold coins, crowns, etc. is inaccurate, because it improperly confuses the different kinds of treasuries. So... as you can see... if you asked the Sultan to see his Treasury, assuming he didn't order you strangled for impudence, the answer would very likely be "which one?"

Chamboz

This is on the tail end of medieval, but if you're an Ottoman sultan in the 15th and 16th centuries you keep your treasure within a room in Topkapı Palace (later also in underground rooms beneath the palace), and whatever doesn't fit there goes to Yedikule Fortress on the edge of Istanbul. The contents of the treasury room(s) were organized by type, with different goods arranged according to a basic categorization scheme.

Treasure of a particular origin could be kept elsewhere, however. Individuals who died without heirs had their property confiscated by the state and kept above the palace's first gate, the bâb-ı hümâyûn, and if no one arrived to claim it after seven years it would be joined with the rest of the treasure kept in the palace.

Necipoğlu, Gülru. Architecture, Ceremonial, and Power: The Topkapı Palace in the Fifteenth and Sixteenth Centuries. Cambridge: MIT Press, 1993.