Blockchain-Based Authentication with Optional Privacy Preservation for Internet of Vehicles

With the rapid development of the mobile internet and intelligent technology of in-vehicle equipment, the Internet of Vehicles (IoV), centered on intelligent connected cars, has gradually entered people’s lives. However, these technologies also bring serious privacy risks and security issues in terms of data transmission and storage. In this article, we propose a blockchain-based authentication system to provide vehicle safety management. +e privacy and security attributes of various vehicle authentication transactions are based on high-level cryptographic primitives, realizing temporary and formal authentication methods. At the same time, a fair blockchain consensus mechanism Auction of block generation Rights (AoR) is proposed. To demonstrate the feasibility and scalability of the proposed scheme, security and performance analyses are presented. +e relevant experimental results show that the scheme can provide superior decentralized management for IoV.


Introduction
In recent years, as a potential technology, the Internet of Vehicles [1] has attracted great attention, bringing a better life to human beings. It can be applied in the fields of logistics and transportation. According to a report [2] from the World Health Organization on road safety, in 2018, a total of 1.35 million people died in traffic accidents worldwide, and traffic accidents are the number one killer in the 5-29 age group.
e Internet of Vehicles can solve such problems well. is is just one example of many applications of the Internet of Vehicles.
e Internet of Vehicles usually consists of a large number of static basic settings and dynamic vehicles as the main participants in the system. It is equipped with advanced in-vehicle sensors, controllers, actuators, and other devices and integrates modern communication and network technologies to realize the information exchange and sharing between vehicles and vehicles, roads, and service providers. It has complex environmental perception, intelligent decision-making, and collaborative control and performs other functions. e purpose of the Internet of Vehicles is to avoid unnecessary traffic accidents and congestion. e ultimate goal is to provide a comfortable driving experience including autonomous driving and in-vehicle entertainment. e Internet of Vehicles technology system mainly includes the automotive sensor, automotive wireless communication, automotive navigation, electronic map and positioning, vehicle-mounted Internet of ings terminal, intelligent control, massive data processing, data integration, intelligent transportation technology, video surveillance, and mobile communication network. It differs from other types of network application scenarios; thus, all these technologies complement each other and cooperate to achieve. e future of the Internet of Vehicles system will face the requirements of system function integration, dataset quantification, and high transmission rate.
With the gradual evolution of closed-loop information services to IoV services and the close integration of vehicle, road, and surrounding environmental data, the Internet of Vehicles will more effectively reduce the incidence of car accidents and provide a safer, more economical, and more convenient travel service. On the Internet of Vehicles, the vehicle must periodically broadcast the identity, current location, speed, and other related information of the traffic vehicle to all vehicles around it. Malicious vehicles can obtain the private information (identity, location, etc.) of the vehicle driver by analyzing the relationship between the message and the sender. is poses a potential threat to the privacy of vehicle users, increases the risk of data leakage and may potentially affect the safety of vehicle occupants [3,4].
Authentication is considered the first line of defense against malicious vehicles and messages [5][6][7]. It is the basis for the security of all other applications of the Internet of Vehicles in the open traffic environment. Identity authentication includes the verification of the legitimacy of the identity of the connected vehicles, to ensure the authenticity of the identity of the communicating parties. At the same time, it is necessary to protect the privacy of users through anonymity [8][9][10]. erefore, the automotive industry needs to establish more secure authentication methods to avoid this risk. e characteristics that need to be considered in the identity authentication of the car network are as follows: (1) Due to the fast-moving speed of the vehicle and the limited coverage of the roadside unit (RSU), high real-time identity verification is required.
(2) e environments in the IoV vary widely, with diverse application scenarios and performance differences between devices. Transaction processing may be delayed. erefore, such realistic factors need to be considered to build a fair authentication environment so that vehicles can have equal opportunities to be authenticated.
e Internet of Vehicles currently uses centralized facilities, Public Key Infrastructure (PKI), or trust authority (TA) to perform the authentication mechanism. e disadvantage is that the centralization of the authentication node leads to heavy tasks and attacks on the central node.
ese shortcomings can cause data leakage of sensitive user information. Besides, the centralized facility is not suitable for the wide and complex geographically distributed IoV and high real-time requirements.
To address the issue, some scholars [11][12][13] use blockchain [14] to develop a decentralized scheme, which provides a secure way of managing vehicle registration. Some review articles [15][16][17][18] believe that blockchain can provide a boost to the Internet of ings. e essence of the blockchain is a distributed ledger database of a peer-to-peer (P2P) network. A complete blockchain system includes technologies such as data encryption, digital signatures, and timestamps, as well as consensus algorithms to support P2P and maintenance systems, mining, and anonymous transactions. e blockchain can also be applied in many fields [19][20][21][22][23] with its unique security mechanism.
In this paper, we propose an identity authentication system for IoV. Our system utilizes the following advantages of the blockchain: (i) We use the common private key, public key, and address based on elliptic curve cryptography (ECC) in the blockchain to achieve anonymous security authentication, without the need to construct other cryptographic primitives. (ii) Based on the decentralization nature of blockchain, trust management can be conducted among distributed RSUs, which can effectively avoid the problem of centralization. To sink a large number of vehicle registration functions, reduce the delay of neutralization, and reduce security risks. (iii) We assign different node roles to vehicles and facilities and make the best use of them and enable RSUs to work together and maintain a consistent blockchain, and the vehicle node ensures that the basic information of the vehicle is maintained.
us, the key contributions of this paper can be summarized as follows: (1) For high real-time requirements, we propose a decentralized vehicle registration with TA providing authentication keys for each RSU. (2) We achieve optional privacy-preserving authentication for diverse scenarios. It includes short-term temporary authentication and long-term formal authentication. (3) We propose a fair consensus mechanism to equalize the opportunity to process things on different devices and ensure that vehicle information can be treated equally. e rest of this paper is organized as follows: Section 2 describes the related work. Section 3 describes the overall design. We present the system performance evaluation results in Section 4. Contrastive analysis is discussed in Section 5. Section 6 concludes this paper and presents some future work.

Related Work
In the traditional solution, a completely trusted neutral server is required. Such a central server is easily a target for attackers. Moreover, it is not suitable for deployment in scenarios where a large number of vehicles participate, and a large amount of data will bring high latency or even congestion. To deal with such problems, decentralized solutions have gradually become a research focus.
By using the tamper-proof, hash-encrypted features of blockchain technology, a decentralized and trusted identity can be defined as a set of keys used to prove the source and validity of the information. ese keys are directly controlled by the principal with this identity. With the help of the consensus mechanism, this identity based on the blockchain can be effectively published and recorded.

Asymmetric Encryption Technology.
In 1976, Diffie and Hellman proposed the concept of an asymmetric cryptosystem [24], that is, a public-key cryptosystem, which created a new direction in cryptography research. e asymmetric encryption algorithm is relative to the symmetric algorithm. e difference between the two is reflected in whether the key can be disclosed. e symmetric key requires the same key to be used in the encryption and decryption process, while asymmetric encryption can provide a pair of keys. e private key is kept by yourself, and the public key can be made public. e common symmetric encryption algorithms are DES, 3DES, AES, and IDEA, and the common asymmetric encryption algorithms are RSA, D-H, and ECC [25]. e security of the blockchain is provided by cryptography. In many blockchain projects, asymmetric encryption algorithms are mainly used at the account level. In the symmetric encryption algorithm, because both parties need to share the key in advance, there are many inconveniences in the use process. e emergence of asymmetric algorithms solves this problem. Take Bitcoin [26] as an example. e Bitcoin address is converted from the public key, and the public key is converted from the private key. All user information is protected by a randomly generated private key.
Since the content of each block in the blockchain is open to the entire network, privacy protection is an important issue. e blockchain represented by Bitcoin uses the wallet address generated by the public key hash to externally represent the input and output process of the transaction which brings such a benefit: the public key is generated by a random private key. Only by relying on the public key hash, it is impossible to know who caused the transaction. e relationship between blockchain keys and addresses is shown in Figure 1. e owner of the private key is the only representative of the transaction generated by the corresponding address, but no one knows who the true private key holder is.

Consensus.
e word consensus comes from Latin, meaning "agreement, accord," which in turn comes from consentire, meaning "feel together." Its meaning and usage relate to both a generally accepted opinion and the conclusion of a decision based on a collective agreement.
In an isolated system, the system always develops in disorder, and the same is true for information systems. However, this feature is not suitable for its use. To deal with this feature, the consensus mechanism has become an important choice. Consensus issues require multiple processes (or agents) to agree on single data [27]. Some processes (agents) may fail or be unreliable in other ways, so the consensus protocol must be fault-tolerant or flexible. e process must propose its candidate values in some way, communicate with each other, and reach a consensus on individual data. e consensus problem is basic in controlling multiagent systems [28]. One way to reach consensus is to get a majority of all processes (agents) to agree. In this case, the majority requires at least more than half of the available votes (where each process is voted). However, one or more wrong processes may bias the final result, which may lead to failure to reach a consensus or a wrong consensus.

Evolution of Consensus in the Internet.
From the perspective of the development of the consensus mechanism, its development process is closely related to the process of network evolution. is section will sort out the development process of the network and consensus mechanism, clarify the relationship between the two issues, and find out the possible development direction of the future consensus mechanism. e Internet is a complex that has been evolving rapidly. From different perspectives such as history and technology, it can be divided into different stages. After synthesizing the scale and structure of the network, Table 1 divides the development of the Internet into five phases and reveals the development trajectory of the consensus mechanism. e surge of intelligent Internet between 5G and artificial intelligence (AI) will be achieved in the 2020s, which is the most worthy of imagination. With the emergence of new business types and requirements such as the Internet of Vehicles, Internet of ings, Industrial Internet, 4K/8K, and AR/VR, the future network is appearing in a ubiquitous trend. It expects that the intelligent Internet will build an essential framework for a smart society in the future.
For the consensus mechanism, it is necessary to combine the specific requirements and application scenarios to implement adaptive settings for specific services [29,30]. At this stage, increasingly or increasing various devices will become the main body of consensus. Decentralization makes the relationship between nodes equal. How to reach a fair and effective consensus is an inevitable problem. e following content of this article will clarify our consensus mechanism, which combines incentives and penalties to ensure its stable operation.

Blockchain Consensus Algorithm.
In the decentralized network structure, there are no fixed nodes to manage transactions on the blockchain. erefore, it is necessary to regularly allocate accounting rights from all mining nodes according to certain rules. At the same time, to achieve order from unnecessary to order and achieve entropy reduction, a certain amount of energy is inevitable. Since the blocks in the blockchain are generated at a certain time interval, in the interval phase, the transaction needs to be temporarily stored in the transaction pool. After the accounting node is selected in the network, the transaction is retrieved and  Mathematical Problems in Engineering packaged according to certain rules. After the packaging is completed, the results will be broadcasted and passed to other nodes for verification, and, finally, a consensus will be reached. e more classic blockchain consensus algorithms are shown in Table 2.
On this basis, many new algorithms based on the aforementioned consensus mechanism have emerged. Proof of activity [31] is a combination of PoW and PoS. It has been developed in the wake of an assumption based on an economic phenomenon called "Tragedy of the Commons." Practical Byzantine Fault Tolerance (PBFT) [32] is designated as more efficient than PoW in terms of latency and energy consumption, and it can only tolerate up to 33% of malicious nodes. Liu et al. [33] developed a novel consensus mechanism called Proof of Collaborative Work.
In the Internet of Vehicles, participants have a large number of devices with substantial differences, and they are easily affected by external environments such as regions and communication environments. Traditional consensus algorithms have insufficient transaction processing capabilities. ere has also been some new consensus mechanism for the Internet of Vehicles [34,35]. Nodes or devices with superior resources are in an advantageous position in the blockchain, which is prone to the phenomenon of the winner winning forever.

System Overview
In the ecosystem of the Internet of Vehicles, it is necessary to consider a large number of participants and the susceptibility to real factors such as geographic area and communication environment. e traffic system in the environment of the Internet of Vehicles is a complex system in which various parts are intertwined and interact with each other. It is necessary to pay attention to related safety issues such as the reliability and effectiveness of the system. e factors that need to be considered for the safety of the Internet of Vehicles are shown in Figure 2.

System Model.
In this section, we will demonstrate the system model. Figure 3, the system consists of the following parts:

As shown in
(1) Traffic management center (TC) is the highest authority on the Internet of Vehicles. It is connected to the roadside unit (RSU) and is mainly responsible for the registration of traffic participants and core information processing. e permanent identity and temporary identity of the vehicle are directly or indirectly related to the TC. It is considered completely credible and able to complete the work according to the design without being compromised by the adversary. As a complete node of the blockchain, it generates genesis blocks. It is responsible for mining and issuing and uploading various equipment official certificates to the blockchain ledger.
(2) Roadside units (RSUs) are distributed at intersections and on both sides of the road to generate vehicle access, identity verification, and other related matters. RSUs are considered as the edge computing node [36] that hosts the blockchain.
(3) Vehicle (V) is a general term for all types of vehicles driving on the road and represents the main participants of the network, namely, intelligent vehicles. Each vehicle can maintain its blockchain account and accompanying public and private key pairs and addresses on the blockchain. However, there are differences in computing power between different manufacturers and different types of in-vehicle devices.
(4) e operation of the blockchain relies mainly on four components: encryption algorithm, transaction processing, consensus algorithm, and distributed ledger technology. Using the encryption algorithm in the blockchain, a unique public-private key pair and wallet address are generated for each participant of the Internet of Vehicles.
Assume that all devices can protect their private keys from being obtained by others.
For vehicle information, we classify it as follows: Among them, general information includes license plates, models, brands, and colors, and sensitive information includes car owner information and vehicle identification number (VIN).

Proposed
Overall Architecture. In this scheme, the main objects are devices on the Internet of Vehicles, including the aforementioned traffic management center, roadside units, and vehicles. Assume that every device can run the blockchain client and can protect its account.
In the initialization phase of the system, each device needs to run a blockchain client, complete the initialization   Mathematical Problems in Engineering of the blockchain, and generate basic blockchain information (public key, private key, address, etc.). e specific process is as follows.

Transportation Equipment Establishment Stage.
After TC and RSU enter the Internet of Vehicles system supported by blockchain, the device will generate unique public and private key pairs and wallet addresses as part of its information. en, Roadside unit RSU i encrypts its attribute information (device serial number, location coordinates, etc.) with pk TC , signs on it, and sends it to TC to apply for a device certificate. When Tc receives an identity application request from RSU i , it first verifies the digital signature of the application information. After verification, TC designed the authentication key for RSU i k i � u i |(u i , v i ) � pk TC sk RSUi mod p , encrypting (k i , address i ) with the public key of RSU i and writing it to the blockchain as the certificate of the RSU i after TC signature.
It is worth noting that a timestamp is attached to the transaction after it is written to the blockchain, which ensures the traceability of the transaction. is can also be used to manage and maintain certificates.

Vehicle Equipment Establishment Stage.
When a vehicle enters the Internet of Vehicles ecosystem for the first time, the registration needs to be completed for easy management. erefore, it is necessary to apply to the Internet of Vehicles to obtain identification. Considering that the process of writing a transaction to the blockchain takes a nonnegligible time, in response to this, we design a type of temporary certificate to facilitate the timely connection of vehicles before the vehicle is officially certified. e process of generating a temporary certificate is as follows: (1) RSU i broadcasts its signed identity certificate periodically. (2) e vehicle j receives the broadcast information; it uses the public keys of TA and RSU i to verify the legitimacy of the identity. (3) If the signature is legal, it is determined that the RSU i is credible, and the vehicle encrypts its attributes (attributes consist of two parts: general information authentication is encrypted with pk RSUi , and sensitive information is encrypted with pk TC ). (4) e vehicle signs the information and sends it to RSU i . RSU i verifies the signature, and it can decrypt the general information, perform preliminary authentication, and issue a lightweight temporary certificate (address V j || timeliness || addressRSU i || RSU i signature). e validity period of the certificate must be greater than the time it takes for things to be written on the blockchain. (5) After receiving the temporary certificate, the vehicle verifies the signature and uses it as a temporary identity in the system to participate in the operation and maintenance of the system. (6) RSU i encrypts the general attributes of the received vehicle with the key k i and attaches the encrypted sensitive information and a temporary certificate as a blockchain transaction. After completing the consensus agreement, it will be written into the blockchain.
As the complete nodes of the blockchain, RSU and TA are jointly maintained and can read and write data on the blockchain. e process of generating a formal certificate is as follows.
(1) TA gets the transaction generated by the RSU i in the blockchain. (2) TA completes the decryption of the data and verifies the data signature. What we need to highlight here is � pk RSUi sk TC mod p}. (4) is ensures that TC and RSU can calculate the same key without revealing their private key. (5) Decrypt and verify the data. en, TC issues a formal certificate (address V j || timeliness || TA's signature) to the vehicle to complete the formal registration and certification. TC writes it into the blockchain as a transaction.
e notations in this paper are summarized in Table 3.

Fair Consensus Mechanism.
We propose a consensus mechanism AoR, dedicated to the consortium blockchain. e commissioners maintain the blockchain.

Role Classification of Blockchain Nodes.
ere are three roles in the consensus mechanism: Ordinary node (U): as the fundamental aspect of blockchain, they use cryptography to verify their identity and use the signature to verify their information sent. Ordinary nodes can join or leave the network without restriction. ey are not permitted to participate in the block generation process directly but can "observe" the entire consensus process. ey also can be involved in the process of block distribution and message forwarding and get a small number of online credit rewards. Commissioners (C): different commissioners form the committee and maintain a consortium blockchain jointly. e commissioners exercise equal rights and obligations, reviewing bidders and organizing auctions, and verifying and forwarding blocks and transactions. A new block generated in the blockchain will be sent to all commissioners for verification signature. When a block receives at least 51% of the commissioners' approval, it will add to the blockchain as valid. e commissioners will be rewarded. e result of the vote will be the choices of all commissioners. Bidder (B): in each round of auction, the ordinary node is required to submit a deposit within the specified time. e bidder competes for the right to generate the new block. Within the specified time, the bidder is ranked by the auction mechanism to determine the vendee (V). At the same time, the vendee's credit for the transaction price is used to reassign to the online nodes, and a block is generated in the blockchain. After completing the task, the vendee receives the corresponding reward.

Consensus Process.
e AoR consensus assumes that the number of ordinary nodes is N u , the number of commissioners appointed from ordinary nodes is N c , and each auction interval is T w . e vendee is determined within time T a , and a new block needs to be generated within the time T b , T a + T b ≪ T w . e valid block records the whole process of the auction transaction and gets (N c /2) + 1 commissioners' signature at least. is process is known as a round of consensus. If no valid block is generated within T b , it means that the original vendee has given up the right to generate the new block and the second highest bidder will generate the block as a winner and so on. As long as one bidder can work properly, the network can achieve a consensus finally.
Generating a new block requires the following steps: S1. At the beginning of the chain, all nodes are assigned a certain amount of participation credit, and all nodes can trade each other and generate signed transaction data. At the same time, they verify the transaction data.
If the transaction data are valid, they will forward the transaction data to the commissioners. e online task will be assigned a credit bonus after each round of the auction. S2. All commissioners monitor the transaction data and store the legal data in the transaction pool. S3. e vendee takes the valid transactions from the transaction pool and packs them into a block, sending the block to all commissioners. e block's deadline is S4. After receiving a raw block, the commissioner verifies the data in the block. If the commissioner approves this block, it shall sign for confirmation. After receiving at least (N c /2) + 1 signatures, the vendee obtains the timestamp information of the NTP server. If the timestamp is earlier than T newblock , the block will be signed by the vendee and published on the network. e committee accepts the vendee's credit and allocates it. If the timestamp is later than T newblock , it means that the new block cannot be generated efficiently. e vendee will be replaced by the auction mechanism, and the specified task should be completed within the new deadline T newblock � T newblock + T b . e former vendee who failed to complete the task will be liable. is mechanism prevents nodes from poor performance and malicious motives. S5. After receiving the valid block, the vendee deletes the illegal transactions from the transaction pool. Moreover, all nodes wait for the time T w to start the next round of the auction.
In particular, if T newblock > T w , it means that all bidders cannot complete the generation of the new block in time, or the network has truncated. In this article, we assume that the above situation does not transpire. e various relationships of the characters are given in Figure 4

Experiments and Performance Analysis
In the scheme mentioned in this article, the system security is based on the difficult problem of the elliptic curve discrete logarithm problem (ECDLP). Each device node participating in the Internet of Vehicles can generate its private key, public key, and address according to the protocol and can use TA's public key to generate an encryption key.

Safety Analysis
(i) e adversary cannot get the private key of the IoV device: Any node, including the adversary, can collect the public keys and system parameters of all nodes in the scheme, which is also a prerequisite guarantee for the use of blockchain. As mentioned earlier, we assume that any node can protect its private key from being acquired by an adversary. e adversary cannot calculate the encryption key. If the adversary calculates the private key of the node through the public parameters and public key, it violates the difficult problem of ECDLP. erefore, the probability of the adversary compromising in our scheme is negligible. (ii) e anonymity of the vehicle: Whether it is a temporary certificate or a formal certificate, it only contains the blockchain address of the vehicle and does not contain any information e private information of the vehicle is encrypted with the public key of the TC. As long as the private key of the TC is not exposed, the private information of the vehicle can only be obtained by the TC. (iii) Sybil attack protection: In a network, the attacker simulates the existence of multiple entities (devices), that is, a single node has multiple identities. ese entities send erroneous information to the server or management application weakening the role of redundant backup. In our design, each object can only have one formal certificate at a given time, and each identity can only have one key pair. Every communication message must be signed by the private key associated with this identity. Moreover, all formal identities must be approved by the traffic management center, so attackers cannot use forged identities.
(iv) DoS/DDoS protection: Denial of service (DoS) or distributed DoS (DDoS) attacks are characterized by an explicit attempt by the attacker to prevent legitimate use of the service [37]. Since DoS/DDoS does not need to identify and utilize protocol or service flaws, they are highly efficient for any type of service and are therefore the most dangerous network attack. e decentralized architecture of the blockchain makes it powerful against DoS/DDoS attacks. e data on the blockchain is redundant and distributed on different nodes. Even if an attacker manages to stop one node, it cannot stop all other nodes. In addition, transactions in the blockchain require a certain cost, which prevents an attacker from sending a large number of transactions to attack.

Consensus Fairness Analysis.
Based on the auction mechanism and the consortium blockchain, this paper proposes a new consensus model. e consensus mechanism needs a trade-off between performance, fairness, and security. Our model will guarantee fairness on the premise of blockchain security. In the following, we will analyze the fairness and effectiveness of AoR.
Suppose that N nodes share B credits N > 3, and Nc represents the number of committees considered; t � 0, 1, 2 . . . , T is the index of the period. At time t, the credit of node i is represented by b i,t . Assume that the total credits are distributed equally among the participating nodes in the initial stage. at is, for any node, b i0 � B/N.
During the operation of the blockchain, the credit updates of different nodes are as follows: x v,t represents the amount of credit used by Vendee v at a time t, α is the proportion of the auction price, and β is the proportion of Commissioner's commissions and satisfies α + β � 1.

Proposition 1. At any given moment t, the sum of credits assigned to each node is certain.
Proof. At t � 0, the sum of node credits is initialized to Considering the previous assumptions, no node in the system carries credits away, and no new credits are generated in the life cycle. erefore, the sum of credits of each node remains constant, B.
is method can prevent some nodes from occupying the generation right for a long time. Because spending credit x v,t means that other nodes will have a higher credit budget at a time t + 1. is movement of credit guarantees fairness among nodes. Proof. Consider the extreme case. At time t � 0, all credits belong to node i, b i0 � B (actually b i0 < B). Other nodes have zero credit.

Proposition 2. At any time t, for any two nodes i and j,
After the node i completes the first auction, the x i transaction value is at most B, and node j gets the credit b j � (B/N). To minimize x j , it assumes that node j never bid. Node i can collect up to b i � (N − 2/(N − 1) 2 )B before the next bid.
After the second round, x i receives up to (N − 2/(N − 1) 2 )B.
And so, (2) . e time-averaged expenditure credit difference between any two nodes is is means that the sum of credits for all nodes' expenditures tends to be the same. No node can spend more credits and take the dominant position. e aforementioned ensures fairness between nodes.

Encryption and Signature Performance.
We conducted experiments on a 1.9 GHz processor, Intel Core i5 with 12 GB RAM, and Windows 10 running in python3.7 to study operating costs. Figure 5 depicts the time-consuming signature and verification, encryption, and decryption. e average time consumption of signature and verification is 9.6 ms and 0.34 ms. e average time consumption of encryption and decryption is 182.6 ms and 62.8 ms. It can be found that signature and encryption take more time than verification and decryption. However, the above operations are tolerable in terms of time consumption.

Consensus Algorithm Analysis.
In this part, the simchain (https://github.com/YaoyaoBae/simchain) is used to evaluate the time consumption. As described in Section 3, we simulated 200, 500, and 1000 nodes participating in the generation of blockchain 40 times and compared the consensus mechanism we designed with PoW under the same conditions. Figure 6 depicts the time it takes for nodes to reach a consensus. Figures 6(a)-6(c) depict the consensus system time consumption for 200, 500, and 1000 node scales, respectively. In PoW, it takes a long time to solve the hash puzzle, so we assume that 20%-60% of the nodes randomly participate in each round. However, in the AoR simulation, only a brief bid is submitted in each round of consensus, and we assume that all nodes participate. For each scale, we perform 40 experiments. In all three cases, AoR takes much less time than PoW. Figure 6(d) describes the consequences of AoR in networks with various node quantities. e collection and validation of transactions and the selection of the bid order by the ledger manager consume some time costs. Besides, these tasks are influenced by the size of the network.

Comparison with Related Work
e advancement of the Internet of ings technology has promoted the development of the Internet of Vehicles with autonomous vehicles and roadside infrastructure as the main components. IoV aims to provide innovative services for different traffic equipment through adaptive traffic management and to improve traffic safety and efficiency. In this section, we compare the functions of our scheme with the existing schemes.
A paper [4] proposes an efficient and practical pseudonymous authentication protocol with conditional privacy preservation. It expects an honest-but-curious behavior from otherwise fully trusted authorities. e proposed protocol protects a user's privacy until the user honestly follows the protocol. In case of malicious activity, the true identity of the user is revealed to the appropriate authorities. e authors proposed a new identity-based (ID) signature based on the elliptic curve cryptosystem (ECC) and employed it to propose a new conditional privacy-preserving authentication scheme based on the ID-based signature they invented [38]. e scheme provides a secure authentication process for the information transmitted between the vehicle and the RSU. In [3], Azees et al. propose an efficient anonymous authentication scheme to avoid malicious vehicles entering the VANET. Besides, the proposed scheme offers a conditional tracking mechanism to trace the vehicles or roadside units that abuse the VANET. As a result, the scheme revokes the privacy of misbehaving vehicles to provide conditional privacy computationally efficiently, through which the VANET entities will be anonymous to each other until they are revoked from the VANET system. Javaid et al. [12] proposed a blockchain-based protocol for IoV using smart contracts, physical unclonable functions (PUFs), certificates, and a dynamic Proof-of-Work (dPoW) consensus algorithm. e blockchain with smart contracts provides a secure framework for registering trusted vehicles and blocking malicious ones. PUFs are used to assign a unique identity to each vehicle via which trust is established. Certificates are issued by roadside units that preserve the privacy of vehicles, whereas the dPoW consensus allows the protocol to scale according to the incoming traffic generated by the vehicles. e authors introduced an efficient, reliable, and privacy-preserving scheme based on blockchain for VSNs [13]. In their scheme, a pseudonym mechanism is employed to achieve individual anonymization by concealing the vehicles' identity. To encourage vehicles to report trustworthy information, incentive punishment mechanism is proposed. Meanwhile, they propose a multifactor and single-factor weight-based evaluation mechanism to evaluate the reliability of the message. Practical Byzantine Fault Tolerance (PBFT) and blockchain are also employed to achieve consensus and store records, respectively, which can prevent malicious entities from manipulating vehicles' reward scores and credit scores.
To summarize, Table 4 describes the studied works. From the table, we can find that our scheme is used in a variety of scenarios and more comprehensive and suitable for IoV.

Conclusions
e latest development of the Internet of ings has promoted the evolution of the Internet of Vehicles. IoV aims to provide new and innovative services for different modes of transportation through adaptive traffic management to improve traffic safety and efficiency. However, due to the actual untrusted environment, establishing trust in IoV is a critical security issue. erefore, we proposed an authentication with optional privacy preservation. In our scheme, we mainly consider two situations. One situation is that the vehicle temporarily enters the system, and the scheme is designed for temporary authentication. Another situation is that the vehicle has been participating in the Internet of Vehicles for a long time, and the program has been designed for formal certification. In the authentication process, the scheme inherits the decentralized, credible, and tamperproof characteristics of the blockchain. At the same time, the certificate uses the cryptographic primitives in the blockchain, without using a new one. Furthermore, we design a new consensus mechanism that provides a fair chance for nodes in the blockchain to obtain bookkeeping rights. Security analysis and experimental results show that our scheme is efficient and secure for IoV devices.
In future work, we consider using aggregation technology [39] and coordination control [40] to process data to facilitate the use and transmission of data. For a wider range of Internet of Vehicles applications, we will consider upgrading the chain structure [41,42] of the blockchain to reduce the resource consumption and transaction processing time of the blockchain.

Data Availability
No additional data were used to support this study.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.