A systematic review of the literature is presented related to the usage of blockchain technology (BCT) for cyber-threats in the context of Industry 4.0. BCT plays a crucial role in creating smart factories and it is recognized as a core technology that triggers a disruptive revolution in Industry 4.0. Beyond security, authentication, asset tracking and the exchange of smart contracts, BCTs allow terminals to exchange information according to mutually agreed rules within a secured manner. Consequently, BCT can play a crucial role in industrial sustainability by preserving the assets and the environment and by enhancing the quality of life of citizens. In this work, a classification of the most important cyber-attacks that occurred in the last decade in Industry 4.0 is proposed based on four classes. The latter classes cover scanning, local to remote, power of root and denial of service (DoS). BCT is also defined and various types belong to BCT are introduced and highlighted. Likewise, BCT protocols and implementations are discussed as well. BCT implementation includes linear structure and directed acyclic graph (DAG) technology. Then, a comparative study of the most relevant works based on BCT in Industry 4.0 is conducted in terms of confidentiality, integrity, availability, privacy and multifactor authentication features. Our review shows that the integration of BCT in industry can ensure data confidentiality and integrity and should be enforced to preserve data availability and privacy. Future research directions towards enforcing BCT in the industrial field by considering machine learning, 5G/6G mobile systems and new emergent technologies are presented.