The burgeoning proliferation of IoT networks has underscored the pressing need for robust and secure data sharing mechanisms. The existing methods for data sharing in IoT networks exhibit certain limitations, notably in terms of energy efficiency, speed, throughput, packet delivery ratio, and overall consistency. These limitations have sparked the demand for innovative solutions that can mitigate these issues effectively. To address these limitations, the paper proposes an advanced model that harnesses the power of Analytic Hierarchy Process (AHP) based Smart Contracts, fortified with Genetic Algorithm optimized Sidechains, within the blockchain framework. This integration synergizes the strengths of blockchain technology and machine learning, offering a robust foundation for secure data sharing in IoT networks. The advantages of this approach are manifold. By leveraging AHP and Smart Contracts, the model ensures the precision and reliability of data transactions. The incorporation of Genetic Algorithm optimized Sidechains optimizes the scalability and efficiency of the system. Consequently, the proposed model exhibits a remarkable 4.9% improvement in energy efficiency, a 5.5% boost in speed, an 8.3% increase in throughput, an 8.5% enhancement in packet delivery ratio, and a 3.9% better consistency compared to existing methods. The impacts of this work are profound. It not only addresses the current limitations of IoT data sharing but also paves the way for more efficient, secure, and reliable data exchange in IoT networks. This innovation holds the potential to revolutionize the IoT landscape, offering a robust solution that can unlock new possibilities for a wide range of applications, from smart cities to industrial automation sets.