The Advantages and Challenges of the Blockchain for Smart Grids