A key factor in determining investment policy, liquidation policy, and the consequences of financial distress is the set of rules governing bankruptcy. Bankruptcy rules affect firms in financial distress in two ways. First, it is obvious that they affect the outcome of the bankruptcy proceeding. Second, they establish the alternative to an out-of-bankruptcy settlement and so affect the nature of such settlements. The likely outcomes of both informal bargaining and formal bankruptcy, in turn, affect the availability of funds for investment and the types of investments equity holders will pursue. More specifically, poorly conceived bankruptcy rules may make it impossible for investors to earn a fair return, even in situations where the investment is economically viable. Also, bankruptcy rules may encourage or discourage inefficient investments. Finally the bankruptcy regime affects the extent to which firms are forced to liquidate assets even when the "going concern" value of the assets is higher than the outstanding debt. The purpose of the research is to guide the policy debate surrounding bankruptcy by suggesting some features of an optimal bankruptcy law based on these considerations. The research method is novel in how it regards optimal bankruptcy law as one element in the broader problem of designing optimal financial contracts. Such contracts specify how resources are to be allocated between investors and firms. Actual financial contracts usually stipulate only (possibly contingent) payments to investors. The rules governing the breach of stipulated promises are, in fact, typically not specified in the contract explicitly. They are generally contained in the legal system and are implicitly a part of every contract. For example, debt contracts specify the debtholder's investment, the specific payments to which he is entitled, and covenants restricting the debtor's behavior. Bankruptcy law provides a procedure to be followed if the promised payments are not made or if the covenants are violated. In view of this concern, security design will be examined as including both explicit promises and the procedures to be followed in case of breach, and optimal bankruptcy rules will be derived as part of an overall contract design problem.