Increasing protection and autonomy in the IoT through a two-tier blockchain framework