# DSVN: A Flexible and Secure Data-Sharing Model for VANET Based on Blockchain
## 1 Introduction  
Vehicle-to-vehicle communication across shorter distances is made possible by the vehicular ad hoc network (VANET), a particular kind of mobile ad hoc networks (MANETs) [1]. VANET can help drivers get status information and real-time road condition information from other vehicles within a certain range [2, 3, 4]. However, VANET may expose users' private information, e.g., identities, location information, and trajectories. Once that shared private information is illegally used by malicious attackers, it will lead to terrible information security. Therefore, how to store and share VANET data safely is a research hotspot. Fortunately, the emergence of blockchain technology has addressed the problems above. Blockchain is decentralized, transparent, a consensus mechanism, and tamper-proof. [5, 6, 7]. It maintains the security of data and punishes malicious attackers for VANET. Currently, there are two types of blockchain-based VANET data-sharing schemes. The first type, the data is completely uploaded to the blockchain [8, 9, 10], and each node synchronizes the block data in real time. This strategy is not appropriate for large-scale data storage scenarios. The other, the data is kept on a cloud server, but transactions are recorded on the blockchain [11, 12]. Such schemes cannot avoid single failure spots. To eliminate this failure, we store metadata on the InterPlanetary File System (IPFS), eliminating the high overhead and low efficiency of data storage resources on the blockchain. IPFS uses distributed storage and allows nodes to retrieve and store data as backups, avoiding single points of failure. In addition, access control provided by a trusted third party cannot satisfy VANET data on the cloud server. This mechanism limits the flexibility of data sharing and has security concerns. It has become a new challenge to provide fine-grained access controlfor data-sharing scenarios. The primary method of implementing data access control is encryption. However, conventional encryption schemes cannot satisfy the access control needs in the VANET scenario. For instance, it is challenging to provide decryption keys to the desired data access users when using the Advanced Encryption Standard (AES) [13]. Before encrypting the data using the RSA encryption algorithm, the owner must collect the public key from each user. New users cannot access data that has been encrypted [14]. Attribute-based encryption (ABE), suggested by [PERSON] et al., allows for precise access control over encrypted data [15]. Depending on the objects connected with the access control policy, ABE is further separated into ciphertext policy attribute-based encryption (CP-ABE) [16] and key policy attribute-based encryption (KP-ABE) [17]. Compared with KP-ABE, CP-ABE is more suitable for dynamic scenes. Therefore, most of the schemes supporting fine-grained access control in VANET are based on CP-ABE. In VANET, the user's attribute set is dynamic. Various circumstances may cause the user's attribute set to change. For instance, [PERSON] works as a traffic cop in the supervisory division. He is transferred outside of his department due to a change in position. The \"supervisory department\" in user [PERSON]'s attribute set needs to be removed. In the traditional CP-ABE approach, the user's attribute set is immutable. When the user's attributes need to be modified, CP-ABE can only re-register after deleting the user. This method of processing adds overhead and is not safe during processing. We build a KEK tree based on the user set to manage the rights of different users. When revoking a specific user attribute, the revoked user updates its key while other users are unaffected. In response to the security issues in VANET data sharing, we design a data-sharing model for VANET (DSVN). First, we build a collaborative network of consortium blockchain and IPFS with RSUs as nodes [18], a distributed storage network. The model ensures the tamper-proof and integrity of shared information through a blockchain consistency mechanism.