Well, after struggling for hours and hours to get my iPhone to a jailbroken and unlocked 4.0 I feel like I've learned a lot of information that may help people and I want to share it since so many people helped me on the way.

My situation upon entering the battle: iPhone 3gs 3.1.3 unactivated, old bootrom

If you're in this situation here's how I got to 4.0 jailbroken and unlocked

First of all, get an AT&T sim from someone and you'll be able to activate your phone. All you need to do is put it in and then connect your iphone, everything else is deceivingly simple and automated.

After that, download Spirit to jailbreak 3.1.3. Run spirit and click "jailbreak," when my phone was running spirit it got stuck at this galaxy progress screen and I thought I bricked it but all I had to do was restart the phone by holding the home and power button. After that my phone started up fine after going back to the galaxy screen and then rebooting. Woofta.

Once jailbroken, I downloaded Ultrasn0w from cydia. The repo was already installed so it was pretty self explanatory.

So, on a jailbroken/unlocked 3.1.3 I thought I was stuck until a new JB came out, but not so. I stumbled across this tutorial which showed me how to modify 3.1.3 to allow pwnage tool 4.0 to work. It looks scary and dangerous but it's actually super easy. The part I got confused about was the last step but all I did was download mobile terminal from cydia and run the commands from there. When you restart your phone after completing those steps it will still be working perfectly fine, so don't worry. It's a painless procedure.

After you do that you can restore to a custom firmware from Pwnage tool 4.01. I DON'T recommend downloading a custom ipsw off the Internet because they're often mislabeled. Download the official ipsw from Apple and run Pwnage tool yourself, provided you're on a mac. Also, don't try to restore your custom firmware from DFU mode or normal mode, use recovery mode which is entered by turning off your phone and holding the home button as you plug it in. This worked best for me.

Anyways, I'm on 4.0 JB and Unlocked after doing what people said was impossible. From what I understand, the only people who currently have no way of jailbreaking 4.0 are people with the new bootrom or anyone using a phone running the default Apple 4.0 firmware. Anyone below 4.0 with the old bootrom can jailbreak and unlock 4.0 SOMEHOW. I hope this helped people a little bit. Thanks to everyone who's busting their ***** and figuring this stuff out. Back to multi-tasking!