Hi everyone, I usually proceed like this to whiten ivory:
First of all, take all the keys out, then pull out the keyboard frame, fix it to the carpenter's bench, and place a wooden rod along the entire length of the keyboard, between the tips of the white and black keys, high enough to keep the keys upright and resting against the back.
I put only the white keys back in, and place a heavy iron rod at the back to keep them locked in place.
Then, 800-grit sandpaper until they are completely matte.
At this point, I take 35% hydrogen peroxide diluted 50% with water, wipe them with a clean cloth mounted on a stick and moistened with said solution, passing it over all the keys.
Theoretically, one day in the sun while always keeping the keyboard moist—meaning going out to wipe them with the cloth about every 15 minutes—makes them bright white.
Then I go back to the bench, fix them, and use sandpaper again, but this time 1200-grit, insisting a bit more (I also have to erase the grooves from the previous 800).
Once done, I polish the keys with a cotton wheel: first a hard one with fine white abrasive paste, then a softer cotton wheel for the finish, also using white paste but even finer. However, I don't use a drill; it spins too fast and burns the ivory. You need a polisher that runs at 900 RPM.
It takes a lot of patience, but the result is perfect.