The rapid development of the smart grid brings convenience to human beings. It enables users to know the real-time power supply capacity, the power quality, and the electricity price fluctuation of the grid. However, there are still some threats in the smart grid, which increase all kinds of expenses in the grid and cause great trouble to energy distribution. Among them, the man-made nontechnical loss (NTL) problem is particularly prominent. Recently, there are also some NTL detection programs. However, most of the schemes need huge amounts of supporting data and high labor costs. As a result, the NTL problem has not been well solved. In order to better avoid these risks, problems such as tampering of smart meter energy data, bypassing the smart meter directly connected to the grid, and imbalance between revenue and expenditure of the smart grid are tackled, and the threat scene of NTL is constructed. A hierarchical grid gateway blockchain is proposed and designed, and a new decentralized management MDMS system is constructed. The intelligent contract combined with the elliptic curve encryption technology is used to detect the storage and the acquisition of power data, and the detection of NTL problems is realized. At the same time, it has a certain ability to resist attacks such as replay, monitoring, and tampering. We tested the time consumption and throughput of this method on Hyperledger Fabric. At the same time, eight indexes of other methods proposed in the literature are compared. This method has a good effect.