A new chemical model is presented for the carbon-rich circumstellar envelope of the AGB star IRC+10216. The model includes shells of matter with densities that are enhanced relative to the surrounding circumstellar medium. The chemical model uses an updated reaction network including reactions from the RATE06 database and a more detailed anion chemistry. In particular, new mechanisms are considered for the formation of CN-, C3N- and C2H-, and for the reactions of hydrocarbon anions with atomic nitrogen and with the most abundant cations in the circumstellar envelope. New reactions involving H- are included which result in the production of significant amounts of C2H- and CN- in the inner envelope. The calculated radial molecular abundance profiles for the hydrocarbons C2H, C4H and C6H and the cyanopolyynes HC3N and HC5N show narrow peaks which are in better agreement with observations than previous models. Thus, the narrow rings observed in molecular microwave emission surrounding IRC+10216 are interpreted as arising in regions of the envelope where the gas and dust densities are greater than the surrounding circumstellar medium. Our models show that CN- and C2H- may be detectable in IRC+10216 despite the very low theorised radiative electron attachment rates of their parent neutral species. We also show that magnesium isocyanide (MgNC) can be formed in the outer envelope through radiative association involving Mg+ and the cyanopolyyne species.