The data collected by sensors in the Internet of Things (IoT) plays a crucial role in achieving predictive analysis, resource optimization, and other related applications. However, its vulnerability to network attacks during transmission raises the issue of data authenticity, which hinders its utilization. Data authentication technology can be used to address this puzzle. Nevertheless, current solutions still need improvement in terms of security and efficiency. The centralized authentication schemes may suffer from a single point of failure or center corruption. Existing decentralized solutions only achieved individual authentication, which is not efficient in the distributed collection system. In this work, we present a new decentralized batch data authentication approach, named blockchain-assisted efficiency and secure data authentication scheme (BAESDA), to enable distributed authentication of multiple sensors’ data at once. BAESDA integrates a novel data authentication protocol and a smart contract based on homomorphic hash. The novel data authentication protocol based on the hash chain is intended for sensors with limited computation, storage, and communication to ensure data authenticity and confidentiality, and enables the gateways to swiftly verify and aggregate the authentication messages. The data authentication contract is designed to efficiently achieve decentralized batch data authentication on the blockchain. Furthermore, the abnormal gateways can be identified by the proposed abnormal data detection algorithm. Finally, we conduct a thorough security analysis for BAESDA, evaluate the proposed authentication protocol through simulation experiments, and deploy the proposed smart contracts on the Hyperledger Fabric 2.4.1 for testing. The results indicate that our solution is secure and efficient.