There is a proper way to sit at the piano. By being mindful of this from the start, you can ensure good habits for life.
I used to suffer greatly from carpal tunnel syndrome from typing on the computer with poor hand positioning. Once I became conscious and aware of this, I have cured myself. Well, it did take some massive reconditioning and even occupational therapy along with a cortisone shot to start changing my habit! So, you see, habits can be tough to break.
Height of the seat at the piano is important as the arms need to be flat and level with the floor. There should be no tension or bending at the wrists as it will cause friction and that is the cause of all the pain.