In recent years, the continuous increase in the number of renewable energy sources and users has led to an increase in the load on the electricity market. In this environment, the personal information data and management flexibility cannot be guaranteed in a market that integrates producers and consumers. It seems that the new energy market will face many challenges, such as how to price the output power of power plants according to different energy sources, which price that consumers can sell to other market users through self-generated electricity, how to communicate with consumers and producers in order to maintain the balance of the market and encourage consumers to reduce electricity consumption, how to calculate the market load in order to reduce carbon emissions and protect the environment. In the face of many of the above challenges, it is beneficial to introduce blockchain technology into the energy market because of the unique characteristics, which effectively reduces the cost of maintaining the market and enhances the flexibility of the market. But different market users are sensitive to market information with the advent of information transparency. Therefore, how to restrain the user behavior of the market and maintain the stability of the market will become a major problem. In this paper, we propose a market-based access control strategy to construct a blockchain framework and design an access control-based smart contract to constrain the behavior of each user. In order to further strengthen the relationship between producers and consumers, the concept of prosumer is used to enable consumers to participate in trading activities as energy producers.The experimental results are proved that the proposed solution works successfully in the blockchain, with timely responses between prosumers and consumers, good execution time and the admission of access control provides better market efficiency.