Software-Defined Networking (SDN) and Blockchain are leading technologies used worldwide to establish safe network communication as well as build secure network infrastructures. They provide a robust and reliable platform to address threats and face challenges such as security, privacy, flexibility, scalability, and confidentiality. Driven by these assumptions, this paper presents an optimized energyefficient and secure Blockchain-based software-defined IoT framework for smart networks. Indeed, SDN and Blockchain technologies have proven to be able to suitably manage resource utilization and to develop secure network communication across the IoT ecosystem. However, there is a lack of research works that present a comprehensive definition of such a framework that can meet the requirements of the IoT ecosystem (i.e. efficient energy utilization and reduced end-to-end delay). Therefore, in this research, we present a layered hierarchical architecture for the deployment of a distributed yet efficient Blockchain-enabled SDN-IoT framework that ensures efficient cluster-head selection and secure network communication via the identification and isolation of rouge switches. Besides, the Blockchain-enabled flow-rules record keeps track of the rules enforced in the switches and maintains the consistency within the controller cluster. Finally, we assess the performance of the proposed framework in a simulation environment and show that it can achieve optimized energy-utilization, end-to-end delay, and throughput compared to considered baselines, thus being able to achieve efficiency and security in the smart network.