Research Article

IoT-Based Autonomous Pay-As-You-Go Payment System with the Contract Wallet

Algorithm 2

RegisterIoT.
Input: user EOA, IoT EOA, address of the control contract, company EOA, and user signature
Output: none
(1)Generate a hash (keccak256) of the user EOA, company EOA, and control contract address, concatenated in that order
(2)Decrypt the public key and EOA of the signer from the hash and user signature using ECDSA
(3)if decrypted EOA = = user EOA then
(4) Tie the IoT EOA to the control contracts and company EOA and insert it into the IoT registration list
(5) Emit the event
(6)else
(7) Error handling
(8)end if