On sharp inequalities on nilpotent Lie groups