Research Article

Blockchain-Enhanced Fair and Efficient Energy Trading in Industrial Internet of Things

Algorithm 1

Energy trading contracts.
Input: seller’s account, buyer’s account, number of energy transactions q, amount of energy transaction M
Output: trading results
 (1)Freezing of deposits
 (2)Lock transaction balance
 (3)if transaction down
 (4)release seller()
 (5)
 (6)else if transaction break
 (7)if seller break
 (8)
 (9)
 (10)else if buyer break
 (11)
 (12)
 (13)end if