Abstract. In the late nineties, Smale proposed a list of problems for the next century and, among these, it was conjectured that for every r ≥ 1 a C r -generic diffeomorphism has trivial centralizer. Our contribution here is to prove the triviality of C r -centralizers on hyperbolic basic sets. In particular, C r -generic transitive Anosov diffeomorphisms have a trivial C 1 -centralizer. These results follow from a more general criterium for expansive homeomorphisms with the gluing orbit property. We also construct a linear Anosov diffeomorphism on T 3 with discrete, non-trivial centralizer and with elements that are not roots. Finally, we prove that all elements in the centralizer of an Anosov diffeomorphism preserve some of its maximal entropy measures, and use this to characterize the centralizer of linear Anosov diffeomorphisms on tori.