The role of trust in social networks: formation, function and fragility