The invention discloses a microgrid electric energy transaction method based on a master-slave intelligent contract, and the method comprises the steps: firstly, building a microgrid information physical system, carrying out the real-time monitoring and collection of system data, building a real-time electricity price model of an electric power transaction system stage, and marking transaction reference electricity prices in the master-slave intelligent contract; secondly, creating transactions among the intelligent nodes of the microgrid users according to actual supply and demand conditions,and signing intelligent contracts; and finally, enabling the transaction to achieve the consensus, enabling a blockchain cloud platform to automatically execute the smart contract, and writes the process data generated by the transaction into the block for storage to complete the transaction. The microgrid physical topology and the transaction cloud platform are efficiently interconnected. Real-time monitoring and cloud computing of each electric quantity of a microgrid user side are realized. By combining a physical infrastructure, an internet communication technology, a cloud computing technology and a block chain bottom layer technology, the electric power market electric power resource and price trend are intelligently analyzed, deployment and execution of an intelligent contract arecompleted and accurate and efficient execution of microgrid electric power market transactions is ensured.