Unlocking and Jailbreaking an iPhone
There is a difference between unlocking and jailbreaking an iPhone. To unlock an iPhone means to free it of restrictions that limit the carrier network that can be used for service. In simple terms, on an unlocked iPhone you can change the carrier that provides talk, text (SMS) and data coverage simply by swapping the subscriber identity module (SIM). When you jailbreak an iPhone, you can install and remove software on the iPhone operating system (iOS) outside of Apple's iTunes store system. Unlocking is a way of changing your mobile provider, while jailbreaking is a way to change the software on the iPhone. You can unlock an iPhone without jailbreaking it, and you can jailbreak an iPhone without unlocking it. In instances, such as on AT&T where there is no supported carrier unlock, it may be necessary to jailbreak your iPhone in order to unlock it.
Apple’s White List
Apple maintains an internal database of unlocked iPhones by IMEI, which is consulted when you update an unlocked iPhone within iTunes. Mobile regulations vary widely from one country to the next. Some jurisdictions dictate that the iPhone must be offered unlocked initially or subsequent to the end of any contract. Consult Apple's list or your mobile carrier to determine whether you can officially unlock your iPhone. The advantage of an authorized unlock is that your iPhone will permanently be unlocked and you will be able to update through iTunes immediately upon every new iOS update.
In Canada for example, Rogers / Fido made news in December 2010 when they offered an official carrier unlock for iPhones. You must have an account in good standing, have fully paid the unsubsidized cost of your phone or run out your contract, and you will need to pay a $50 unlocking fee plus taxes, among other requirements. Consult your carrier for the exact requirements in your area.
There are also unofficial carrier unlock services offered through allGSMunlock. It appears that they spoof the carrier unlock transaction to Apple, allowing you to place your phone on Apple's white list. The allGSMunlock list of supported carriers is updated from time to time. Check on their forums to determine whether your carrier is supported. At the time of this article, operator support was limited to: Movistar Spain, O2 United Kingdom, Orange France, Orange Poland and T-Mobile Netherlands.
The most common option to unofficially unlock your iPhone, ultrasn0w is provided by the iPhone Dev Team, a loose affiliation of hackers devoted to jailbreaking and unlocking iOS devices. The Dev Team offered the original unlock of first-generation iPhones and they maintain regular updates to their tools and methods with each new device and release of iOS. They are engaged in a cat and mouse game with Apple, and every new generation of hardware requires a new set of hacks to jailbreak.
Always consult the Dev Team blog for the most recent methods and software available to jailbreak and unlock your iPhone. One of the most important caveats when using any of the unofficial methods to unlock your iPhone is to proceed with caution on iOS upgrades. Never upgrade your iPhone through iTunes after it has been unlocked or jailbroken. You could lose your changes and render the device permanently inoperable. Always wait for the Dev Team to announce a supported method to upgrade to the latest version of iOS.
The current procedure to unlock an iPhone using ultrasn0w is to first jailbreak the device using either redsn0w (Windows and OS X) or PwnageTool (OS X only). You must match the firmware, or baseband, in your device with the latest available method. Once you have jailbroken your iPhone and installed Cydia, you can download and install ultrasn0w to unlock it.
TinyUmbrella is an unofficial method to upgrade your iPhone while still keeping it unlocked. TinyUmbrella has been written in cross-platform Java by the Chronic Dev Team member semaphore. It is designed to fool Apple's iTunes into allowing the baseband on your iPhone to be backed up and restored without upgrading the firmware.
TinyUmbrella is not an actual unlock method itself. It is useful if a device has already been unlocked, primarily as a means to upgrade to the latest version of iOS while still preserving the unlocked state. Most of the jailbreak methods used on iPhones are designed to exploit either operating system or hardware device driver bugs. For example, the JailBreakMe exploit was introduced soon after iOS 4.0 and used a security hole in one of the PDF fonts. Apple quickly patched it in iOS 4.0.2. More recently, the Limera1n jailbreak method was derived from a boot ROM exploit. Apple has since issued a baseband firmware update to prevent future use of this on any phone which has been updated.
When you update your device through iTunes, you run the risk of closing off unlock access you had gained previously through a baseband exploit. The TinyUmbrella method allows you to backup and restore your baseband, preventing iTunes from updating it, and allowing you to update iOS on your device yet still jailbreak and unlock it again after the upgrade.
For more information check out How to Jailbreak and Unlock 4.2.1 Firmware on iPhone 3G, 3GS and iPhone 4.