## 4 Modified Blockchain Model
### The Proposed Algorithm
#### 4.6.3 Preliminaries and Notations  
As shown in Algorithm 2, the blockchain process starts with node \(N_{i}\), which mines \(T_{i}\) transactions to validate them, and then fills a new block \(B_{i}\) with the validated transactions considering the block size _Bsize_. Indeed, there are three kinds of transactions and, consequently, three kinds of blocks (Lines 9-29). Then, nodes compete to find hash and propose a new block using FPoS (Lines 31-33). Next, the blockchain algorithm assigns the validator group _voters_ according to the kind of block using _validator_size()_, then casts the block (Lines 34-35). As mentioned earlier, according to the block type, validators have different levels of validation processes (Lines 37-44). They cast their votes (Line 45), which are either 1 for correct or \(0\) for not correct, as shown in Algorithm 3. In Algorithm 4, upon receiving the votes, the consensus decision is made according to the votes of the majority to commit the new block and either add it to \(L_{i}\) or abort it. ```
1.//Initialization:
2.L;//Thecurrentledge
3.T;//Transaction
4.B;//Thecurrentblock
5.Bsize\(\leftarrow\)x;//xisanintegerrepresentingtheblocksize
6.Proposingstage:
7.//Create\(B_{i}\)
8.//Foranynode\(N_{i}\):decideswhatkindsoftransactionstovalidate;
9.Switch(\(T_{i}\)):
10.CaseTrustedT1:
11.For\(j=0\)to\(0\)j<Bsize
12.if(valid\_TrustedT1==True)
13.TrustedT1\(\rightarrow\)Block1;
14.\(B_{i}\)\(\rightarrow\)Block1;
```  
**Algorithm 2**Modified Blockchain Algorithm (Proposing)```
15 break;
16 Case TrustedT2:
17 Forj = 0 to j < Bsize
18 if(valid TrustedT2 == True)
19 TrustedT2\(\rightarrow\)Block2;
20 B\({}_{i}\)\(\rightarrow\)Block2;
21 break;
22 Case T:
23 Forj = 0 to j < Bsize
24 if(valid T == True)
25 T\(\rightarrow\)Block;
26 B\({}_{i}\)\(\rightarrow\)Block;
27 break;
28 default:
29 exit(0);
30 // After B\({}_{i}\) is created, hash B\({}_{i}\), use FPoS, decide validators group and cast B\({}_{i}\)
31 \(B_{i}\)\(\rightarrow\)hash();
32 While((B\({}_{i}\)\(\rightarrow\)FPoS()) == false)
33 Wait();
34 validator_size(B\({}_{i}\));
35 Cast(B\({}_{i}\));
```

**Algorithm 2**_Cont._

```
36 // According B\({}_{i}\) Kind determines the level of validation, then vote
37 Case\(B_{i}\)\(\rightarrow\)TrustedT1:
38 Low_validation();
39 break;
40 Case\(B_{i}\)\(\rightarrow\)TrustedT2:
41 Normal_validation();
42 break;
43 default: // When B\({}_{i}\)\(\rightarrow\)T
44 high_validation();
45 Vote(0);
```

**Algorithm 3**Modified Blockchain Algorithm (Voting)

```
46 // According to the vote of majority \(B_{i}\) is added to \(L_{i}\) or is aborted
47 if(majority()== True)
48 message(Commit);
49 B\({}_{i}\)\(\rightarrow\)\(L_{i}\)
50 else
51 message(Abort);
```

**Algorithm 4**Modified Blockchain Algorithm (Consensus)

## 5 Experimental Results

In this paper, the blockchain procedures are modified according to the guidance of the results of the healthcare specifications. The experiment focuses on a modified blockchain for healthcare, which relaxes blockchain procedures for some blocks. As mentioned earlier, the modified blockchain has three kinds of blocks depending on what kind of transactions are in the block. The experiment simulates traditional blockchain procedures and modified blockchain procedures. It compared the performances of both, focusing on total execution time. The experiment was run on OS-Window 10 using Java as the programming language and an Intel Core (TM) i7 CPU, with 2.90 GHz and 4 GB (RAM). Every test was run for five times, and the average is shown. ### Execution Time

In fact, the experiment created 12,000 transactions, including 6000 read transactions and 6000 update transactions. The read transactions were divided into three categories: _TrustedT1_ (2000 transactions), _TrustedT2_ (2000 transactions), and \(T\) (2000 transactions); the same categories are applicable to the update transactions. After the execution of the transactions, the blockchain procedure was executed to verify the transactions and store the verified ones in a blockchain ledger.