We model the building of a city, estimate parameters of the model, and calculate welfare losses from institutional frictions encountered in changing land-use. We distinguish formal and slum construction technologies; in contrast to slums, formal structures can be built tall, are durable, and non-malleable. As the city grows areas are initially developed informally, then formally, and then redeveloped periodically. Slums are modelled as a technology choice; however, institutional frictions in land markets may hinder their conversion to formal usage that requires secure property rights. Using unique data on Nairobi for 2003 and 2015, we develop a novel set of facts that support assumptions of the model, estimate all parameters of the model, and calculate welfare losses of conversion frictions. We track the dynamic evolution of the city and compare it with model predictions. In the core city formal sector, about a third of buildings were torn down over 12 years and replaced by buildings on average three times higher. For slums in older areas near the centre, even after buying out slumlords, overcoming institutional frictions would yield gains amounting to about $18,000 per slum household, 30 times typical annual slum rent payments.