## 3 Related Work  
In [3, 4], OCF provides a specification for the firmware update process from the OCF device to the manufacturer (external server). However, their protocol does not have security protection because they only discuss simple check-new-update interactions between the OCF device and the external server. Specifically, there is no step to ensure the integrity of the firmware update in the OCF protocol. To ensure the update file's integrity, we can simply modify the protocol by including checking of the firmware package signatures. However, we introduced blockchain in the OCF firmware update protocol. By using blockchain technology, peer-to-peer firmware update becomes possible. Thus,  
Figure 1: OCF firmware update protocol, adapted from [3] (from top-left to bottom-right).  
IoT devices can share the available newest update through IoT gateways. Then, they can check the integrity and validity of the update to the blockchain network. As the gateways provide update distribution on behalf of the manufacturer, single-point-of-failure is prevented, and firmware update availability is increased.  
Our proposed protocol is specific for the OCF firmware update process. However, we also compare our proposed protocol to the other paper about the general IoT firmware update that utilizes blockchain. [PERSON] and Lee [PERSON] and [PERSON] (2018) proposed a blockchain-based secure firmware update for embedded devices in an IoT environment. This method gives some possibility to check the firmware version before the update begins, which one has a higher or lower version. However, this will later give redundancy checking that may cause unnecessary network traffic and computational power consumption and operations for the nodes. Besides, the method only provides showcases for firmware updates from one manufacturer instead of the various manufacturers. In fact, many IoT devices from various manufacturers will exist in an IoT environment. Therefore, this firmware update framework does not apply to a heterogeneous IoT environment. [PERSON] et al. proposed the other scheme of blockchain technology for firmware update ([PERSON] et al., 2018). There are innocuousness checking nodes that acknowledge the transaction before the IoT device can download and install it. Therefore, it delays the update operation.  
These previous two solutions use Bitcoin technology. In Bitcoin, it takes around 10 min to verify a transaction and create a new block. For Ethereum, the average time for one block creation is 10-20 s ([PERSON] et al., 2018). Time is an essential factor when distributing a newer version of firmware to the IoT devices. Moreover, developers can utilize smart contracts in Ethereum to build a decentralized application because smart contracts will execute when the conditions are met. In the case of firmware updates' distribution, each version of firmware released by the device's manufacturer will be recorded in the smart contracts. When devices want to download the new firmware, they can verify it through the smart contracts. Furthermore, Ethereum provides a lightweight node for constrained and low capacity devices that cannot afford to store multiple dozen Gigabytes of blockchain data ([PERSON] et al., 2018; [PERSON] et al., 2018).  
[PERSON] et al. (2018) also proposed a firmware update protocol based on blockchain. Their protocol was designed based on Ethereum. They provide direct and indirect firmware update distribution. However, in their scheme, they process the received messages without verification, which means that there is a possibility that the adversary can send the messages, or the adversary can modify the messages.