With the recent advancements in the Internet of Things, cloud computing has emerged as an important industrial technology that assists in various data analysis operations. However, the remote locality of cloud servers and scalability issues of cloud computing make it unsuitable for real‐time computing‐intensive applications. Fog computing strives to support cloud computing in meeting scalability demands by providing location‐sensitive services closer to end devices. With decentralized heterogeneous resource capabilities, fog architecture can handle several computation‐intensive and delay‐sensitive user requests. Although deploying service providers in an untrustworthy environment makes it challenging to assess the trustworthy acquired services. Conspicuously, in this article, we present a trusted task offloading and resource allocation using blockchain technology. To start with, we analyze direct and indirect trust with a subjective logical aggregation approach using a distributed trust assessment approach. Additionally, we examined the various quality of service parameters and constructed a smart contract that utilizes the state‐of‐the‐art deep reinforcement learning algorithm, namely Deep Deterministic Policy Gradient, to maximize fog revenue while serving as many user requests as possible. The entire process from task generation to results calculation is assisted by blockchain and offloading task transactions are stored in the secure, immutable, and tamper‐resistant ledger. To assess the effectiveness of our proposed scheme, we compared the simulation results with other baseline schemes over different performance metrics in terms of reward, service latency, energy consumption, task drop ratio, and transaction success rate. The results suggest that enabling trust computation improves transaction success by 21%.