The lack of security in Internet of Things (IoT) infrastructure across different applications has attracted the attention of researchers to work on IoT security issues. The paper presents a scenario where blockchain technology is combined with IoT to provide a decentralized security mechanism. Secure authentication and Key-Agreement technique are proposed for IoT nodes and peers to ensure proper authorization before communication can take place. The proposed protocol uses public key cryptography to generate a shared symmetric key for mutual authentication and two-party conversation. The protocol was tested using Scyther and was found to be robust enough to withstand all known authentication-related attacks, including replay, and typing attacks. Hyperledger, a blockchain technology, was employed to provide a more efficient IoT-enabled infrastructure for the scalability of IoT devices on the network. The proposed technique provides a secure and scalable system for device authentication in a blockchain-enabled IoT environment.