The m7GpppN cap structure of eukaryotic mRNA is formed cotranscriptionally by the sequential action of three enzymes: RNA triphosphatase, RNA guanylyltransferase, and RNA (guanine-7)-methyltransferase. A multifunctional polypeptide containing all three active sites is encoded by vaccinia virus. In contrast, fungi and Chlorella virus encode monofunctional guanylyltransferase polypeptides that lack triphosphatase and methyltransferase activities. Transguanylylation is a two-stage reaction involving a covalent enzyme-GMP intermediate. The active site is composed of six protein motifs that are conserved in order and spacing among yeast and DNA virus capping enzymes. We performed a structure-function analysis of the six motifs by targeted mutagenesis of Ceg1, the Saccharomyces cerevisiae guanylyltransferase. Essential acidic, basic, and aromatic functional groups were identified. The structural basis for covalent catalysis was illuminated by comparing the mutational results with the crystal structure of the Chlorella virus capping enzyme. The results also allowed us to identify the capping enzyme of Caenorhabditis elegans. The 573-amino acid nematode protein consists of a C-terminal guanylyltransferase domain, which is homologous to Ceg1 and is strictly conserved with respect to all 16 amino acids that are essential for Ceg1 function, and an N-terminal phosphatase domain that bears no resemblance to the vaccinia triphosphatase domain but, instead, has strong similarity to the superfamily of protein phosphatases that act via a covalent phosphocysteine intermediate.