Google "iPhone Dev" and read.
note: if you are considering an unlock, you should STOP upgrading your phone until given the all clear by the iPhone Dev crowd. Certain upgrades from Apple are specifically designed to defeat the unlock/jailbreaking procedures that are in use.
Before you unlock your Iphone, make sure you use Itune to backup all you personal data, just in case something goes awry. Like penguin said, after the unlocked, don't upgrade your Iphone's OS, it will lock it again.
Dev team have cracked the new 4 OS already.
Posted via Mobile Device
Apple's iOS 4 already hacked | Apple - CNET News
and the directions (which should be read very carefully)
Dev-Team Blog - foursome news
I have an Estonian iPhone 3GS which kept freezing, so a couple of days ago put it in recovery mode and restored it. However, it had restored to iOS4 instead of my previous jailbroken 3.1.2 - and as far as I am aware there isn't a simple unlock for 3GS phones for iOS4. I am also having real trouble downgrading the software to 3.1.2, so have given up. Can anyone recommend a place in/close to CWB that will be able to unlock my iPhone for me?