Due to the expansion of small scale distributed energy resources such as solar rooftop and PEVs, decentralized energy trading is expected to be one of the most important components of next generation power systems. Decentralized peer-To-peer energy exchange systems are believed to be a promising solution not only to solve the scalability and mobility problems in the existing system but also to create a competitive market that can benefit small scale prosumers and consumers. However, such systems need to be equipped with the necessary security, privacy and payment transaction mechanisms to be efficient and trusted. In this paper, we propose a decentralized energy exchange system based on Blockchains. Blockchains is a technology that supports secure transactions between participating entities in a decentralized peer-To-peer network. The proposed system allows for energy exchange between prosumers using a form of smart electronic contracts which are based on Blockchains.