Jailbroken iPhone 3G, iPhone 3GS, and iPhone 4 on iOS 4.0 can now be unlocked using The Dev-Team's ultrasn0w version 0.93. Ultrasn0w allows your iPhone to be used on any GSM carrier (like T-Mobile).
Ultrasn0w is compatible with basebands 04.26.08, 05.11.07, 05.12.01, and 05.13.04.
Aditional info on the unlock can be found on The Dev-Team ultrasn0w site: http://blog.iphone-dev.org/post/128573459/ultras-now
1. Make sure your iPhone is jailbroken and on frimware 4.0. (How do I do that?) Then connect to a Wi-Fi network and open Cydia.
2. Tap on the Manage tab.
3. Tap on Sources.
4. Tap on Edit, then Add.
5. Type in http://repo666.ultrasn0w.com. Then, tap Add Source and wait for the source to be added.
6. Now tap on the Search tab and type in ultrasn0w, tap on it, tap Install, then Confirm.
7. Wait for ultrasn0w to be installed. Once it's done, press the Reboot Device button.
8. Once it's done, you device will be unlocked and ready for use on carriers like T-Mobile.