  The paradigm of Internet of Things (IoT) is paving the way for a world, where
many of our daily objects will be interconnected and will interact with their
environment in order to collect information and automate certain tasks. Such a
vision requires, among other things, seamless authentication, data privacy,
security, robustness against attacks, easy deployment, and self-maintenance.
Such features can be brought by blockchain, a technology born with a
cryptocurrency called Bitcoin. In this paper, a thorough review on how to adapt
blockchain to the specific needs of IoT in order to develop Blockchain-based
IoT (BIoT) applications is presented. After describing the basics of
blockchain, the most relevant BIoT applications are described with the
objective of emphasizing how blockchain can impact traditional cloud-centered
IoT applications. Then, the current challenges and possible optimizations are
detailed regarding many aspects that affect the design, development, and
deployment of a BIoT application. Finally, some recommendations are enumerated
with the aim of guiding future BIoT researchers and developers on some of the
issues that will have to be tackled before deploying the next generation of
BIoT applications.
