Thanks for posting your query at DoctorSpring.com. I can understand your concern.
You seem to be having a haematoma in the nail which happens due to some trauma. You won't feel any pain. It could have been a minor trauma that you may not recall.
It doesn't require any treatment. Once the nail grows out, you can cut that part of the nail out.
Hope this helps, please feel free to get back with any queries.