If you have an iPhone locked to a carrier just go to the carrier and have them unlock it for you. You can do this over the web too. I unlocked my 3GS (with 4.0) by going to o2 webpage and requesting unlock. It was done within 6 hours. Now I don't have to worry about jailbreak or the 4.1 that fries your iPhone warranty if it detects your phone has been jailbroken. Just a tip I found out after 1 year of faffing about JB my 3GS.