Keys of various colours are used to unlock doors and progress further in Melzar's Maze, primarily used during Dragon Slayer to obtain the map part. They are obtained by killing the creatures in the maze. Entering Melzar's Maze requires a maze key, obtained from the Guildmaster in the Champions' Guild.
Upon using a key, it will disintegrate.
There is always one specific trait of a monster that drops its respective key. The small zombie rat with the long tail will always drop the red key, the orange key is always dropped by the ghost wearing a hood with no cape, and the yellow key is always dropped by the skeleton with the round shield. However, one random zombie from two will drop the blue key.