The proliferation of renewable energy systems and high-capacity batteries has enabled customers to trade their excess energy on the market in a peer-to-peer manner through the smart grid. At the same time, electric vehicles (EVs) are enjoying widespread acceptance, leading to a higher demand for charging stations. In this paper, we propose a system where energy traders and EV owners collectively work to satisfy the energy demands of EVs. Specifically, energy traders make bids to EV owners who, in turn, reserve their preferred charging station for a specific period of time. To protect the privacy of EV owners, we also introduce an anonymous payment system that cannot link individual owners to specific charging locations. Finally, to guarantee the security and transparency of the entire system, we store all transactions on a consortium blockchain that is managed by the energy traders and the financial institutions that support the anonymous payment system. Our experimental results indicate that the overhead of the cryptographic operations involved in the major transactions is low, in terms of both computational and communication cost.