Research Article

Design and Implementation of Ledger-Based Points Transfer System for IoT Devices in LPWAN

Algorithm 2

Optimized transaction request function
;               //The number of nodes
;                   //The ledger
;     //The candidates of received node ’s update block
;                 //Selected nodes
Data:, ,
Result:, ,
function ;
Receive requested transaction from the points transfer terminal;
if is not then
 Send to other nodes;
else
;
 Receive from other nodes;
end
if is not then
of in
of in
 Calculate candidates of new balances and based on blocks in ;
and
fortodo
  ifthen
   Receive as calculated candidate of new balances from other nodes;
  end
end
if not in then
  forto and not received do
   Forward ;
  end
end
 Calculate as a majority vote of ;
 Send approval results to the points transfer terminal;
end