This paper examines whether a country's ability to enforce contracts is a significant determinant of comparative advantage. The author constructs a variable to measure the proportion of intermediate inputs in each good that require relationship-specific investments. By combining this measure with data on trade flows and judicial quality, the author finds that countries with better contract enforcement specialize in goods where relationship-specific investments are most crucial. The estimates suggest that contract enforcement explains more of the pattern of trade than physical capital and skilled labor combined. The paper also controls for potential reverse causality by exploiting differences in countries' legal origins, using instrumental variables (IVs) and propensity score matching techniques. The results remain robust, indicating that contract enforcement plays a crucial role in shaping trade patterns.This paper examines whether a country's ability to enforce contracts is a significant determinant of comparative advantage. The author constructs a variable to measure the proportion of intermediate inputs in each good that require relationship-specific investments. By combining this measure with data on trade flows and judicial quality, the author finds that countries with better contract enforcement specialize in goods where relationship-specific investments are most crucial. The estimates suggest that contract enforcement explains more of the pattern of trade than physical capital and skilled labor combined. The paper also controls for potential reverse causality by exploiting differences in countries' legal origins, using instrumental variables (IVs) and propensity score matching techniques. The results remain robust, indicating that contract enforcement plays a crucial role in shaping trade patterns.