Fundamentals of Blockchain and Cryptocurrencies