Fundamentals of Blockchain, Cryptocurrencies, and Decentralized Finance