Progress toward electricity market deregulation has brought controversy over whether or not utilities are entitled to compensation for "stranded costs," i.e., costs utilities will not be able to recover due to the advent of competition in their markets. This paper uses a legal and economic analysis of contracts to address the desirability of utility cost recovery. First, underlying principles of law are reviewed to determine whether or not there is a legal presumption of recovery. Then, the analysis considers whether or not an implicit "regulatory compact" between utilities and regulators follows from principles in the economic analysis of law, particularly theories of efficient breach and implicit contracts. The paper concludes that recovery should occur in only a proscribed set of circumstances and that, when called for, compensation should be partial, rather than full.