This writeup was solicited by IWhoSawTheFace, who asked me to consider the question of 'what is the shelf life of a nuclear weapon?' for ScienceQuest 2012.
Disclaimer: I am not a nuclear engineer, nor a weapon designer, nor someone privy to secret procedures or data regarding nuclear weapons. This node is written from the point of view of an analyst who has had to consider the general problems of nuclearization and weaponization and is relying solely on openly available information. There are likely all manner of problems and solutions which I have no idea about, but I will try to lay out the problem space as best I can in an accessible E2 node.
Nuclear weapons are, increasingly, easy to build. Of the myriad of engineering challenges faced by the original inventors at Los Alamos, nearly all of them have been solved by industry or even consumer product design for other purposes and thus solutions are readily available. One example of this is the krytron switch - producing sufficiently fast detonation signals was a major problem for the Manhattan Project, but components producing sufficient power and time precision eventually came available for (among other things) use in photocopiers.
As the components and engineering of the device itself have become easier, counterproliferation has come to rely increasingly on restricting access to a supply of fissile material of sufficient mass and quality. Unlike the other bits of the bomb, the fissile materials are generally not used for anything else, and producing them remains relatively expensive, difficult and hard to hide. Not impossible, of course, but 'hard.'
The ability to build a nuclear device, however, is not the same as the ability to build a nuclear weapon.
A nuclear device is something which will produce the requisite chain reaction and detonation, without any consideration as to its deployment. It might take fifty days to build, weigh eighty tons and be immobile, but if it detonates, it's a nuclear device. Generally, however, such a device wouldn't be of much use as a weapon. The process of turning a nuclear device into a nuclear weapon is called 'weaponization' and comprises all manner of considerations including managing the size of the device, the mass of the device, the fragility of the device and (for our purposes here) the reliability of the device.
The type of weapon will have a profound impact on the difficulty of weaponization and the required effort it will take to maintain it. Straight fission weapons have one set of problems that must be solved. Fusion and fusion-boosted weapons present additional requirements. Let's start out looking at a simple fission weapon, as it is not only the easiest to produce, but in fact is a prerequisite for building the others.
There are a number of different general components that are required to build a fission weapon. Each present different challenges for endurance and maintenance. Very broadly, here are some of those components which can be expected to cause trouble.
Explosives. To detonate a nuclear weapon requires some amount - measured in kilograms - of chemical high explosive. When used in nuclear weapons, this explosive must perform to higher than normal specificiations. It is not enough for it to simply detonate, as it might be in a 'conventional' weapon. In the latter case, the user just cares that an energetic enough explosion to cause some minimum level of damage is produced. In the case of the nuclear weapon, the timing and power of these high explosive pieces must both meet very stringent requirements - not just minimums, but particular values. If one piece of HE detonates faster than others, or produces a detonation which differs in power in either direction outside its tolerances, the nuclear detonation can be severely compromised or even prevented.
High explosives are mixtures of chemicals. There are the primary explosives, perhaps oxidizers as well (although usually high explosives do not require a separate oxidizer). Most also incorporate inert additives called binders which are used to produce a substance of a particular mechanical characteristic. All of these compounds are subject to possible physical and chemical changes over time. They may also separate physically as well, causing problems.
Testing high explosives is easy and a mature science with reams of available data, and can be done without any connection to a nuclear program. Furthermore, industry worldwide has a great deal of experience building high explosive based weapons which require long shelf lives. However, most conventional weapons deal with high explosive aging by simply requiring disposal and replacement. In the nuclear weapon case, this is not typically feasible. Although very stable explosives can be made, if the weapon does not have provisions for removal and potential replacement of the explosives components its reliability will decrease over time. Even if it does provide for this maintenance, care must be taken to produce exact duplicates of the explosive components, both in shape and composition - as the physics of the detonation will be affected by both, and any change from the weapon design spec will likely make such a detonation smaller or prevent it entirely.
The Physics Package. In US nuclear weapons, the actual component which produces the atomic detonation is called the 'physics package.' This includes the fissile materials, the initiator if present, and may include the high explosives as well depending on how the weapon is constructed. The explosives we have dealt with. The other components, the fissile materials and the initiator, present separate problems.
In our notional fission weapon, the fissile core (sometimes called the 'pit', a fruit reference) is in all likelhood built of one of two elements - Highly-Enriched Uranium (HEU) or plutonium. In either case, there are considerations for maintenance. Both of these materials, if pure, will suffer from oxidation which will change their chemical makeup and, in turn, their physical shape - which will affect the detonation physics. In addition, unless isolated, they may react with substances in the high explosives or whatever brackets or forms they are held in, with the same potential problems.
In the case of plutonium, if there is any water moisture in the surrounding air (even if there is no oxygen) the metal will form plutonium oxide (PuO2) on its surface, which is a powder. This is worse than it sounds; when this oxide is present, the plutonium is pyrophoric - which means it is subject to spontaneous ignition (oxidation burning, not fissile) when exposed to air. This means that the usual means of mitigating oxidation, namely keeping it in an inert gas such as argon, must be done carefully - even those inert gases must be kept dehumidified.
One means of minimizing this is to ensure that the weapon core is maintained in a vacuum - but that produces a whole new set of engineering challenges, especially if the weapon must be maintained for a long period or if it requires periodic maintenance or checks.
The fissile core itself will produce heat from normal radioactive decay. A plutonium core, made of Pu-239 (the most common fissile isotope used in weapons) will produce around 1.9 Watts per kilogram of material just from regular decay. While this isn't much, if the core is sealed inside a weapon casing, this heat will build up over time. Temperatures inside the core therefore cannot be counted upon to remain at STP even before considering the storage environment of the weapon itself.
The Electronics. In order to detonate, the weapon will require fuzing, arming and detonation signal. Generally, most of these requirements are provided for these days by electronic components, not counting any physical safeties the weapon design may contain. For example, the weapon may have provisions for inserting physical separators between the detonators and the high explosives, or (in the case of gun-type weapons) in between the two subcritical core masses themselves.
Any electronics in the weapon must be hardened to resist (or at least tested for resistance to) neutron flux, as the weapon core will be putting out constant low-level radiation. Consumer electronics will likely be insufficient. Industrially-shielded electronics will be a better bet, but even then, these components will require testing in a simulated weapon in order to determine their likely reliability.
These are just a few of the problems with designing and maintaining nuclear weapons. There are some tradeoffs that can be made in order to mitigate some of them.
For example, if the physics package is stored separately from the weapon itself, the weapon's systems (electronics, structure) will exist in a much less demanding environment and will remain reliable for longer. It will be easier to test the weapon's systems without the physics package present, and working on it to replace components will be simple. However, this means that the weapon will not be usable without a non-trivial arming process where the physics package is mated with the weapon. This will make deterrence more difficult, as there is a guaranteed vulnerability window before the weapon can be used to respond and there is a higher required complexity to be overcome before it can be used.
Going a step further, the high explosives might be stored separately from the pit and the weapon. This would again simplify the environment each existed in. However, unless the high explosives could be packaged into a relatively durable container, which would significantly complicate the weapon design problem, this might not be feasible as high explosives are generally very fragile and ductile, and the process of removing, storing or restoring them to the weapon would likely deform them enough to prevent proper detonation. Plus, safely storing weapon pits separate from weapons has been a challenge even for the U.S. DOE, as GAO reports indicate.
As a result of these tradeoffs, probably the 'best' way to handle weapon maintenance is to maintain a stockpile of weapons large enough that they can be rotated 'off alert' for maintenance on a regular basis. However, for new nuclear powers which are constrained by their stocks of fissile material, this may not be an option. Therefore, when a new nuclear power produces a nuclear weapon, it must be kept firmly in mind that this weapon has a built-in but unknown expiry date - and that simply maintaining things as the status quo will therefore not be easy. That weapon's reliability will drop over time, which means the strategic situation vis-a-vis that weapon's existence will change - and it will do so unpredictably and, in fact, unverifiably, which is the most dangerous situation possible.
The problem is compounded by the difficulties of live nuclear testing. Although secretly preparing for a test is demonstrably possible, it is extremely difficult to hide the fact of a successful (or even partially successful) one. The U.S. is spending vast sums of money taking its many years of atmospheric and underground testing data and doing computer modeling of its weapon designs, as well as testing weapon components in every means short of actual detonation, via a program called the Stockpile Stewardship and Management Program. It is as yet unknown if this 'simulated' testing is enough - which means a new nuclear power likely will not have the money or the data to attempt to undertake a similar project. This program costs the U.S. approximately $4 billion per year. As a consequence, if a nation manages to produce a single or very few nuclear weapons, it may actually be in everyone's best interest to allow the production of enough weapons to provide for regular maintenance, or at least for the transfer of information related to the safe maintenance and care of nuclear weapons.
Fusion and fusion-boosted weapons present entirely new levels of maintenance requirements, ranging from the containment and refurbishment of gaseous components (tritium boosting) through the presence and maintenance of yet another chemical compound (lithium deuteride) to the hardening and increased brittleness of neutron reflectors (also known as rad cases) made from uranium alloys.
What about the actual title of this node? What, in fact, is the shelf life of a nuclear weapon? I hope I've shown in some small way that that's a very difficult question to answer, and that it's impossible without knowing a great deal about the particular weapon you're discussing. Here are some examples from open sources that might help. The U.S. spent roughly $8 trillion on nuclear weapons engineering up through 1996. By the end of that period, the U.S. did indeed have some very long-lived warheads - but we don't know what their regular maintenance schedule was or is with any precision. For example, the W80 warhead, used mostly in cruise missiles, was first built in 1981. As of 2006-2008, those weapons were undergoing major overhauls for 'life extension' - as far as I can tell, the Mod 0 and Mod 1 versions of those weapons (the former built for sea-launched cruise missiles, the latter for air-launched) were each going to be rebuilt into the Mod 3 and Mod 4. That would tell us that the active useful life of those warheads is approximately 25 years. That should not, however, be confused with the shelf life - these weapons are in the custody of the most well-financed military organization in the world, and are under constant care and monitoring. Unlike their strategic (ICBM) purposed cousins, these warheads are kept in arsenals, where they can be easily maintained, save for short stretches where they are deployed.
The warheads atop U.S. missiles are designed to be kept 'on alert' with minimal disruption for service. There are a number of different warhead types in use, but most seem to have been produced after 1978 or so, with life extension programs or dismantling occurring approximately 25-30 years later. These warheads do receive maintenance over their lifespan, but it's more difficult to determine from open sources how often they must be serviced and what is being done.
The point is that these are pretty much 'the state of the art' in terms of operational nuclear weaponization. Furthermore, their designers had the advantage of (at the time) approximately 35 years of nuclear engineering and testing to give them guidance on the performance of various techniques and designs over time. The builders of new weapons, in new nuclear states, will likely not have access to that body of institutional knowledge - and even if they have some of it available to them, they will have difficulty trusting the outcome without testing of the weapon design.
The originally deployed U.S. atomic bombs such as the Mark 4 - a modification of the wartime 'Fat Man' device intended to 'GI proof' the design and make it usable by military personnel rather than requiring assembly and monitoring by its inventors - was only in use for a few years before being superseded. It, however, was designed to have the fissile core 'pit' stored outside the weapon and, in fact, only inserted into the weapon while in flight as a 'final arming step.' This indicates that a 'new design' weapon would realistically probably be able to last at least a handful of years, and allow for the removal of the core or entire physics package for storage and maintenance. Given that, a 'design life' of 5 to 10 years is reasonable, although how much of that time the weapon could spend 'armed' is uncertain, as is the maximum time it could remain in an 'armed' state before degrading or suffering severe risk of failure. Time periods on the order of days or weeks would likely be enough to cause some uncertainty as to its function and yield if detonated, unless the builders had done extensive testing with the final weapon design to include test firings after various arming times. This would be unlikely.
Some additional reading:
USAF general nuclear weapons maintenance procedures - if you want to know how complex a task this can actually be, courtesy of the Federation of American Scientists
Los Alamos National Laboratory - an article touching on just a few of these issues
The Department of Energy - an article about the ongoing issues of maintaining a nuclear stockpile without nuclear testing