The Code (§ 303) repeals all existing laws restricting or controlling the right of a party to agree with an attorney, solicitor or counsel, for his compensation, and hence it follows that though prior to the enactment referred to an agreement with an attorney to give him part of a debt for collecting it was void, (Satterlee v. Frazer, 2 Sand. S. C. R. 141, and cases cited), it is not so now. In the language of Sandford, J., in the case just mentioned, “ the Code of Procedure appears to have changed the law in this respect, and enables parties to make such bargains as they please with their attorneys.” See also Easton v. Smith, 1 E. D. Smith R. 318. It is true that, at the time the agreement was made by the Sherwoods with Cook, no costs had accrued, and from the nature of the action brought against the latter, costs tiiight not have been granted had he succeeded, but that did not affect the right of Cook to bargain upon the hypothesis that he might recover costs. That doubt was a matter affecting only the employer and the employed, which third persons had no power to interfere with. Having the right to make the agreement, and the agreement not being against the policy of the law, it was binding upon the parties, and must be sustained. From the moment the Sherwoods began to defend the action against Cook, an equity in their favor commenced, and so continued down to the time when the costs were adjusted. They labored for those costs, and having succeeded in the defence, it must be assumed that they earned them by diligence, industry and skill. They took the risk in reference to the costs, and having done so, the costs never in fact belonged to the defendant in the action. Prior to the Code the courts would not refuse to set off one judgment against another because of the attorney’s lien; upon the ground, that the equities of the parties were superior to those of the attorneys, the attorney looking in the first instance to the *409personal security of his client, (The People ex rel. Manning v. The N. Y. Com. Pleas, 13 Wend. 649; Nicoll v. Nicoll, 16 Wend. 446); but without reference to the question whether the attorney’s lien still exists, although it seems to be settled, (Ward v. Woodsworth, 1 E. D. Smith’s R. 598; 12 How. Pr. Rep. 136; 11 How. 100; 20 Barb. 541; 21 Barb. 17; 4 Barb. 47), there is little doubt that the principle upon which courts heretofore permitted judgments to be set off must still prevail, even if the lien is held to continue. In this case, however, something more than a mere lien exists. The costs that might be awarded were passed to the Sherwoods in anticipation of their recovery, as a compensation for their services which would result in that recovery, and as each particular service for which costs were allowed was performed, the right of the Sherwoods to the compensation for that service attached, not by lien alone, but by express agreement. Cook said, at or about the time that the agreement was made, that • he had no means to carry on the suit, that he had failed, made an assignment, and had gone through the Insolvent Act. It would seem, from these circumstances, that the Sherwoods looked first to the costs for security, and not to the personal responsibility of Cook, who had declared himself to be irresponsible, and it follows that, so far as the cases supra are founded upon the theory that the attorney relies first upon his client for payment, they have no application to this case. For these reasons, I think the defendants Sherwood entitled to judgment. The plaintiff is, however, entitled to judgment against the defendant Cook. The discharge granted by Recorder Talmadge is only prima facie evidence of the jurisdictional facts recited, and those facts may be inquired into by’ a party seeking to impeach the final order in a collateral action. If a defect is ascertained, the whole proceeding is void. Stanton v. Ellis, 2 Kern. 575. In applications by an insolvent and his creditors, under the third article of the title of the Revised Statutes relating to non-resident, absconding, insolvent, and imprisoned debtors, (2 R. S. 16), the debtor is required to annex an affidavit to his petition, account and inventory, in the form prescribed by the statute, which shall be *410subscribed by the insolvent, and sworn to in the presence of the officer to whom the petition is presented, and the officer receiving such petition, schedule and affidavit, shall make an order requiring all the creditors of the insolvent to appear. The affidavit is a prerequisite, and unless made in the manner and at the time prescribed, the officer acquires no jurisdiction. The affidavit relates to the inventory of the debtor’s estate among other things, and the whole of which estate the creditors to are entitled as it exists at the time the petition is presented. But were it otherwise, it is sufficient that the statute requires the affidavit to be made before the order to show cause is granted, and in the presence of -the officer granting the order. The proof shows that the affidavit referred to was sworn to before a commissioner ot deeds in the first instance; that on or after the day on which the order to show cause, granted by the recorder, was returnable, the jurat to the affidavit was signed by him, and that although signed by him, it was neither subscribed nor sworn to by the insolvent in the presence of the recorder. It is clear, therefore, that the recorder never acquired jurisdiction, and that the whole proceeding before him was void.
G. Bainbridge Smith, for the plaintiff.I. It was well settled before the adoption of the Code of Procedure, that the lien of an attorney for his costs was subordinate to the equities existing between the parties; and that where two parties held judgments against each other, courts, both of law *411and equity, were bound by statute to set off the one against the other, notwithstanding the attorney’s costs. The People v. Manning, 13 Wend. 649; Nicoll v. Nicoll, 16 Wend. 446; Noxon v. Gregory, 5 How. Pr. 339; Ward v. Wardsworth, 1 E. D. Smith, 398; Wilkins v. Batterman, 4 Barb. 47; Chappell v. Dann, 21 id. 17. 1. The costs belong to the party. Formerly a party not an attorney, conducting a suit or defence in person, was not entitled to costs. Now they are allowed to the prevailing party upon the judgment, by way of indemnity for his expenses in the action, whether he be an attorney or not. Ex parte Stewart v. N. Y. Com. Pleas, 10 Wend. 597; Code, § 303. 2. There were no costs at common law. They are created by statute; so are set-offs. Beame on Costs, p. 8, (6 L. L., N. S.); 4 Burr, 2221. 3. In any case, they do not exist until judgment; and where the legislature changes the costs during the progress of a suit, the costs of such suit are to be taxed according to the statute in force at its termination. The Sup'rs. of Onondaga v. Briggs, 3 Denio R. 173. 4. In the action in which the costs in favor of Cook were awarded, they were in the discretion of the court, and the court, in awarding them, reserved to the plaintiff the right to have them set off against his judgment. Code, § 306. 5. The testimony does not support the conclusion arrived at by the judge, that there was an agreement between the defendants that the costs should belong to the attorneys. 6. Conceding the existence of such an agreement, the question is, whether the .provisions of the Code allowing an attorney and client to make an agreement between themselves as to the compensation of the attorney, affect and bind third parties, and has repealed the statutory right of set-off, which in such cases heretofore existed.
*410There may be some question as to the sufficiency of the state ment upon which the plaintiff obtained judgment against Cook, so far as the rights of other creditors of the latter may be affected, but as between the plaintiff and Cook it is valid. Griffin v. Mitchell, 2 Cow. 548; Van Keller v. Muller, 3 Abb. Pr. R. 375.
Ordered accordingly.
The plaintiff appealed from the judgment in favor of the defendants Sherwood, and the defendant Cook appealed from the judgment against him, declaring his insolvent discharge void.
*411H. The plaintiff’s judgment is good and valid. 1. The validity of the judgment was not brought in issue, and was admitted by the pleadings. 2. A “ defendant is required, besides answering the plaintiff’s case, to state to the court, in his answer, all the circumstances of which he intends to avail himself by way of defence ; and he cannot avail himself of any matter of defence which is not stated in his answer, even though it should appear *412in evidence." Kelly v. Western, 2 Comst. 500; Field v. The Mayor, &c., 2 Seld. 179; McKyring v. Bull, 16 N. Y. R. (2 Smith) 297. 8. The specification is sufficiently particular to apprise all persons of the nature and consideration of the debt. Code, § 388; Manchester v. Preston, 14 How. P. R. 21; Delaware v. Ensign, 21 Barb. 85; Chappell v. Chappell, 2 Kern. 215; Dunham v. Waterman, 17 N. Y. R. (3 Smith) 9. 5. Even if it were void as to creditors, it is good as between the parties: Griffin v. Mitchell, 2 Cow. R. 548; Von Keller v. Muller, 3 Abb. P. R. 375.
III. The defendant Cook, on the 31st day of December, 1851, after the plaintiff’s judgment against him was recovered, obtained a discharge under what is commonly called the Two Third Act. It appears by the proceedings, that the officer who granted the discharge, did not acquire jurisdiction therein; and, consequently, so far as the plaintiff’s judgment is sought to be affected by the discharge, it is the same as if it had never been granted.
It was clearly proved, in addition to the admission in the pleadings, that the affidavit required by the seventh section of the act, upon which the officer acquires jurisdiction in such proceedings, was neither sworn to nor subscribed by the insolvent in the presence of the recorder who granted the discharge, itntil the order requiring the creditors to show cause why the insolvent should not be discharged from his debts was returnable. 2 R. S., p. 16. 1. The seventh section requires the affidavit to be “ sworn to and subscribed bjr such insolvent in the presence of such officer, who shall certify the same.” 2 R. S., p. 17, sec. 7. 2. The officer before whom insolvent proceedings of this nature are conducted, exercises a special jurisdiction acquired in the mode prescribed by the statute, and if any essential requisite is wanting, his acts are a nullity. Small v. Wheaton, 2 Abbott’s P. R. 178; Stanton v. Ellis, 2 Kern. R. 575.
IV. The discharge is also void, because there was no proof furnished to the officer granting the same, that the insolvent was a resident of, or imprisoned in the city of New York at the time tif the presentation of his petition for such discharge. 1. The *413statute requires that applications, made under the articles enumerated in that title, “ shall be made to an officer residing in the county in which the insolvent or imprisoned debtor resides, or is "imprisoned; and proof of such residence or imprisonment shall be made at the time of presenting the petition, and before any order shall be granted thereon.” 2 R. S., p. 35, § 2. 2. Not only must the insolvent be a resident of the county, but proof of such residence shall be made at the time of presenting the petition, and before any order shall be made. Stanton v. Ellis, 16 Barb. S. C. R. 319; Small v. Wheaton, 2 Abbott’s P. R. 179; In re Underwood, 3 Cow. R. 59.
Henry A. Oram, for all the defendants.I. The agreement between Cook and his attorneys that they should have the costs, was valid. 2 Sand. 141; 1 E. D. Smith, 318.
II. The lien of the attorney for his costs, still exists. The right of' set-off of judgments is not superior in equity to that of the attorney. But whether it is so at common law is not here material, because a valid contract is made between the attorney and client before the costs are' earned, the consideration of which oh one side is the service to be rendered, and on the other the right to the costs. The costs, as soon as earned, became the property of the attorney; and never having been the property of the client, no set-off could or ought to be made of a judgment against the client. This court has, at general term, passed upon and determined this precise question in this action, and it Cannot now be considered an open question. Robbins v. Alexander, 11 Howard P. R. 106.
IH. The evidence fully sustains the allegation of the agreement and the finding of the judge, and is not disputed.
IY. The judgment by confession against George Cook is void, because: 1st. The statement necessary to authorize the entry of judgment by confession, without action, is clearly insufficient. The first part of the statement omits to set forth the dates or amounts, or particulars of cash borrowed. The fact that a note *414was given does not obviate the difficulty. Chappell v. Chappell, 2 Kern. 215; Bonnell v. Henry, 13 How. P. R. 144; Von Beck v. Sherman, id. 472; id. 21. The second part is still more uncertain in not showing whether any debt is due by the defendant to the plaintiff, in omitting dates and amounts, and in omitting to show how, when, or where, any debt was assumed by the plaintiff.
V. This question is jurisdictional, as there is no control by ■ the court over this statutory proceeding without action until a valid judgment is entered, when the court acquire, for the first time, jurisdiction by virtue of their control over their own judgments. See Bonnell v. Henry, 13 How. 145; Von Beck v. Sherman, id. 475. The statement must be sufficiently full and accurate to conform to the statute. “It constitutes a condition precedent to the right of the party to confess the judgment.” Dunham v. Waterman, 17 N.Y.R. 14. The defendants Sherwood may raise the objection as creditors of Cook, and Cook himself may raise the question as one of jurisdiction.
VI. The insolvent’s discharge is not void.
Hilton, J.I think the judgment in this case, so far as it relates to the defendants Sherwood, is right, and should be affirmed; although I do not assent to the conclusion arrived at by Judge Brady, in respect to the validity of the plaintiff’s judgment. It may be that its validity was not denied by the defendants in their answers, but the plaintiff did not choose to rest his case upon the admission which he now insists the answers contain. The judgment under which he claims was entered by the clerk of the Supreme Court upon the confession of the defendant Cook, and the record containing this confession was produced and .read in evidence at the trial on the part of the plaintiff, notwithstanding the defendants’ objection and their exception to its-'admission. It thus became evidence in the cause, and the court was therefore bound to inspect it, to determine as to its validity as a record, and as to whether the statement or confession contained in it, was sufficient in law to warrant the clerk in *415entering the judgment upon which the plaintiff’s right of action depends; because, if it was not sufficient and did not show a concise statement of the facts out of which the indebtedness alleged in it arose, (Code, § 383), it follows that the judgment was entered by the clerk without legal authority; was not merely irregular, but void, (Chappell v. Chappell, 2 Kernan, 215; Von Beck v. Sherman, 13 Howard, 472; Bonnell v. Henry, id. 144), and could, therefore, form no ground for the plaintiff’s recovery.
The first item of indebtedness mentioned in the statement is the sum of $1,500, for cash borrowed by the defendant Coolc of the plaintiff, from time to time, and for which he holds the defendant’s note, dated November 12, 1850, payable six months after date. This was clearly insufficient. It should have specified the several amounts which went to make up the indebtedness, and the different times when the money was loaned. . It was so held in Stebbins v. The East Society of the Methodist Episcopal Church, Rochester, 12 Howard, 410.
The second item of indebtedness alleged is still less explicit. It is that the plaintiff had assumed for the defendant Cook the payment of $2,000, for which he had given the plaintiff two notes for $1,000 each, made payable at sixty and ninety days.
This is certainly not “ a concise statement of the facts out of which the indebtedness arose.” The nature and origin of the indebtedness assumed, to whom it was owing, and in what manner it was assumed by the plaintiff, should have been stated. All this the law required, and as the statement did not furnish such information, it was not such a one as authorized the entry of a judgment upon it.
For these reasons I think the judge at special term erred in finding, as a conclusion of law, that the plaintiff’s judgment was good and valid. He should have found it to be the reverse. As to the argument that its validity can only be questioned by a junior judgment creditor, it seems to me inapplicable to a case like the present. The plaintiff sought, in this action, to enforce what he claimed to be a legal right acquired under a judgment entered upon the confession of the defendant Cook. If he re*416covers, it must be upon the strength of his own case and the evidence he has adduced in support of it, and not upon the weakness of his adversary. He attempted to show that he was the owner of a valid judgment, which he was entitled to set off against a judgment actually belonging to the defendants Sherwood. Failing to show this, it follows that he has no cause of action, and, therefore, not entitled to the relief he has demanded. The defendants did not come into court asking to have his judgment vacated or declared void; they simply relied upon the inherent weakness of his claim,.and asked that his action be dis missed because he failed to show himself entitled to any reliej whatever.- This, in my opinion, they had a right to do.
Upon these views the plaintiff was not a judgment crédito of the defendant Cook, and, therefore, was not entitled to hay the court declare his insolvent discharge void. In my opinio i the judge at special term improperly passed upon that question and the judgment given in respect to it should be reversed.
Beady, J., concurred.
Daly, First Judge.All the defendants in this case were entitled to judgment. The equitable relief which the plaintiff asked was this: That the discharge granted to the defendant Cook, as an insolvent, should be declared void ; that the judgment which he, the plaintiff, had obtained against Cook by confession, should be set off against the judgment recovered by Cook against the plaintiff, to the extent of the latter judgment; that the latter judgment should be adjudged to be satisfied and can-celled of record; and that the plaintiff should have judgment for what would remain due upon the former judgment, after allowing the set-off Two things were sought to be accomplished by the action. First, to get rid of the discharge which stood in the way of the plaintiff’s judgment, and then to have the set-off allowed.
The judgment which Cook recovered against the plaintiff was exclusively for costs. The action was .brought by the plaintiff *417against Cook and others, to set aside an assignment which Cook had made for the benefit of creditors, and the plaintiff having failed in the action, Cook, as one of the defendants, recovered judgment against him for $882.42 costs. Upon the trial, in this suit, it was proved that after the" commencement of that action, and before an answer was put in, an arrangement was made between Cook and his attorneys, the Messrs. Sherwood, to the effect that the costs of the defence of the action should belong to the attorneys. Mr. John Sherwood swore that Cook came to them, the attorneys, and told them that he had no means to carry on the suit; that he had failed, made an assignment, and had gone through the Two Third Act; that the witness told him he would succeed in the action; that the suit was frivolous, and the complaint would be dismissed; that they would go on and defend the action, and that they would get a bill of costs out of the plaintiff, for their services, which would belong to them, the attorneys, and that Cook said, “certainly, that’s all right,” or other words expressing assent to the agreement or arrangement. The attorneys went on, paid all the disbursements, and defended the suit, which was a protracted litigation, having been carried by the plaintiff to the Court of Appeals, and when judgment was rendered in Cook’s favor for the costs above stated, he assigned the judgment to them.-
■ The judge below found that, after the commencement of the suit and before the trial, an arrangement and agreement was made between Cook and the Messrs. Sherwood, that the costs to be recovered were to belong to them, and I think that he was warranted by the facts in so finding. This agreement was made before the defence of the suit was made by the defendants Sherwood, and the services which they agreed to render, and did render, was a good consideration for the making of such an agreement. The question of an attorney’s lien, so much discussed in the various stages of this case, does not in fact arise. By the long established practice of the courts the attorney has a lien upon the judgment for his costs, subject, however, to the equitable right of the parties to set off one claim against another; *418and if the parties settle in fraud of the attorney’s lien, the judgment will be enforced to the extent of the lien. But the defendants Sherwood did not call upon the court to protect a lien which they had upon the judgment for costs, or interpose any such lien as against the plaintiff’s right of set-off. They are the assignees and owners of the judgment which has been assigned to them by Coolc in consummation of an agreement, which he made with them when they undertook the defence of the suit, that the costs should belong to them. Their right is founded primarily upon a transfer or equitable assignment by Cook to them of a thing in expectancy, which was valid and will be sustained by the courts. “ Whatever doubts may have existed heretofore,” says Wells, J., in Field v. The Mayor, &c., of New York, (2 Seld. 187,) “ the better opinion now is, that courts of equity will sup • port assignments, not only of things in action, but of contingent interests and expectations, and of things which have no present actual existence, but rest in possibility, provided the agreements are fairly entered into, and it would not be against public policy to uphold them.” Before these costs were created, and before it could be known that Cook would ever be entitled to any—when the matter rested in mere expectation and possibility'—they made this agreement, that they were to have the costs for their services as attorneys, and if any doubt existed before the Code as to the night of an attorney to make such an agreement, none can exist mow, the Code having repealed all laws restricting or controlling the right of a party to agree with his attorney for his compensation. They gave their services and paid the disbursements in the long course of the litigation. Their expectation was realized; the plaintiff failed in his suit, and when a judgment was rendered in Cook’s favor for costs against the plaintiff, as the costs by the previous agreement belonged to the Sherwoods, Cook assigned the judgment to them. The defendants Sherwood, therefore, cannot be regarded as assignees taking subject to the plaintiff’s right of set-off, but as assignees of a judgment nominally in the name of Cook, the whole interest in which be- . longed to them when the judgment was rendered. This case, *419consequently, is distinguishable from The People v. Manning, (13 Wend. 649), which was also a judgment for costs assigned to the attorney, for there no such prior agreement existed; in addition to which, the case is of no authority, as it was subsequently reversed; and the case before us is equally distinguishable from Nicoll v. Nicoll, (16 Wend. 446), in which the attorney, relying simply upon his lien upon the judgment for his costs, was not allowed to interpose it against the appellant’s statutory right to a set-off.
The defendants Sherwood, then, being the parties who had the sole interest in this judgment when it was rendered, through their previous agreement with Cook, the plaintiff had no claim to set off his judgment against it, and having failed in this, I do not see that he could be entitled to any judgment. I know of no authority entitling him to maintain an equitable action to have Cook’s discharge as an insolvent declared null and void, unless that discharge was an obstacle to the attainment of some right to which the plaintiff was entitled. If the judgment recovered in Cook’s name, for costs, belonged to him, and the plaintiff would have an equitable right to set off against it his judgment against Cook, if that judgment was not affected by the discharge granted to Cook ; upon the ground, that the discharge was null and void, then the validity of the discharge would be connected with the equitable remedy of the right of set-off. But having no right of set-off, the validity or invalidity of the.discharge becomes immaterial; or if- this was an action upon the judgment, the invalidity of the discharge would be material, for, if valid, he could maintain no such action; but it is not an action upon the judgment, but an equitable-action to compel a set-off, which, if allowed, is to be followed by a judgment for the balance due after allowing the set-off; If'the set-off is not allowed, then the action fails; for what was asked in addition was dependent and contingent upon the granting of the set-off; or if he sought to set the discharge aside upon the ground of fraud, the case might be different, but the objection to the discharge is that the judge who granted it never acquired any *420jurisdiction; and, as that appeared upon the face of the record, the discharge interposed no obstacle to the plaintiff enforcing his judgment. If he brought an actionAipon the judgment, ' or issued an execution upon it, and levied it upon the property of Cook, the discharge would be unavailable to Cook. An exhibition of the record upon which it was founded would show it to be worthless. There was no ground, therefore, for invoking the equitable aid of the court. The plaintiff had an ample remedy; or, rather, was not in want of any equitable remedy, and judgment should have been given for all the defendants.
This view of the case dispenses with the necessity of considering the question raised as to the sufficiency of the statement upon which the judgment was entered by confession. But I agree that the statement did not come up to the requirement of the statute; and I agree, also, that even if the answer would be regarded as admitting the existence of a valid judgment, that the plaintiff, having shown the fact to be otherwise, is bound by it. If the defendant means to rely upon any fact as a defence, he must set it up in his answer, that the plaintiff may be duly notified, and come prepared to meet it; but if the fact is shown by the plaintiff himself, this reason does not apply, and it does not lie with him to object after he has shown the court that he has no cause of action. The rule upon this subject is stated by the master of the rolls, Sir John Leach, in Stanley v. Robinson, (2 Mylne & Craig, 527): “ The distinction is this:—a defendant is not permitted to avail himself of a defence which appears only upon his evidence, and was not stated in his answer, so that the plaintiff could be prepared to repel it. But if it appears, upon the plaintiff’s own case, that he is not entitled to the relief prayed, the court will not assist him.”
But I do not agree that Cook could avail himself of the insufficiency of the statement. It was an objection available to Cook’s creditors, or to a subsequent purchaser, but as against Cook, the party who swore to the statement with the design and object that a judgment upon his confession should be entered in *421favor of the plaintiff, the judgment is conclusive and valid. Beekman v. Kirk, 15 How. 221; Griffen v. Mitchell, 2 Cow. 548; Moody v. Townsend, 3 Abbott, 375, and note; Neusbaum v. Keim, 1 Hilton, 520; Kendall v. Hodgkins, 7 Abbott, 309 Chappell v. Chappell, 2 Kernan, 215; Dunham v. Waterman, 17 N. Y. R. 9.
Judgment in favor of the defendants Sherwood affirmed, with costs, and the judgment in favor of the plaintiff against the defendant Cook, reversed, without costs.