## 1 Introduction  
Advancement in communication technologies and Artificial Intelligence has had a profound impact on the lives of people. Connected and Autonomous Vehicles (CAVs) are one such example. Connectivity and automated technology can shape the driving experience when CAVs will be capable of replacing humans. Other sister technologies such as advanced sensor networks, GPS, remote processing, and telecommunications networks can all be used to achieve the purpose. CAVs have the potential to reduce traffic accidents, improve modes of transportation and enhance quality of life [1]. They can bring a revolution to the locomotive industry. Researchers in the domain have highlighted many benefits and positive aspects of CAVs within the locomotive industry in general and in human life, including shortened distances not raising delay times, reduction in vehicle premiums, the smaller size of traffic departments, and reduction in emergency patients due to reduced traffic accidents [2]. CAVs are one of the applications of CPS within IoT, which have transformed the driving experience. They can provide a high level of safety and anticipate the traffic conditions on roads because of a high degree of autonomy, which reduces the burden on drivers [3]. CAVs use sensors and wireless sensor networks to obtain relevant traffic-related and other important data/information. The rising demand for CAVs brings along opportunities and challenges. The major challenges being observed in the realization of CAVs are security and privacy. Travelers' private data and communication between CAVs are valuable assets both for passengers and transportation companies to ensure secure traveling. People expect to keep their private data, such as vehicle registration numbers and the registration data of people who are known to the national certification authority and are responsible for the registration of vehicles and people, confidential. People are concerned about the privacy protection of their data during communication among different CAVs and infrastructure. Personal privacy is very easy to be hacked as an attacker can easily obtain access to users' information, such as text messages, phone numbers, call logs, etc. and even driving habits can be invaded [4]. Therefore, the first challenge to be faced by CAVs is that no one except the certification authority should have access to the private data of people and vehicles, to avoid tracking. The second challenge is to ensure that a valid vehicle can communicate with other CAVs with proof that it meets certain requirements without revealing its privacy. This will guarantee the security of the vehicles and the data being communicated. It is quite easy for the cyber attacker to temper and forge the communicated data, e.g., if the information related to the road condition is purposely forged by the attacker, it may be life-threatening to the security of the travelers [4]. Blockchain is considered a promising solution to the challenges and problems mentioned above as it has been applied in different scenarios, such as virtual currency, e-government, drug supervision, intelligent healthcare, etc. [5]. Blockchain is a distributed ledger of immutable transactions that builds trust among numerous least- trusted nodes without the involvement of a third party and ensures that all the nodes within the blockchain network verify and share data using a certain consensus algorithm [6]. Working with blockchain is quite simple. It works similarly to a peer-to-peer network where a user starts a transaction, and once done, a block is assigned to the transaction. This block is then broadcasted to the blockchain network, where all the nodes acquire the information. The block gets mined and validated and is added to the chain [7]. Smart contracts allow for the least trusted parties to communicate with each other by automatic verification of the scripts within the blockchain [8]. The first challenge will be addressed using blockchain in this research.