Thanks for the query,
you might have developed a glomus tumor
It is a deep seated tumor of nail and is very painful.
The treatment is surgical removal of nail plate followed by excision of tumor.
Dont worry the nail plate will regenerate in a month.
Let me know if you have any other doubts.