Sortases are cysteine transpeptidases, mainly found in Gram-positive bacteria, which either anchor surface proteins to peptidoglycans of the bacterial cell wall envelope or link proteins together to form pili by working alone, or in concert with other enzymes. They do so by catalyzing a transpeptidation reaction in which the surface protein substrate is cleaved at a conserved cell wall sorting signal and covalently linked to peptidoglycan for display on the bacterial surface. Sortases are grouped into different classes based on sequence, membrane topology, genomic positioning, and cleavage site preference. The different classes are called class A to F sortases. Most Gram-positive bacteria contain more than one sortase and it is thought that the different sortases attach different surface protein classes. The typical eight-stranded beta-barrel fold is observed in all known sortases, along with the conserved catalytic triad consisting of cysteine, histidine and arginine residues. Some sortases contain an N-terminal signal peptide only and the C-terminus serves as a membrane anchor, which represents a type I membrane topology, with the N-terminal enzymatic portion projecting towards the bacterial surface and the C-terminal end residing in the cytoplasm. Other sortases adopt a type II membrane topology, with the N-terminal hydrophobic segment inside the cytoplasm and the C-terminal enzymatic portion located across the plasma membrane. The N-terminus either functions as both a signal peptide for secretion and a stop-transfer signal for membrane anchoring. Sortases are also present in some Gram-negative and Archaebacterial species, but the functions of these enzymes are unknown.