Research Article

DAKEs: Decentralized Authenticated Key Exchange Protocols via Blockchain for Smart City

Algorithm 1

set
Input
1: require(users[iP].user == msg.sender);
2: if version ==1 then
3: users[iO].r[iC] = r; / Contract i /
4: end if
5: if version ==2 then
6:  users[iO].c = c; / Contract ii /
7: end if
8: if version ==3 then
9:  if 100 == type then
10:   users[iO].token1 = token1; / Contract iii /
11:  end if
12:  if 200 == type then
13:   users[iO].token2 = token2; / Contract iii /
14: end if
15: if 300 == type then
16:  users[iO].c = c; / Contract iii /
17: end if
18:end if