The emergence and growing use of advanced technologies have opened up new possibilities for addressing the security challenges of resource-constrained IoT networks. As IoT devices exchange sensitive data, secure key management is essential for IoT network security, particularly during the key revocation phase. However, current IoT key management solutions require improvements due to the resource limitations of IoT devices. Despite these limitations, existing key revocation solutions still have several areas for improvement, including high communication overheads. Therefore, a decentralized and efficient solution is necessary to address these issues in IoT networks, with a focus on security. This paper proposes a new solution for key revocation based on Blockchain technology using smart contracts to minimize communication overhead and energy consumption in IoT networks. The paper presents a security and performance analysis to assess its correctness. The results indicate that our proposal outperforms other solutions by having a reduced communication overhead of 93.55\%, 91.87\%, and 99.75\% compared to other solutions during the compromising, leaving, and draining cases, respectively. This demonstrates that our solution is efficient and suitable for IoT networks.