Scaling the Internet of Things with Blockchain