The increasing number of prosumers who both consume and produce electricity and the ongoing decentralization of the electricity system lead to the need for new market designs to allow for direct trading of electricity between neighbours. Most currently proposed mechanisms ignore the grid restrictions, which might result in an infeasible dispatch and threaten the system stability. We propose a mechanism that considers grid restrictions and finds the optimal dispatch without relying on a centralized entity such as an independent system operator to oversee the system. We compare the results of the proposed mechanism to a nodal pricing approach and evaluate the welfare distribution among market participants as well as the exposure to market power using agent-based simulation. We find that the welfare distribution does not depend on the technical specifications of the proposed bilateral pricing mechanism but on the grid topology and that the possibility to exercise market power is equally high as under nodal pricing.