Since IoT devices are strengthened, edge computing with multi-center cooperation becomes a trend. Considering that edge nodes may belong to different center, they have different trust management model, it’s hard to assess trust among edge nodes. In this paper, we take blockchain to coordinate differences among centers, construct a trust environment for transactions in IoT. In detail, we propose a blockchain based identity management for IoT to ensure identity is credible, then design a transaction model to provide certification for IoT transactions. And, we take machine learning methods to analyze IoT transaction log, thus decide trust nodes or not. Experiment results show that our mechanism could effectively identify trustworthy edges in IoT.