Recent studies have revealed serious security breaches in the Internet of Things (IoT) devices. Today’s architecture does not guarantee an adequate level of security, so attacks on data authenticity and integrity are among the top concerns when dealing with IoT-based environments. In this context, the objective of this work was to develop an ontology model for Blockchainbased IoT (BIoT) that ensures an adequate level of security. We implemented an ontology-based middleware that represents semantic knowledge. BIoT is independent of application context and protects against reported attacks from the fundamentals of blockchain networks. Initially, we built, through the hypothetical-deductive method, a BIoT model based on particular domain ontologies. We then interact between IoT devices and security ontologies and blockchain network concepts to capture characteristics. We then performed performance tests (sandbox); bench testing with Zigbee devices (testbed); knowledge base assessment; and research with experts through a questionnaire and semi-structured interviews to evaluate the proposal. We still adopt security criteria against possible known attacks in the literature. Thus, the ontology provided insight into security properties to monitor vulnerabilities in the IoT ecosystem and blockchain network structure, thereby ensuring data integrity, confidentiality, and privacy. Through the collected information, the BIoT model was built that presented the following advantages: adequate time processing; decentralized architecture, less susceptible to attack; presence of a stable network, even with the increase in the number of nodes, and consequently the packet traffic; possibility of improving the efficiency of data integrity verification; and increased availability of processing and memory resources for specific need environments. Thus, the model can be considered a promising alternative.