In civil cases arising in justices' courts wherein an undertaking is required by this chapter, the plaintiff or defendant may deposit with said justice a sum of money equal to the amount required by said undertaking, which said sum of money shall be taken as security in place of said undertaking.
§ 25-31-115, MCA