  The reduction in system inertia is creating an important market for
frequency-containment Ancillary Services (AS) such as enhanced frequency
response (e.g.,~provided by battery storage), traditional primary frequency
response and inertia itself. This market presents an important difference with
the energy-only market: while the need for energy production is driven by the
demand from consumers, frequency-containment AS are procured because of the
need to deal with the largest generation/demand loss in the system (or smaller
losses that could potentially compromise frequency stability). Thus, a question
that arises is: who should pay for frequency-containment AS? In this work, we
propose a cost-allocation methodology based on the nucleolus concept, in order
to distribute the total payments for frequency-containment AS among all
generators or loads that create the need for these services. It is shown that
this method complies with necessary properties for the AS market, such as
avoidance of cross-subsidies and maintaining players in this cooperative game.
Finally, we demonstrate its practical applicability through a case study for
the Great Britain power system, while comparing its performance with two
alternative mechanisms, namely proportional and Shapley value cost allocation.
