Research Question Debates on sovereign debt restructuring typically emphasise a trade-off between ex ante and ex post efficiency. Proponents of bankruptcy procedures highlight the ex post inefficiency posed by costly default, and emphasise the importance of mitigating these via statutory or market-based remedies. Critics of such proposals counter that sovereign debt is feasible and affordable only because of the threat of costly crises. In this paper, we consider the design of an optimal sovereign debt restructuring mechanism where countries choose their bankruptcy provisions depending on their economic circumstances. Contribution We present a model in which a sovereign issues bonds to fund a risky project and chooses bankruptcy provisions (a "haircut") ex ante to maximize domestic consumption. But, sovereign creditors can, ex post, reject the haircut and holdout by pursuing costly litigation in a court. Results The choice of the haircut has two important incentive effects ex post. First, it influences the sovereign's willingness-to-repay. All things being equal, a larger haircut means that the sovereign can more easily restructure its debts. The second effect is on the sovereign creditors' incentives to holdout during the restructuring. In our model, creditors are ex post heterogeneous and have different costs of pursuing litigation. If the haircut is high, then creditors with high litigation costs have a strong incentive to sell their bonds to more litigious creditors, i.e., those with low litigation costs, who holdout and pursue litigation. Our model predicts that countries with weak and risky macroeconomic fundamentals will voluntarily seek lower haircuts (i.e. harsher bankruptcy provisions) ex ante so as to avoid being subject to costly litigation.