This paper proposes a novel trust-based cooperative system to facilitate efficient Wi-Fi network access trading to solve the network congestion problem in a beneficial manner for both service providers and customers. The proposed system enables service providers to improve their users' application performance through a novel cooperative Access Point (AP) association solution. The system is based on a Software-Defined Wireless Network (SDWN) controller, which has a global view of users' devices, requirements, and APs. The SDWN controller is supported by Smart Contracts (SCs) as code of law, to liaise control among service providers according to the terms of their mutual agreements. Evaluation results in dense Wi-Fi network environments show how the system can significantly improve the overall performance for the cooperating network. Specifically, the results have been compared against the standard AP association approach and other centralised algorithms dealing with the same problem, in terms of the data bit rate provided to the users' stations (STAs), Quality of Experience (QoE), bandwidth and energy consumed by the APs.