The defendant United Engineering and Contracting Company, on or about Hovember 27, 1908, entered into a contract known as Contract Ho. 40, Section 10, with the people of the State of Hew York, for the improvement of the Erie canal from Lockport to Sulphur Springs guard lock, a distance of four and eighty-four hundredths miles, for the sum of $2,166,298.
The defendant Rochester Construction Company, on or about July 17, 1909, entered into a subcontract with defendant United Engineering and Contracting Company, whereby *543the Rochester company undertook to do the excavation, channeling and embankment work required by the principal contract, between stations Ros. 5926 and 5952, extending a distance of 2,600 feet west from Hitchens Bridge.
The Rochester company entered upon the performance of the subcontract, and prosecuted the same until on or about February 5, 1910, when it ceased work thereunder and abandoned same.
On February 7, 1910, the plaintiff Upson verified a notice-of lien in the sum of $503.40 and interest, for coal furnished the Rochester company on its subcontract, and filed same in the office of the Superintendent of Public Works, the State Engineer and Surveyor and the Comptroller, on February 9, 1910.
On February 8, 1910, plaintiff McGrath verified a notice of lien in the sum of $858.23 and interest, for lumber and timber furnished the Rochester company on its subcontract, and filed same in said last above named offices on February 9, 1910.
Various defendants filed liens at the times, in the amounts, for services and materials furnished the Rochester company on the subcontract, as follows:
*544The claims of Dussault Foundry Works and Kugler ■Brothers were paid subsequently to the commencement of this action.
The United company, pursuant to section 21 of the Lien Law, subdivision 4, deposited with the Comptroller the following amounts, on the following dates, on the following liens, to obtain discharge of the same, viz.:
And gave undertakings, with the United States Fidelity and Guaranty Company as surety, to secure discharge of the following liens, pursuant to section 21 of the Lien Law, subdivision 5:
The other material facts are hereinafter stated and are not in dispute.
The right of laborers and material-men to liens for the improvement of real property is regulated by the terms of the contract, and whether any fund exists -to which the liens attach is dependent upon its provisions. Larkin v. McMullen, 120 N. Y. 206.
All persons furnishing labor or materials to the sub*545contractor under a contract for a public improvement have a right to inspect the subcontract and are chargeable with notice of its contents and with knowledge of their rights thereunder as against the claim of the contractor.
But it is contended, on the outset, that there is a distinction between liens for the improvement of real property under section 4 of the Lien Law and liens for public improvements under section 5 of the Lien Law, and that the lienors herein have a lien on -the funds due the principal contractor from the State regardless of whether any moneys are due from the contractor to the subcontractor.
Section 5 of the Lien Law reads as follows:
“ § 5. Liens under contracts for public improvements. A person performing labor for or furnishing materials to a contractor, his sub-contractor or legal representative, for the construction of a public improvement pursuant to a contract by such contractor with the state or a municipal corporation, shall have a lien for the principal and interest of the value or agreed price of such labor or materials upon the moneys of the state or of such corporation applicable to the construction of such improvement, to the extent of the amount due or to become due on such contract, upon filing a notice of lien as prescribed in this article.”
One contract .alone is mentioned in the section and that is the contract “ by such contractor with the state.” If the language is taken literally, the lien attaches to the amount due on that contract in favor of a person performing labor for or furnishing materials to a subcontractor. It would follow that the contractor who had paid his subcontractor in full might also be compelled to satisfy subsequent liens filed by the subcontractor’s laborers, and material-men.
The power of the Legislature to provide for a direct mechanic’s lien, independent of the indebtedness between owner and contractor, or between contractor and subcontractor, has been seriously questioned, although generally upheld. Jones v. Hotel Co., 86 Fed. Rep. 310; reversed on other grounds, 111 U. S. 449. See same case, 116 Fed. Rep. 793. Under the Lien Law in force in New York, it has, however, been uniformly held that the right to a lien is dependent upon *546something being dne or becoming due to the contractor or furnished under his contract.
The rule is well stated by Grover, J., as follows: “A party furnishing materials or doing work, relying upon the lien given by statute for security, must examine the contract'with the owner; for it is only to the extent of what is due or to become due upon this contract that his lien can attach. If he furnishes the material or does the work for a sub-contractor, in like reliance, he should not only examine the contract with the owner, but also that of the sub-contractor; for if the sub-contractor fails to perform his contract so that nothing becomes payable thereon, or is paid in full according to its terms in case of performance, -there can be no lien. * * * There is no reason for protecting an owner against a lien who has paid the contractor in full pursuant to the contract, not equally applicable to a contractor, who in like manner has paid his sub-contractor. It would be equally unjust to compel a contractor to pay again through the enforcement of a lien as it would the owner. It is no more essential to the security of material-men and laborers in the one case than in the other.” Lumbard v. Syracuse, B. N. Y. R. R. Co., 55 N. Y. 491, 494; French v. Bauer, 134 id 548.
I find no reported case in which it has not been assumed that the same rule applied to liens under contracts for public improvements as to liens for the improvement of real property. While the question is not very plainly stated in Wright v. Schoharie Valley R. Co., 116 App. Div. 542; affd., 191 N. Y. 549, it is there squarely held that liens for material furnished to the subcontractor on a public improvement can be enforced only to the extent of the moneys found to be due him from the contractor. This rule.is in accord with the established policy of the State and is controlling here. An unprofitable contract or subcontract for a public improvement becomes a dubious security for material-men.
It follows that the main question here presented for decision is to what extent -the liens as filed attached, to the moneys earned by the subcontractor and unpaid.
■The following rules determine the extent to which a mechanic’s lien, filed by a subcontractor or a material-man, attaches to the locus in quo:
*547“ 1. If anything is due to the contractor, pursuant to the terms of the contract, when the lien is filed, it attaches to that extent. =
“ 2. If nothing is due to the contractor according to the contract, when the lien is filed, but a certain amount subsequietly becomes due thereunder, the lien attaches to the extent of that sum.
“ 3. If nothing is due to the contractor pursuant to the contract, when the lien is filed and he abandons the undertaking without just cause, but the owner completes the building according to the contract and under a provision thereof permitting it, the lien attaches to the extent of the difference between the cost of completion and the amount unpaid when the lien was filed.” Van Clief v. Van Vedhten, 130 N. Y. 571, 577; Wexler v. Rust, 144 App. Div. 296.
Lienors are entitled; by virtue of their liens, to such sums as the subcontractor was, at the time of filing their notices of lien, or might afterward become entitled to receive under its contract, but no more. Rodbourn v. Seneca Lake Grape & Wine Co., 67 N. Y. 215, 217.
The lienors have the burden of proof on this question. Brainard v. County of Kings, 155 N. Y. 538.
The question of advance payments in bad faith was not pleaded nor litigated and is not in the case. Hudson River Blue Stone Co. v. Huntington, 128 N. Y. Supp. 25.
The prices, so far as material, under the subcontract, were as follows: Excavation, eighty-five cents per cubic yard; channeling, eighteen cents per square foot.
By the terms of the subcontract, estimates were made monthly under the principal contract of the work done by the subcontractor. The contractor was paid on these monthly estimates about the twentieth of the month following. Within three days after the contractor was paid by the State for the work done under the subcontract, it made partial payments to the subcontractor as follows: Rock excavation above water line, seventy cents per cubic yard; rock excavation below water line, eighty-six and one-half cents per cubic yard; channeling, eighteen cents per square foot.
The balance was to be retained by the contractor until *548“ sixty days after the last of the preliminary payments is made hy the state to the contractor for all worlc done ” by the subcontractor.
Nothing whatever is due from the contractor until three days, after it is paid by the State for the work. of the preceding month, and nothing is due from these retained earnings of the subcontractor until the final completion of the work in accordance with the terms of the subcontract, and the lienors of the subcontractor can have no other or different claim thereto than the subcontractor would have. The admissions in the monthly statements of contractor to subcontractor that sums were due as of the first of the month were contrary to the contracts and to the facts and constitute no estoppel.
The sums retained were to secure the contractor from loss by the subcontractor’s default and -the right to demand the same by any one depended upon the substantial performance of the subcontract. Kelly v. Bloomingdale, 139 N. Y. 343.
*549Erom the total sum earned should he deducted the sum of $417.35, and from the present payments the sum of $291.56, hy reason of errors in the monthly estimates of work done on account of spoil certified as placed on the hank hut actually dropped in the canal by the subcontractor.
Under the terms of the subcontract, the contractor gave ten days’ notice to the subcontractor on February 9, 1910, declaring it to he in default. It thereupon acquired the right to “ forthwith procure by contract or otherwise, the completion of the work, and may to the extent of such cost of completion and interest thereon, withhold and apply thereon any and all moneys otherwise due or to be become due to the subcontractorThe contractor’s right to withhold moneys due and to become due, therefore, vested on February 19, 1910; and, as nothing was due and unpaid on that date, there was no fund to which the liens presently attached. The lienors have failed to establish that any surplus will remain after the completion of the work, and it cannot he presumed that the work can be completed for the subcontract price. Brainard v. County of Kings, supra; Laudani v. Vulcan Eng. Co., 70 Misc. Rep. 385, 388, 389.
On the contrary, the evidence is that it will cost an amount highly in excess of the subcontract price, estimated at $26,-163, to complete the work covered hy the subcontract, which the contractor is hound to do under the terms of its contract with the -State.
It also appears that the contractor has further been damaged hy reason of removal of spoil dropped in the canal, which had been certified as placed on the hank hy the subcontractor. The State paid the contractor at the contract price for doing this work; hut it cost the contractor $2,610.82 more than was allowed hy the State, and the contractor is entitled to deduct this sum from the amount certified as earned by and unpaid to the subcontractor.
Payments to laborers of the subcontractor were made hy the contractor to the amount of $3,829.29 on February 28, 1910, after certain of the liens had been filed.
The contractor agrees with the State that all workmen employed hy him or any subcontractor upon the work shall he *550paid not less than the-prevailing rate of wages “and that each such laborer, workman or mechanic shall be paid such wages.” The contractor further agrees that the contract may, at the option of the State, be declared vpid, if it or any subcontractor fails to comply with this provision of the contract. The contractor was, therefore, bound to pay'the laborers of the subcontractor their wages and it was entitled to appropriate to this purpose moneys earned by the subcontractor and unpaid.
While material-men and workmen have no lien upon or equity in money due or paid under a building contract until they have filed their liens pursuant to the Lien Law (Mack v. Colleran, 136 N. Y. 617), payménts to laborers take precedence at least over liens filed subsequently to February 28, 1910.
As it conclusively appears that nothing was due to the subcontractor and unpaid when the liens were filed, and as the lienors have failed to establish that any sum will ever become due to the subcontractor out of the sums earned and unpaid, they have failed to establish their liens; and their recovery would be limited to a personal judgment against the Rochester Construction Company in each case, under section 54 of the Lien Law, were it not for the discharges of certain of the liens by a deposit of money or the giving of an undertaking by the contractor pursuant to section 21, subdivisions 4 and 5 of the Lien Law, the material portions of which read as follows:
“ § 21. Discharge of lien for public improvement. A lien against the amount due or to become due a 'contractor from a state or a municipal corporation for the construction of a public improvement may he discharged as follows:
“ 4. By the contractor depositing with the comptroller of the state or the financial officer of the municipal corporation, or the officer 'or person with whom the notice of lien is filed, such a sum of money as is directed by a justice of the supreme court, which shall not be less than the amount claimed by the lienor, with interest thereon for the term of one year from the time of making such deposit, and such additional amount as the justice deems sufficient to cover all costs and *551expenses. The amount so deposited shall remain with the comptroller or such financial officer or other officer or person until the lien is discharged as prescribed in subdivision one, two or three of this section.
“ 5. Either before or after the beginning of an action by a contractor executing an undertaking with two or more sufficient sureties, who shall be freeholders, to the state or the municipal 'corporation with which the notice of lien is filed, in such sums as the court or a judge or justice thereof may direct, not less than the amount claimed in the notice of lien, conditioned for the payment of any judgment which may be recovered in an action to enforce the lien,”
It is contended that, by reason of such deposits and undertakings, the lienors are entitled to have their personal judgment paid. The question has recently been before the Court of Appeals (Milliken Bros., Inc. v. City of New York, 201 N. Y. 65). Cullen, Ch. L, writing the opinion of the court, says: “ The appellants (other than McNulty) contend that by reason of the deposit to discharge their liens they are entitled to have the claims for which they recovered personal judgments paid out of the fund, even if their claims were invalid. We agree with the majority of the Appellate Division that this contention cannot be upheld. Subdivision 4 of section 21 of the Lien Law provides for the discharge of a lien by the deposit of a sufficient sum of money. In such case the sum deposited is a substitute for the fund to which the lien attached until the deposit was made. A valid lien on the primary fund must, therefore, be established to justify payment out of the deposit. The argument of the appellants is that subdivision 5 provides for the discharge of a lien by the execution of a sufficient undertaking conditioned for the payment of any judgment which may be recovered in an action to enforce the lien; that section 3412 of the Code of Civil Procedure authorizes a recovery by a lienor of a personal judgment for his claim when.he fails to establish a valid lien; that had an undertaking been given to discharge the lien, the sureties would have been liable for the personal judgment; and that the liability should be the same whether the lien is discharged by a deposit or by the execution of an *552undertaking. In Hawkins v. Mapes-Reeve Constr. Co. (82 App. Div. 72) the contention of the appellants so far as it relates to an action on an undertaking was upheld by a dii ided court. The case was affirmed in this court (178 N. Y. 236), but on the ground that the claimants’ liens were valid. The court declined to pass upon the question on which the case had been decided in the Appellate Division, nor is "it necessary to determine that question now. It is sufficient to say that as the various provisions of the Lien Law relating to the discharge of liens are directed toward the substitution of the fund or undertaking in lieu of the thing against which the lien attached, the substituted liability ,-hould not be greater than the original liability, unless the direction of the statute is clear and express. Ho such direction relating to the deposit of moneys is to be found in the statute, whatever may be the case as to undertakings.”
This is conclusive against the lienors, so far as the liens discharged by deposit are concerned. So far as the liens discharged by undertaking are concerned, this court might be bound by authority to hold that the undertaking is security for any personal judgment obtained herein against the contractor who executed it (Hawkins v. Mapes-Reeve Constr. Co., 82 App. Div. 72, cited supra); but to hold such contractor liable on the undertaking given by it for a personal judgment obtained against, the subcontractor would make the substituted liability greater than the original liability and would permit the discharge of the lien by an undertaking only at the cost of admitting its validity. I find no clear and express direction of the statute to this effect, although the undertaking is “ conditioned for the payment of any judgment which may be recovered in an action to enforce the lien.” The contractor seeks to obtain the discharge of the lien and to substitute a personal liability in place of the fund; but why he should be required to secure the payment of a personal judgment obtained against another party to the action, in order to discharge the lien, is not clear. Indeed, Jujdge Andrews, at Special Term (Casey v. Connors Bros. Cons. Co., 53 Misc. Rep. 101), declining to follow the Hawkins case, supra, says: “A judgment ‘in an action to enforce a *553lien’ does not mean a judgment that no lien exists, but. that the plaintiff is entitled to a money judgment because of breach of contract on the part of some defendant. It means a judgment that a valid lien exists.”
The question is an open one, but the obvious inconsistence of distinguishing between the effect of a discharge of lien by deposit of money under subdivision 4 and a discharge by giving an undertaking under subdivision f> in this regard, reduces the proposition almost to an absurdity. In this case, such a distinction would defeat the plaintiffs’ recovery, although their notices of lien are earliest in point of time, and would, at the same time,.permit a recovery on the undertaking by the Erie Railroad Company, on a claim for freight, the lienability of which is doubtful and to be sustained only by the most liberal construction of the law. 27 Cyc. 44, and cases cited. Union Oil Works filed notice of lien March 22, 1910, which was discharged by deposit. Standard Oil Company filed notice of lien March 29, 1910, which was discharged by undertaking. Both claims were for oil furnished. Can it have been contemplated by the Legislature that the former should not recover on the substituted liability and that the latter should ? I think that the literal terms of the statute must be construed in' the light of the general purpose of the Lien Law, and that no recovery can he had on the undertaking herein except on a personal judgment against the principal contractor.
The Lien Law is “ to be construed liberally to secure the beneficial interests and purposes thereof.” Lien Law, § 23.
By virtue of this salutary rule it would be held that liens may be acquired for coal and oil delivered and furnished to run machinery on the real property or public improvement (Zipp v. Fidelity & Deposit Co., 73 App. Div. 20), although not actually used because of the abandonment of the work by the contractor. Sears v. Wise, 52 App. Div. 118.
In the leading case of Schaghticolce Powder Co. v. Greenwich & J. R. Co., 183 N. Y. 306, the court says: “ It would be difficult to suggest anything more comprehensive than the language used in the present statute. Any ‘contractor, sub*554contractor, laborer or materialman who performs labor or furnishes materials for the improvement of real property ’ shall be entitled to a lien. When this language is contrasted with the specific and restricted phrases of the former statutes, it is plain that the legislature intended to bring all labor performed or materials furnished in the improvement of real estate, no matter by what name they may be called or by what description they may be designated, within the liberal and beneficent purposes of the statute.”
This makes lienable virtually all labor performed for and all materials furnished to the contractor for the improvement which do not become a part of his plant and which do not necessarily survive the performance of the work and remain the property of the owner, and so covers, virtually, all the liens filed herein. But under the Uew York system of mechanics’ liens, a proper regard for the protection of the. laborer and the material-man has never gone so far as to establish the rule that they may recover more from the owner than is due or becomes due from him to the contractor under the contract. They assert the claims of the contractor against the property, not their own claims. They are allowed, hy a species of equitable subrogation, to claim, indirectly, what the contractor would otherwise be entitled to claim under his contract, directly—nothing more. 27 Cyc. 89.
l£y conclusion, therefore, is that, until the work covered by the subcontract is completed, it cannot be determined, under the provisions of such contract, whether the subcontractor is entitled to receive any part of the amount earned by it and now unpaid on its contract; that the lienors have, therefore, failed to establish their liens upon any amount due or to become due under the subcontract; that the substituted liability incurred by deposit of money or giving of undertakings for the discharge of liens is no greater than the original liability; that the lienors are, therefore, limited to personal judgments against the Rochester Construction Company.
All sections of the Lien Law (Laws of 1909, chap. 38) relative to liens under contracts for public improvements and the foreclosure thereof have been repealed at this session of *555the "Legislature and a new plan enacted for securing claims for labor and materials on public works (Laws of 1911, chap. 450, in effect June 26, 1911), but this action is not affected thereby. Gen. Const. Law (Laws of 1909, chap. 27), § 94.
Decision accordingly.