Conventional homes have grown to be smart homes (SM) with the assistance of the Internet of Things (IoT). A unified gateway connects all Internet-enabled devices. Those gateways need to be secured by the usage of a sturdy safety method due to the fact safety is very vital. In order to conquer those problems, this observation shows employing Blockchain Technology (BC) for secured houses to make certain information private and safe. To cope with the safety problem with SH gateways, this paper proposes a solution. A reliable Q-learning algorithm with Blockchain assistance is proposed for the SH gateway to save data. three sections make up the protocol Q Learning Algorithm with Blockchain Support (QLABS). First, a Lattice cryptosystem based on Cipolla’s extended Euclidean distance algorithm is used to record and store user data (CEED-LC). Second, while preserving data secrecy and integrity, the proposed cryptosystem offers a small Key Generation (KG) with excellent security. Third, with the assistance of QLABS protocol agreement, the blocks are created with a specific gateway enrolment-ID. The testing results demonstrate how highly safe the suggested framework is against the vulnerabilities by obtaining a higher throughput along with a higher Packet Delivery Ratio (PDR) value. The results show that the recommended approach tops other existing algorithms in terms of PDR and throughput. © 2023, Taru Publications. All rights reserved.