http://www.redmondpie.com/how-to-jailbreak-ios-4.0-with-pwnagetool/Its here! This is what you all have been waiting for!! Ultrasn0w 0.93 has been released to unlock all iPhones on the latest 05.13.04 (on iOS 4) and 05.12.08 (on 3.1.3) basebands. The guide for unlocking is exactly the same as posted here, except for the Cydia repo which this time is: repo666.ultrasn0w.com. Follow that one until we update the post here! Stay tuned for more!
Oh and guide for jailbreaking iPhone 3G for iOS 4 can be found here, and for iPhone 3GS with iOS 4 can be found here.