In this paper, we propose a game in which each player decides with whom to establish a costly connection and how much local public good is provided when benefits are shared among neighbors. We show that, when agents are homogeneous, Nash equilibrium networks are nested split graphs. Additionally, we show that the game is a potential game, even when we introduce heterogeneity along several dimensions. Using this result, we introduce stochastic best reply dynamics and show that this admits a unique and stationary steady state distribution expressed in terms of the potential function of the game. Hence, even if the set of Nash equilibria is potentially very large, the long run predictions are sharp.