An order directing an undertaking given for the appearance of a person accused of contempt to be prosecuted, in the discretion of the court, may direct the prosecution thereof by and in the name of any party aggrieved by the misconduct of the accused. In such a case, the plaintiff may recover damages to the extent of the loss or injury sustained by reason of the misconduct, together with the costs and expenses of prosecuting the proceedings in which the warrant was issued, but the recovery may not exceed the sum specified in the undertaking.
N.D.C.C. § 27-10-19