Blockchain technology is a distributed database and a public ledger. It records every transaction that has been made from its inception. Once entered, these records cannot be modified or erased. The technology utilizes various algorithms of a cryptographic nature to reach a consensus. These cryptograhic functions also ensure the integrity and authenticity of data that has been interchanged across the network. Because of these features, blockchain technology has been implemented into various financial and non-financial fields.
In this thesis, we introduce the mathematical foundations of Bitcoin, and different cryptographic functions that are used in Blockchain, especially elliptic curve multiplication. We construct two MATLAB models to study the fork events which is the one of typical consensus problems in the system. Moreover, we use graph theory and MATLAB models to represent and describe the Bitcoin protocols.