Alchemy University Ethereum Developer Bootcamp Week one course begins with an overview of blockchain and crypto.
Disclaimer: Most of the content below is a general summary and retelling of the information from the course.
The blockchain is the protocol connecting a network of machines. Each network machine or "node" will run the written code.
The blockchain enforces these rules or codes, a "smart contract".
"The purpose of the blockchain is to have a network of computers agree upon a common state of data". A person or organization may participate in this process, but they can't control it.
A generally used term, consensus, describes a network agreeing on the state of the data.
The most common use case for blockchains is cryptocurrency.
Bitcoin was the first successful blockchain and cryptocurrency.
Bitcoin works by using all these components together:
- Proof of Work (Security)
- Mining Rewards (Financial Incentives)
- Public Key Cryptography (Authentication)
- Linked Data Structure (Chronology)
- Peer-to-Peer Network (Permissionless)
When exchanging money between individuals, trust is usually needed to ensure the money is given/received. The blockchain was invented as a solution for trust between individuals or groups.
In 2008, an unknown person or persons under the pseudonym Satoshi Nakamoto released a whitepaper on Bitcoin. It described "a system that would create a peer-to-peer network for exchanging value".
The paper describes a chain of blocks tied together cryptographically, or blockchain.
Smart contract blockchains allows developers to decentralize where the code runs.
Decentralization isn't about the code, but how the code is executed. When the code is compiled and deployed to a decentralized blockchain, it is a smart contract. The code becomes publicly available on the blockchain, and the network nodes will enforce the code logic through the financial incentives of the blockchain protocol.
Before cryptocurrency, there was crypto.
Two key primitives to keep in mind for blockchain development are Cryptographic Hashes and Public Key Cryptography.
"A hash function is a function which takes an input of any size and turns it into a fixed size output."
The input can be any data type: number, image, video, string, etc.
Cryptographic hash functions need five specific properties:
- Deterministic - One specific input always maps to the same specific output
- Pseudorandom - It is not possible to guess the output based on the output of similar inputs
- One-way - If someone gives you a new output, you could not determine an input without guessing
- Fast to Compute - It must be a quick calculation for a computer
- Collision-resistant - The chance of a collision should be infinitesimally small
Two important use cases for Hash functions for blockchain developers are Commitments (Protocol & Smart Contracts) and Proof of Work.
For blockchains, having a unique, fixed-sized representation of output regardless of input size is critical for saving space.
Alchemy University: Ethereum Developer Bootcamp