According to legend, during the Kamakura Era, a Japanese monk named Kakushin braved countless hardships and trekked all the way to China's Jingshan Temple, known as "the foremost of the Five Mountains and Ten Monasteries," in search of Mahayana Buddhism. Whether he actually obtained the dharma or not is unclear, but the method of making miso—that is, fermented soybean paste—he certainly brought back.
Once he returned home, he gathered the monks and followers of his temple to start experimenting with making soybean paste, preparing for mass production as a capital base for supporting the dharma. But after the paste was finished, he discovered that the liquid floating on top—"shoyu"—was salty, savory, and surprisingly delicious. Thus, Japan now had soy sauce—also known as "shoyu" or "soy paste oil."