A fundamental question in social sciences is how trust emerges. We provide an answer which relies on the formation of social and economic relationships. We argue that behind trust lies the fact that individuals invest in connections taking into account the potential externalities networks produce. Once social ties are in place, these externalities shape the individuals' incentives to behave efficiently in their interactions and thereby efficient social norms are sustained. We also show that the individual's incentives depend on the architecture of the network as well as on the position of the individual within the network. In particular, when an efficient interaction requires players to mutually cooperate, efficient social norms are easily sustained in symmetric networks. By contrast, when an efficient interaction requires players to play asymmetrically (one cooperates and the other free-rides), efficient social norms are best sustained in fully centralized architectures. We interpret these results indicating that a structural analysis is important to understand how individuals' incentives are shaped in many strategic contexts.