## 1 Introduction
### Blockchain  
The idea of blockchain is proposed by [PERSON] in 2008 via a white paper. It is introduced as an underlying technology for bitcoin cryptocurrency. Bitcoin is also known as the first application of blockchain. The blockchain technology is used to secure the financial transactions of digital currency by eliminating the central authority. Blockchain is a networking technology, where nodes are directly connected to each other in a Peer-to-Peer (P2P) manner. It has eliminated the concept of centralization through consensus mechanisms. Decisions in the network are made after the consensus among all nodes. Furthermore, blockchain is also known as a distributed ledger technology. Ledger contains the record of transactions made in the network, and is distributed over all nodes. In Figure 1, the basic blockchain structure is presented. Figure 1: Basic Blockchain Structure. Moreover, blockchain contains several features that enhance its significance over traditional transaction systems. The features of blockchain that make it more efficient and reliable are security, scalability, immutability, and anonymity [9; 10]. The aforementioned properties and features of blockchain technology increase its demand significantly. Therefore, the applications of blockchain are also increased in various fields. For example: it is being integrated with IoT and vehicular networks [11]. Other uses of blockchain technology are: Artificial Intelligence (AI), economy, transportation, health, identity management, supply chain management, and smart contract services [12]. Major features of blockchain that make it distinct from existing systems are:  
1.1.1. Ledger  
The ledger in blockchain records all transactions that are made in the networks. Blockchain is known as a distributed ledger technology, in which ledger is distributed over all network nodes. Transactions include: financial, health-care, business-related transactions, etc. 1.1.2. Smart Contract  
Blockchain technology eliminates the involvement of third-party through smart contracts. Smart contracts are written computer programs. All rules for transaction between two parties are defined in smart contracts. The transaction cannot be done until all the agreements in smart contract are fulfilled. Whenever any transaction is to be made in the blockchain-based networks, smart contract is triggered automatically [13; 14]. 1.1.3. Consensus Mechanism  
The ledger is distributed over all nodes in the network. It is necessary to keep the record synchronized. To maintain data consistency in blockchain, several consensus mechanisms are used. The concept of single authority is also eliminated by consensus mechanisms. Decisions in the network are made after agreement between majority nodes. Moreover, the consensus mechanisms used in blockchain technology include: Proof of Work (PoW), Proof of Concept (PoC), Proof of Authority (PoA), Proof of Stake (PoS), Practical Byzantine Fault Tolerance (PBFT), etc. 1.1.4. Cryptography  
Cryptography brings security to the whole network. The cryptographic techniques are used in blockchain to make the data and transactions more secure and tamper-proof. Blockchain uses several cryptographic methods such as: hashing techniques (Secure Hash Algorithm-256 (SHA-256), Keccak256), digital signatures (Rivest-Shamir-Adleman (RSA), Digital Signature Algorithm (DSA), Elliptic Curve Digital Signature Algorithm (ECDSA)), and encryption techniques (Attribute-Based Encryption (ABE), Data Encryption Standard (DES)), and many others [15; 16]. Due to the rapid progress of blockchain technology, its usage is increasing. It is used in almost every field. Therefore, the blockchain-based data sharing and access control system is used to provide authenticated and trustworthy sharing and access control of IoT devices' data. Sharing of data is done between two peers, which are: subject (request sender) and object (service provider). Smart contracts are used to manage data sharing and access control. Furthermore, behavior of the users is also monitored.