The earliest bayonets ware the plug bayonets. The plug bayonet got attached by inserting the bayonet end of the handle into the muzzle of a musket. It got plugged in the muzzle. The biggest disadvantage with this approach, was that the musket could not be fired with the bayonet attached, and the bayonet had to be removed before reloading. These issues had to be fixed, and the socket bayonet was designed to overcome this problem.
The plug bayonet was used in Scandinavia at the en of the 15th century and in the early 16th century it was already made obsolete by the socket bayonet.