Cydia SHSH Server
Before Cydia 1.1, Cydia included a "Make my life easier" option that, if opted into, would automatically save all available SHSH blobs for your device. As of Cydia 1.1, Cydia assumes your life should be made easier, and it saves any available SHSH blobs for your device automatically every time you open Cydia.
Usage on iOS 4.x
To use this process, Cydia's servers must already have saved SHSH blobs on file for your device for the iOS version you want to restore to.
To use the Cydia server to restore to a firmware no longer being signed by Apple (e.g. 4.0.1), add the following line to /etc/hosts (Mac OS X/Linux) or C:\Windows\System32\drivers\etc\hosts (Windows XP+):
Make sure you open your text editor as an administrator. On OS X, you could use sudo, as in
sudo nano /etc/hosts; on Windows you can right click any plain-text editor program such as Notepad and choose "Run as Administrator".
Then go along with the restore process. If the restore fails after "Verifying iPhone restore with Apple" with iTunes error 3194 or something similar, you have not set it up correctly or saurik's server doesn't have your SHSH for that version.
How it works
It uses the hosts file to redirect the Apple firmware server to saurik's. His server has a ECID SHSH database, just like Apple's. When an older firmware request is sent to Apple, it will deny the SHSH request and error out. When it's requested at saurik's, if you've saved it, it finds the SHSH and continues with the restore.
iOS 5 update
This simple replay process no longer works to restore to iOS 5.x. Instead, you have to download your SHSH blobs to your computer, stitch your SHSH blobs into custom firmware, and use that to restore. See the JailbreakQA guide to restoring to iOS 5.x using SHSH blobs.
iOS 6 update
There's an API to list and upload SHSH blobs. No official documentation exists yet, but there are some infos:
API list available blobs on Cydia
To list all available blobs on Cydia server, use this command:
API submit to Cydia
To submit a new blob to Cydia server, use this command: