In this paper, we propose a system that improves the data integrity of IoT(Internet of Things) devices in the virtual environment by combining Hyperledger Indy and MQTT(Message Queuing Telemetry Transport). The system complements the limitations of the centralized system by realizing a DPKI(Decentralized Public Key Infrastructure) structure that utilizes a distributed network in publish-subscribe(pub/sub) pattern communication. Digital signature technology was applied to ensure the data integrity of IoT devices and communication scenarios between the four core components of the client, IoT device, broker, and blockchain, as well as a topic structure using a decentralized identifier to ensure safety in the virtual environment. We present a systematic method for transparent data exchange. To prove the performance of the proposed system, this paper conducted experiments on four scenarios and evaluated communication performance in a virtual environment. The experimental results confirmed that the proposed system provides a reliable IoT data communication structure in a virtual environment.