the formalities are: submit your resignation letter, then pay the company hiring expenses...why? because you are in breach of contract plain and simple.