Ensuring security and privacy in IoT environments is a critical concern due to the prevalence of intrusions. Federated learning (FL) has emerged as a prominent technology for intrusion detection without compromising data privacy. This study proposes a novel model called BlockFL-IDS (Blockchain-based Federated Learning for Intrusion Detection System) that combines blockchain and deep learning approaches for effective intrusion detection. The BlockFL-IDS model consists of three key processes: efficient client selection, secure channel selection, and federated learning-based IDS. To streamline the complexity of federated learning, we employ Auction game theory to select efficient clients based on metrics such as trust, energy, bandwidth, and network conditions. Furthermore, we employ the Base Criterion Method (BCM), a multicriteria decision-making algorithm, for secure channel selection. BCM evaluates multiple criteria, including noise, path loss, channel quality, stability, trust, and fading, resulting in improved accuracy and reduced data loss in intrusion detection. For federated learning, we utilize the Optimized Back Propagation-based Deep Belief Network (OB-DBN), enabling the generation of both local and global models. The edge server generates local models, extracting packet-based features from client data for intrusion detection. Cloud servers aggregate these local models to create global models stored in a circular-based regression tree structure to enhance scalability and reduce retrieval time. The proposed OB-DBN algorithm calculates backpropagation error, facilitating loss reduction and weight updates. To evaluate the performance of the BlockFL-IDS model, we implement it using the NS-3.26 network simulator and assess its effectiveness using various performance metrics. Through our research, we aim to address security and privacy concerns in IoT environments, providing an innovative solution that enhances intrusion detection while preserving data privacy.