Side mechanics of a matchlock rifle.

Diagram showing a matchlock while being fired.
The matchlock mechanism, or just matchlock, was one of the first gunlock designs used, it was created in the mid-1400s. The matchlock preceded the wheellock mechanism.
It used a piece similar to that of a striker (or hammer) called a serpentine, which held a slow-burning matchcord (slowmatch), which, after being lit burned slowly, the wielder would pull the trigger and the burning wick would be lowered into a flash pan, which contained powder. After the powder was ignited, it set-off the powder in the barrel, firing the projectile. Later in the 1540s, it was improved upon to include a cover plate over the flash pan, which automatically retracted when the trigger was pulled.
There were some disadvantages to the matchlock, one being that the burning piece could easily not burn in wet or freezing weather, and even lighting the cord takes an annoying amount of time making it impractical and useless if the holder is put in a compromising situation, leading to the rise of the flintlock during the 1600s. However, the matchlock remained popular in the civilian market as it functioned just as well as a flintlock for most purposes, and it is and was significantly simpler, cheaper, and easier to maintain and create than the flintlock. The flash flood of surplus military matchlock material onto the market by the 1700s leading to a price drop made it more than popular with rebels, militia, and civilians as well as poor militaries well into the mid 1800s when it was well and truly made obsolete by primitive bolt action weapons such as the Chassepot.