  Efforts to utilize 100% renewable energy in community microgrids require new
approaches to energy markets and transactions to efficiently address periods of
scarce energy supply. In this paper we contribute to the promising approach of
peer-to-peer (P2P) energy trading in two main ways: analysis of a centralized,
welfare-maximizing economic dispatch that characterizes optimal price and
allocations, and a novel P2P system for negotiating energy trades that yields
physically feasible and at least weakly Pareto-optimal outcomes. Our main
results are 1) that optimal pricing is insufficient to induce agents with
batteries to take optimal actions, 2) a novel P2P algorithm to address this
while keeping private information, 3) a formal proof that this algorithm
converges to the centralized solution in the case of two agents negotiating for
a single period, and 4)numerical simulations of the P2P algorithm performance
with up to 10 agents and 24 periods that show it converges on average to total
welfare within 0.1% of the social optimum in on the order of 10s to 100s of
iterations, increasing with the number of agents, time periods, and total
storage capacity.
