So i'm going to buy a 3GS for my sister for xmas. It's on firmware 3.1.2. What 4.x firmware can i update too that is safe to jailbreak and unlock? Thanks.
You need 4.1 SHSHs to restore to a custom fw. Either check your SHSHs and see if you've got 4.1 or create a custom firmware for 4.2.1 with PwnageTool. If you don't have a Mac, you'll have to find the custom fw online.
Note, if it is a new boot device, and you don't have SHSHs, you'll be forced to 4.2.1 and have a tethered jb. Read this here and it will tell you how to figure out if you've got SHSHs and which bootrom you have.