In 1658 he entered the Buddhist priesthood and was trained at Hase-dera Temple and Toshodai-ji Temple, thereafter acquiring Esoteric Buddhism at Daigo-ji Temple in Nara and studying Confucianism and the thought of Laozi and Zhuangzi.
1658年（万治元年）仏門に入り、長谷寺・唐招提寺で修学した後、奈良・醍醐寺で密教を修め、儒学・老荘をも学んだ。