There is an occult art called Ushi no koku mairi that has continued from the Heian period, which one would drive a nail into a sacred tree, become a demon and invoke a curse on a hated enemy.
平安時代から続く、丑の刻参りという呪術があり、古くは神木（神体）に釘を打ち付け、自身が鬼となって恨む相手に復讐するというものである。