It has been proposed that the million degree temperature of the corona is due to the combined effect of barely-detectable energy releases, so called nanoflares, that occur throughout the solar atmosphere. Alas, the nanoflare density and brightness implied by this hypothesis means that conclusive verification is beyond present observational abilities. Nevertheless, we investigate the plausibility of the nanoflare hypothesis by constructing a magnetohydrodynamic (MHD) model that can derive the energy of a nanoflare from the nature of an ideal kink instability. The set of energy-releasing instabilities is captured by an instability threshold for linear kink modes. Each point on the threshold is associated with a unique energy release and so we can predict a distribution of nanoflare energies. When the linear instability threshold is crossed, the instability enters a nonlinear phase as it is driven by current sheet reconnection. As the ensuing flare erupts and declines, the field transitions to a lower energy state, which is modelled by relaxation theory, i.e., helicity is conserved and the ratio of current to field becomes invariant within the loop. We apply the model so that all the loops within an ensemble achieve instability followed by energy-releasing relaxation. The result is a nanoflare energy distribution. Furthermore, we produce different distributions by varying the loop aspect ratio, the nature of the path to instability taken by each loop and also the level of radial expansion that may accompany loop relaxation. The heating rate obtained is just sufficient for coronal heating. In addition, we also show that kink instability cannot be associated with a critical magnetic twist value for every point along the instability threshold.