All the pecuniary forfeitures under this chapter shall inure to the use of the party for whose benefit the writ of habeas corpus issued, and shall be sued for and recovered with costs, in the name of the state, by any person aggrieved.
N.D.C.C. § 32-22-41