The origin of the temple itself is less clear. A legend recounted at the temple says that two monks from India came to the area about 2,000 years ago to spread the teachings of Buddha. A local prince was much impressed and asked each of the monks for ten hairs. He then built the temple, placing one hair in each pagoda.