Formal Security Analysis for Blockchain-based Software Architecture