If it was a mine, it was apparently in Iranian waters.
Solution: Stay out of Iranian waters outside the Gulf
It sounds like it was a limpet mine attached by a diver or a passing boat.