Unlocking IPhone 3g is free of cost. Just follow these simple steps
CHECK FIRMWARE
In order to unlock your IPhone 3g you need to have a firmware: 2.2 and a Modem 02.28.00. To check for this go to settings>>general>>about.
UPGRADE FIRMWARE
If you have a firmware: 2.2 and a Modem 02.28.00 go straight to jailbreaking. If not, connect your phone to ITunes and restore (you cannot use the update option because that option has is not available for firmware 2.2). When your phone is restored it will erase everything on it.
JAILBREAK
In order to jailbreak your phone with firmware 2.2 you need to download quickPWN 2.2. Use quickPWN with the pwn file for firmware 2.2. Make sure you select Cydia when jailbreaking.
FINISHING TOUCH
Open Cydia>>Manage>>Sources then add this source http://apt9.yellowsn0w.com. Please not that it is a zero in the snow and not an o. After this you need to install the yellowsn0w application to your phone. To find it go to search and type yelloesn0w. after installation restart the phone with your new Sim inside. At the start up screen wait for your phone to find your carrier. while waiting you should see searching...
After 60 seconds you should be connected. If not go to settings and turn on airplane mode and turn it off. If that does not work start from the top to ensure you followed all procedures.