That didn't take long. Just one day after iOS 4 was officially released from Apple, the iPhone Dev-Team has already released a hack to jailbreak and unlock iPhones using the software.
There are a few important caveats with the latest release. PwnageTool 4.01 will work fine with an iPhone 3GS as long as it was previously jailbroken with the old boot ROM and you didn't use the Spirit method. However, if your 3GS has the new boot ROM, you will not be able to use PwnageTool.
A previously jailbroken iPhone 3G should be fine with the new PwnageTool, as well, if you didn't use Spirit.
The new hacks only support the official iOS 4 release and not the developer release issued at WWDC.
The Dev-Team said that currently the iPhone 2G, iPod Touch, and iPod Touch 3G are not supported by their software. They are working on ways to fix this for future releases.
Baseband unlockers--the method that allows you to use an iPhone on carriers other than AT&T--are reportedly working for all basebands from 04.26.08 and up. The unlockers currently support the iPhone 3G and 3GS.
If you plan to jailbreak or unlock your iPhone, you should read the instruction pages on the iPhone Dev-Team's Web site very carefully and be aware of what you are doing.