Skip to main content
. 2023 May 29;23(11):5173. doi: 10.3390/s23115173
Algorithm 1 PBFT Consensus for Block Addition in Blockchain by Cloud Server
  •   1:

    Input: Block (Blockm as shown in Figure 3, transactions pool (Txpol), transactions threshold (Txthresh=t, number of CS nodes: ncs, minimal approval (Minapprove=2(ncs1)/3+1)

  •   2:

    Output: Commitment for block addition (CMP)

  •   3:

    Assume that a cloud server node (CSl) is elected as a leader

  •   4:

    CSl picks a fresh timestamp and creates a block Blockm with Txpool

  •   5:

    CSl sets CMP=NULL and sends Blockm to follower cloud server nodes (CSk(kl|k=1,2,,ncs)) for voting request

  •   6:

    for each follower CSj do

  •   7:

       if ((Txj=valid) and (MR=valid) and (ECDSA.sigTx=valid) and (CBHash=valid)) then

  •   8:

         Set CMP=CMP+1

  •   9:

       end if

  •  10:

    end for

  •  11:

    if (CMPMinapprove) then

  •  12:

       Add Blockm to the blockchain

  •  13:

       Broadcast commitment message to CS

  •  14:

    end if