| As global attention towards sustainable energy and the widespread application of microgrid technology increases,traditional microgrid power trading models reveal a series of challenges in terms of security,efficiency,and fairness.Simultaneously,blockchain technology,with its decentralized nature,security,and transparency,offers new possibilities for addressing these issues.This paper proposes a novel energy trading system based on smart contracts,targeting the current challenges in microgrid power trading.Existing research has achieved some progress in microgrid power trading but still faces issues such as insufficient data privacy protection,high risks of centralized organization control,and unsatisfactory transaction efficiency.This study,based on an in-depth analysis of current research,proposes two key technical solutions:a blockchain-based identity authentication mechanism and a novel energy trading method based on smart contracts.In terms of identity authentication,this paper adopts Attribute-Based Encryption(CP-ABE)technology,IPFS(InterPlanetary File System),and smart contracts to ensure user privacy protection while implementing highly secure identity registration,authorization,and revocation processes.Through the analysis of privacy and non-forgeability,this scheme is proven to possess a high level of security.In terms of novel energy trading,this paper proposes a power trading scheme based on constant function automated market maker(AMM)algorithms.This scheme leverages blockchain technology and smart contracts to realize a decentralized trading process,reducing manipulation and abuse risks.The constant function market maker algorithm can calculate buying and selling prices in real-time,improving transaction efficiency.Moreover,this model features excellent scalability and security,contributing to the growing demand for microgrid scale and user numbers.The novel energy trading system based on smart contracts proposed in this paper fully utilizes the advantages of blockchain technology,Attribute-Based Encryption technology,and constant function market maker algorithms.It exhibits significant advantages in terms of security,transaction efficiency,scalability,and fairness,filling the gaps in existing research.Through the innovative design presented in this paper,a new solution for the development of microgrids and renewable energy sectors is provided. |