46-11-601. Recognizance by or deposition of witness. (1) If the defendant is held to answer after a preliminary examination, after the defendant has waived a preliminary examination, after the district court has granted leave to file an information, or after an indictment has been returned, the judge may:
(a) require any material witness for the state or defendant to enter into a written undertaking to appear at the trial; and
(b) provide for the forfeiture of a sum certain in the event the witness does not appear at the trial.
(2) Any witness who refuses to enter into a written undertaking may be remanded to custody but may not be held longer than is necessary to take the witness's deposition. After the deposition is taken, the witness must be immediately discharged.
(3) The deposition must be taken in the presence of the prosecutor and the defendant and the defendant's counsel unless either the prosecutor or the defendant and the defendant's counsel fail to attend after reasonable notice of the time and place set for taking the deposition.