With the rapid development of distributed power and new energy technology, the number of electric vehi-cles and new energy generation users participating in power trading is increasing. Due to the randomness and uncer-tainty of electric vehicles and new energy, the existing trading model cannot support the trading demand. Block-chain has the characteristics of decentralization and non-tampering, which can effectively solve the challenges en-countered in vehicle-to-grid ( V2G) electricity trading. Based on blockchain technology, a transaction rule based on combinatorial auction and rolling aggregation transactions is first proposed and a rolling aggregation transaction model is subsequently designed. Then, based on the rules of the combinatorial auction and rolling aggregation trading mechanism, a smart contract for V2G electricity trading is designed. Finally, in order to verify the feasibili-ty of the scheme, the smart contract is published on the hyperchain blockchain platform allowing simulation experi-ments. The results show that the scheme proposed in this paper can improve the success rate of the transactions.