Legal institutions affect economic outcomes, but how much? This paper documents how costly supplier contract enforcement shapes form boundaries, and quantifies the impact of this transaction cost on aggregate productivity and welfare. I embed a contracting game between a buyer and a supplier in a general-equilibrium closed-economy Eaton-Kortum-type model. Contract enforcement costs lead suppliers to underproduce. Thus, firms will perform more of the production process in-house instead of outsourcing it. On a macroeconomic scale, in countries with slow and costly courts, firms should buy relatively less inputs from sectors whose products are more specific to the buyer-seller relationship. I first present reduced-form evidence for this hypothesis using cross-country regressions. I use microdata on case law from the United States to construct a new measure of relationship-specificity by sector-pairs. This allows me to control for productivity differences across countries and sectors and to identify the effect of contracting frictions on industry structure. I then proceed to structurally estimate the key parameters of my macro-model. Using a set of counterfactual experiments, I investigate the role of contracting frictions in shaping productivity and income per capita across countries. Setting enforcement costs to US levels would increase real income by an average of 7.5 percent across all countries, and by an average of 15.3 percent across low-income countries. Hence, transaction costs and the determinants of firm boundaries are important for countries' aggregate level of development.