A Blockchain-based Architecture for Stable and Trustworthy Smart Grid