Blockchain security and privacy for the internet of things