The establishment of Vehicular Ad Hoc Networks (VANETs) has brought significant advantages to humans, yet it also raises crucial safety considerations. Security is one of the major challenges in VANETs and is receiving significant attention. Hostile Onboard Units (OBUs) can use a variety of tactics including blocking, monitoring and tampering to harm neighboring OBUs to make illicit profits. The widespread use of the decentralized architecture built around blockchain technology has enabled the clear, safe, and dispersed storage and transmission of VANET application-related information without the need for an administrative center of authority. Perhaps the most important parts of the blockchain-driven VANET system involve implementing an efficient and adaptable consensus system, which remains an open academic issue. The objective of the suggested solution is to create a deep learning model for blockchain that will guarantee VANET security. This network topology is comprised of three layers: “perception, edge computing, and services”. The initial layer that comprises the blockchain operation is employed to demonstrate the privacy of VANET information. Additionally, cloud-based services as well as edge computing are used by the perception layer. The data is safeguarded by the service layer through the application of the blockchain system and storage in the cloud. The last layer aids in meeting user criteria for throughput and QoS. The main objective of this model is to evaluate the reliability of vehicle nodes maintained on the blockchain. Here, the node authentication is handled by an Adaptive Dilated Gated Recurrent Unit (AD-GRU), where the hyper-parameters of the recommended AD-GRU model are optimally tuned by an Enhanced Osprey Optimization Algorithm (EOOA). Finally, the proposed system is simulated and its extensive results are carried out. In contrast with other approaches, the novel system delivers the superior results of securing the data over the VANET environment.