Warp rightfully pointed out the privacy issues of Gravatar and demonstrated how easy it is to exploit them. So is it all wrong? Certainly not. Gravatar serves a purpose − warp would certainly agree, after all he uses it himself. The problem is that sites using it don't give you a choice whether to use it or not − and when commenting on blogs you often only see afterwards what happened and they require you to enter your email address so there is no way out.
But the problem can be tackled from another side as well. Gravatar could have done much better. Let's first look at the problem they're actually trying to solve.
It's the data portability / online identity problem. Many people only want to enter their information once, not for every website. Avatars are one part of that. You upload your avatar to Gravatar once and after that you don't have to do anything but use the same email address everywhere, the rest happens automagically. OpenID tries to solve a similar problem with its Attribute Exchange specification: when you log in with your OpenID the relying party can request information about you from your identity provider. And FOAF is all about that as well. Using the FOAF+SSL protocol you can log in to a Web site with your WebID and the Web site can lookup all sorts of information about you from your FOAF file. Such a file can also contain a link to an avatar.
But the problem with this is that avatars are a design element for Web sites, they can't just display every random image users point them to − they could be of arbitrary dimension and file size. Sure they could shrink them with HTML but they still would have no control over the pageload they impose on their visitors. Downloading the image and cropping it would mean every blog would have to store pictures of every commenter. And the commenter would have no control over how the image gets cropped. Thus the need for a service like Gravatar where you know what you get.
Then there's the problem of choice. Other people don't want to have Gravatars at all and they don't want any identifying information about them published. This is a big problem about OpenID people don't realise by the way. You don't publish your commenter's email address for two reasons: first so they don't get spammed and second so they can't get identified. If you let people comment on your blog with their OpenID and without their email address then the spam problem is gone, OpenIDs can't get spammed. Yet blogs still happily publish the commenter's OpenIDs and thus their identity.
So what would Gravatar done right look like? Every Web site that wants to display avatars would have to sign up with the imaginary Gravatar alternative service. They would enter their domain name and the avatar service would generate a key for them, a shared secret between the site and the avatar service. Now when the site generates the URIs for the avatar images they don't only hash the user's email address but also encrypt it with the key they got (this encryption has to have a certain guarantee of uniqueness and has to be reversible). A browser loading the site would look up this image at the avatar service. This service then has to relate the string in the URI back to the user. A naive approach would be to try every combination of user email address they have and key of a site that registered with them. The number of those combinations is huge though: with 1,000,000 users on the avatar service and 100,000 registered sites you already have 100,000,000,000 combinations to try out (in the worst case). Therefore the avatar service needs to know which Web site this came from so they can use the key they have for that Web site and decrypt the string − after that it's a simple lookup of the hash like Gravatar does it. The information about the origin could either be taken from the Referer HTTP header (but some users turn sending it off in their browsers and it would also not allow hotlinking of the avatar images) or it could be a parameter in the image URI.
What did we gain now? Simple: the URIs for the images are now different for every Web site and thus can't be used for identity smushing anymore (as long as the Web site keeps their key secret), yet you still get the same image for every user that signed up with the avatar service on every Web site. The uploaded images themselves are still relatively unique and can be used for comparing identities but that is the choice of the user who uploaded it (the alternative service would have to make the risks clear to their users). On the other hand if you don't upload an image to the avatar service it would return a generic image which isn't unique.
Of course the images Gravatar returns when it doesn't find an avatar are not always generic. Web sites can ask it to generate an image for the hash then, an identicon or a monsterid. Those are unique then. The alternative service could do the same but it would have to generate the image based on the original encrypted string, not for the email hash that was decrypted from that. The generated image would then be unique for every Web site but you would have a different image on different Web sites. I think that's more interesting anyway. ;-)
There's another problem: distribution. Gravatar is a centralised service and Web sites using it rely on it being the only one so that they get as many hits for their "avatar requests" as possible because everyone registers there instead of somewhere else. If there was to be an alternative service why would Web sites use it over another and still be sure to get many hits? The solution is for the users to tell the Web site which service they prefer. Discovering this user preference would have to be part of an authentication protocol like in OpenID Attribute Exchange or FOAF+SSL − it can't be done based on email addresses anymore.
Apart from that the Web site would have to be registered with that service and know how it works. This could be solved with a common protocol where Web sites can register with an avatar service on the fly (or the service just generates the key for a Web site based on the Web site's domain name so there is no need for registering). The Web site could also ask for the image URIs via this protocol, then there is no need for giving the Web site a key at all (and it would be RESTful) or the protocol specification would tell the Web site how to construct image URIs for any avatar service using it.
This is a complicated matter. Will Web sites do requests on avatar services just for getting image URIs? If not then you rely on constructing URIs and once you defined and deployed a URI structure you have to live with it indefinitely because there is no communication between the Web site and the avatar service and thus no protocol you could version. But this is no different for Gravatar at the moment.
In summary avatar services are a convenience feature and you can improve on Gravatar's concept quite easily. If you want to do it really right then it can get quite complicated and the costs would exceed the benefits. But I still think it's worth a try − and the idea is to move away from using email for authentication anyway. OpenID and FOAF+SSL open up interesting possibilities which can be exploited for the purpose of looking up avatars as well.
