Update: Download iOS 4.0 Final
During the WWDC 2010 keynote, Steve Jobs announced that the GM (Golden Master) candidate version of iPhone OS 4.0 (now renamed as iOS 4) for developers will be made available soon. Now, the iOS 4.0 GM candidate, along with SDK for iPhone 3G, iPhone 3GS and iPod touch 2G/3G is available for download on the Apple website.
iOS 4 is fully supported on iPhone 3GS and iPod touch 3rd gen. And, for iPhone 3G and iPod touch 2nd gen, they will run many things, but not multitasking.
However, this GM candidate release is only for members enrolled in the iPhone Developer Standard or Enterprise program and only they can access the bits right now, while the public will get the Final version of iOS 4 via the latest version of iTunes on June 21st.
It was just a matter of time and we already see the leaked versions of iOS 4 Golden Master candidate floating around the web. InstantlyiPhone has listed the leaked version of iOS 4 for all iDevices
iPhone 3G :- iPhone1,2_4.0_8A293_Restore.ipsw
iPhone 3GS :- iPhone2,1_4.0_8A293_Restore.ipsw
iPod Touch 2G :- iPod2,1_4.0_8A293_Restore.ipsw
iPod Touch 3G :- iPod3,1_4.0_8A293_Restore.ipsw
Download iOS 4.0
As always I repeat that the UDID of your iPhone/iPod Touch needs to be registered with a developer account at Apple in order to activate iPhone OS 4.0. In case you are looking to jailbreak or unlock your iDevice, you should rather wait for the jailbreaking/unlocking tools before upgrading to any version of iOS 4.
Update: Guide to Jailbreak iOS 4.0 is here. make sure you read the warning within the post before proceeding.