Abstract: In this paper, I develop a tractable model of corporate bankruptcy law to examine its ef fects on firm default rates, borrowing costs, production, and to determine how to design it optimally. The model highlights the heterogeneous impacts of increasing creditor protec tion during the liquidation of insolvent firms and the efficiency-equity trade-off involved in bankruptcy design. I estimate the model using firm-level data from the Brazilian economy in order to evaluate the impact of the 2005 bankruptcy reform and to compare its outcomes with those of an optimal policy benchmark. I find that the reform increased the lender’s share of the liquidation value of insolvent companies from 1.5% to 63%, while reducing the fraction of assets lost during the proceedings from 80% to 54%- ultimately contributing to lower lending spreads, which are historically high in Brazil. However, the reform is far from optimal. I solve for an optimal lender share of 12%, with a consumption gain of 0.87%, compared to the post-reform economy. Finally, I provide two guidelines to implement the optimal outcome, including a variation of the current Brazilian law .