Upon those contracts of indemnity which are taken in legal proceedings as security for the performance of an obligation imposed or declared by the tribunals and known as undertakings or recognizances, the sureties are called bail.
N.D.C.C. § 22-02-09