Any miner or other person doing and performing any work or furnishing any material as specified in section 35-15-01 under a contract, either express or implied, between the owner of any mine or the mine owner's agent, and any contractor working on such mine, whether such work is performed or materials furnished as miner, laborer, or otherwise, whose demand for work so performed or materials so furnished has not been paid, may deliver to the owner of such mine or tunnel or to the owner's agent or superintendent a verified account of the amount in value of the work and labor performed or of the materials furnished and remaining unpaid, and thereupon, the owner or the owner's agent shall retain out of the first subsequent payments to the contractor the amount due for the work and labor or materials furnished for the benefit of the person performing or furnishing the same.
N.D.C.C. § 35-15-02