Abstract
The distributed electricity trading market constitutes an essential component of the new-type power system, wherein peer-to-peer (P2P) trading serves as a prominent mechanism. However, the advancement of P2P electricity trading faces significant impediments, including security vulnerabilities, information asymmetry, and an underdeveloped credit evaluation system throughout the transaction process.This paper proposes a blockchain consensus mechanism and methodology for peer-to-peer electricity trading. First, an access mechanism for the electricity trading resource pool is designed to construct an credit rating decision tree, thereby ensuring the security and trustworthiness of transaction nodes. Second, a smart contract based demand-response mechanism is designed, allowing prosumers to submit trading requirements and time constraints based on their operational conditions, so as to guarantee the timeliness of transactions.Third, a multi-criteria objective function with priority-based consensus and a dynamic weight adaptation algorithm are constructed. By incorporating user behavior as a key metric, malicious activities are mitigated, enabling on-chain autonomy. Consensus is achieved by minimizing the deviation between demand targets and response matching values, thereby facilitating production-consumption balance. Finally, the proposed consensus method was empirically validated in a lab environment, by conducting performance benchmarking and analysis on the blockchain, this study demonstrates its validity and practicality. It aims to provide novel research methodologies and solutions for peer-to-peer electricity trading.