  We give an algebraic criterion for a nilpotent real Lie algebra and prove
that it provides a necessary and sufficient condition for the associated
nilpotent Lie group to admit left-invariant Ricci solitons, called nilsolitons.
As an application of this result, we generalise Nikolayevsky's criterion for
the existence of nilsolitons to nilpotent Lie algebras without nice bases. We
further prove a modified version of the Taketomi--Tamaru conjecture for
nilpotent Lie groups which gives an obstruction to the existence of
nilsolitons.
