Koji has been used in the orient for two to three thousand years. Its use on a substrate of rice, soybean and wheat bran seems to have originated in China. Use of koji migrated to Japan in the Yayoi period around the change in the western calendar from BC to AD. Somewhere in the Heian and Muromachi period between the thirteenth and the fifteenth centuries AD koji became commercially available.
This was, in part, possible because of the use of hardwood leaf ash. These leaves where burned in an environment with limited oxygen to produce an ash/charcoal that was protective for the koji-kin. Koji-ken base packed, layered, in boxes with a layer of koji-ken then ash and repeated. The use of ash in packing to preserve the koji-kin led to the discovery that adding the ash directly to steamed rice produced more consistent koji production. We now know the alkaline environment from the ash prevents other micro-organisms from getting a foothold and that the minerals in the ash help mold growth.
Moyashi or fermentation starter suppliers, two of them, were established in the Muromachi period about 1400AD. The Koji-za did not license more than these two prior to 1700AD. Currently, there seems to be about five such producers.