With the deepening of the concept of low-carbon environmental protection, the use of renewable energy in social production has become more and more popular. More and more consumers in the distribution network have begun to change their identities to become consumers with the continuous reform of the electricity sales side. Electricity trading and settlement methods in the electricity market directly affect the relevant income of market entities, so a fair and reasonable settlement mechanism is an important factor for the normal operation of the electricity market. Electricity trading refers to the buying and selling of electricity commodities and services, including electricity trading, auxiliary service trading, and transmission rights trading. With the expansion of the electricity market, how to deal with the deviation of electricity is also a difficult problem that requires electricity settlement. This paper aimed to study the application of blockchain technology in the autonomous electricity transaction and settlement at the end of the distribution network. It was expected to use the blockchain technology to set up related transaction mechanisms, provide new solutions for electricity transaction and settlement, and improve the efficiency and fairness of electricity settlement. Blockchain technology does not rely on additional third-party management agencies or hardware facilities, and there is no central control. Except for the self-contained blockchain itself, through distributed accounting and storage, each node realizes information self-verification, transmission and management. On the basis of sorting out the principles of electricity balance and electricity price formation, this paper proposed a contract decomposition method with a higher degree of fit, and revealed the settlement principle of deviation electricity in the electricity market environment. Aiming at the application scenario of blockchain in the energy Internet, an energy trading platform based on blockchain was designed, and the test results showed the feasibility of blockchain in electricity settlement scenarios. The experimental results of this paper showed that in the traditional electricity purchase fee settlement, the average transaction price is stable at 0.6 yuan/KWh. In the blockchain settlement process, the electricity purchase is 25 yuan when the electricity purchase is 50 KWh. Therefore, blockchain settlement is used more frequently in the market, and the profits are higher.