Cost-Effective Blockchain-based IoT Data Marketplaces with a Credit Invariant