The study will shed light on the proposed system of WSN security for the sensor data transmission using the blockchain. The system will be presented according to the research and practical implications of the blockchain systems. The paper proposes a method for enhancing the data security of wireless sensor networks based on blockchain technology which makes the transfer data of the system challenging to be tamped. The aimed system utilizes a hash value representation calculated by the Merkel-tree algorithm. We offer a particular method of constructing a hash function from a compression function. This construction has the property that the resulting hash function satisfies desirable security properties, such as collision resistance, given that the compression function does. Moreover, the proposed system will implement the most secure algorithms that help to ensure better security for the WSN systems to transmit data.