We develop a theory of banking that explains why banks started out as commodities warehouses. We show that warehouses become banks because their superior storage technology allows them to enforce the repayment of loans most effectively. Further, interbank markets emerge endogenously to support...