Abstract: In this paper, I develop a tractable model of corporate bankruptcy law to examine its effects on firm default rates, borrowing costs, production, and to determine how to design it optimally. The model highlights the heterogeneous impacts of increasing creditor protection during the liquidation of insolvent firms and the efficiency-equity trade-off involved in bankruptcy design. I calibrate the model to firm-level data from the Brazilian economy to evaluate the impact of the 2005 bankruptcy reform and to compare its outcomes against an optimal policy benchmark. I find that the reform successfully reduced creditor risk and shortened the duration of bankruptcy proceedings - a key source of asset erosion - ultimately contributing to lower lending spreads, which are historically high in Brazil. However, the results also indicate that optimal recovery rates for lenders must be accompanied by procedural efficiency; otherwise, the increased cost of business failure may impose significant welfare losses on shareholders. Finally, I provide two guidelines to implement the optimal outcome: (1) a variation of the current Brazilian law, and (2) an alternative similar to Aghion et al. (1992), with potential for greater efficiency.