Explosion enchant for bow?

How could I make an enchantment that causes the arrow to explode, but only once it hits an entity/block?
Continue to help post