MuscleNerd just released redsn0w 0.9.5 beta - the first public jailbreak of iPhone OS 4. This utility is only for developers of jailbroken apps, so they can update apps for firmware 4.0. The jailbreak only supports the iPhone 3G and runs on MAC OS X. There is no carrier unlock right now.
You can download RedSn0w 0.9.5 and get more info here.