The ninja was good at dealing with gunpowder. It is said that before gunpowder and guns were introduced by Europeans, immigrants from China produced gunpowder in the Koka area.
The technique to handle gunpowder rapidly improved in the Iga and Koka areas because gunpowder ingredients, such as moxa, camphor, and horse dung were readily available there.
There were many knowledgeable immigrants, too. Whereas a gunpowder ingredient, saltpeter was not available except by import until the warring country period, the ninja could get it secretly from aged soil found under the porch of shrine.
The snipers who attempted to shoot ODA Nobunaga, one of the unifiers of Japan, although they were later executed, were master gunners of Koka and Iga. Establishing several gunnery schools, the ninja played an active role as an artillery force during the latter half of the Edo period.