The smart grid revolution has brought numerous benefits to the energy sector, such as improved efficiency, increased renewable energy integration, and enhanced grid management. The reliance on digital communication within smart grid systems has introduced new security challenges that must be addressed to ensure reliable and secure operation. The existing communication infrastructure often lacks the necessary security measures to protect against cyber threats, which leads to potential vulnerabilities and privacy breaches. This paper presents a novel approach to enhancing smart grid communication by integrating Software-Defined Networking (SDN) and Blockchain technology. Therefore, the proposed work aims to address the specific communication needs of smart grids, which require secure and real-time data exchange between various grid components, including power generation units, substations, distribution networks, and end consumers. The proposed framework provides data integrity, communication and network security, and controller privacy.