At a sale under such foreclosure the comptroller shall require the purchaser to pay, at the time of the sale, the costs and expenses thereof, and at least one-fourth of the amount so unpaid; and for securing the remainder of the moneys due the state, on the execution of a deed or of the affidavits of sale to the purchaser, he may accept from the purchaser a bond and mortgage to the state on the premises sold, payable in six equal annual instalments, with annual interest at six per centum. If the mortgaged premises sell for a greater sum than the amount so unpaid and the costs and expenses of the sale, the comptroller shall also require the purchaser at the time of the sale to make payment of such surplus. The expense incurred by the attorney-general in any action or proceeding for the foreclosure of any such mortgage, shall be paid to him out of the treasury.
N.Y. State Fin. Law § 152