Both forms are correct. While and whilst are both correct forms, because they are basically the same word. However, while is more commonly known and used, it can be replaced by whilst. To be more precise, whilst is the British English version of while, that adds a more sophisticated sound to the sentence. Although, there is a small difference between them. Both words are conjunctions and, in that case, can replace each other, but only while can act as a noun.

Correct spelling

while

Correct spelling, explanation: more commonly known and used form.

Correct spelling

whilst

Correct spelling, explanation: British, more sophisticated version of while.

Definition of while/whilst:
conjunction: at the same time as;
I read this book while I was on vacation.
– in spite of the fact, even though;
Whilst I respect your point of view, I am against these changes.
– compared with, but;
Timmy likes winter sports, while Katy hates any snow-related activities.
– as long as;
Whilst he is in the meeting, we have time to decorate the cake.
While (noun): an unspecific period of time;
It only took him a while to change the settings on my computer.