With recent advancements made in wireless communication techniques, wireless sensors have become an essential component in both data collection as well as tracking applications. Wireless Sensor Network (WSN) is an integral part of Internet of Things (IoT) and it encounters different kinds of security issues. Blockchain is designed as a game changer for highly secure and effective digital society. So, the current research paper focuses on the design of Metaheuristic-based Clustering with Routing Protocol for Blockchain-enabled WSN abbreviated as MCRP-BWSN. The proposed MCRP-BWSN technique aims at deriving a shared memory scheme using blockchain technology and determine the optimal paths to reach the destination in clustered WSN. In MCRP-BWSN technique, Chimp Optimization Algorithm (COA)-based clustering technique is designed to elect a proper set of Cluster Heads (CHs) and organize the selected clusters. In addition, Horse Optimization Algorithm (HOA)-based routing technique is also presented to optimally select the routes based on fitness function. Besides, HOA-based routing technique utilizes blockchain technology to avail the shared memory among nodes in the network. Sensor nodes are treated as coins whereas the ownership handles the sensor nodes and Base Station (BS). In order to validate the enhanced performance of the proposed MCRP-BWSN technique, a wide range of simulations was conducted and the results were examined under different measures. Based on the performance exhibited in simulation outcomes, the proposed MCRP-BWSN technique has been established as a promising candidate over other existing techniques.