Emerging Technologies and Security
Blockchain
Distributed ledgers, how they work and where they help.
- 7 notes
- 54 minutes of reading
What is a blockchain?
A blockchain is a shared record of transactions that is copied across many computers instead of being kept by one company. Each computer, called a node, holds the same list. New entries are added in groups called blocks, and once a block is accepted it is very hard to change. That is why a blockchain is often called a tamper-evident ledger.
How blocks link together
Every block contains its transactions, a timestamp and the hash of the block before it. A hash is a short fingerprint of data: change even one character and the fingerprint changes completely. So if someone edits an old block, its hash changes, the next block no longer matches, and every node can see the chain is broken. To agree on which new block comes next, the network uses a consensus method, such as proof of work (computers compete to solve a puzzle) or proof of stake (validators lock up coins as a guarantee of good behaviour).
What it is used for
- Digital currencies such as Bitcoin, where no bank is needed to confirm a payment.
- Smart contracts: small programs stored on a blockchain that run automatically when conditions are met, for example releasing a payment when goods arrive.
- Supply-chain tracking, so companies can follow goods from factory to shop.
- Digital certificates and identity records that can be checked without calling the issuer.
The main security risks
A blockchain protects its records well, but the people and programs around it are still the weak points.
- Stolen private keys. Whoever holds the private key controls the funds. Phishing, fake wallet apps and malware all target keys, and stolen funds are usually impossible to recover.
- Smart contract bugs. Code on a blockchain is public and hard to change, so a single bug can be found and exploited by anyone.
- Scams. Fake investment schemes, "guaranteed returns" and impersonation of support staff are far more common than attacks on the blockchain itself.
- 51% attacks. On small networks, a group controlling most of the computing power or stake can rewrite recent history.
- Privacy. Most public blockchains are pseudonymous, not anonymous. Every transaction is visible forever and can often be linked back to a person.
Where to start: work through the notes below in order. Begin with how blockchains and consensus work, then move on to wallets, keys and smart contract security.
- How blockchain works: blocks, hashes and chainsA plain explanation of the building blocks of a blockchain: hash functions, blocks, the chain of hashes, digital signatures, peer-to-peer copies and why tampering is hard to hide. 7 min · Beginner
- Blockchain consensus: proof of work versus proof of stakeHow nodes in a blockchain agree on one history, how proof of work and proof of stake each make cheating expensive, their trade-offs, and the voting-based methods used in permissioned chains. 8 min · Intermediate
- Smart contracts: how they work and how they failWhat smart contracts are, how they run on a blockchain virtual machine, what they are used for, the most common security flaws, and the practices that reduce risk before and after deployment. 8 min · Intermediate
- Public, private and permissioned blockchainsThe differences between public, private, consortium and hybrid blockchains, what permissionless and permissioned mean, and how to decide which type, if any, fits a business problem. 7 min · Beginner
- Blockchain security: attacks and weaknessesThe main ways blockchain systems are attacked, from 51% and eclipse attacks on the network to smart contract bugs, bridge flaws, key theft and scams, with detection and defence for each. 9 min · Intermediate
- Blockchain use cases beyond cryptocurrencyRealistic, non-financial uses of blockchain such as supply chain traceability, verifiable credentials and document timestamping, the problems they solve, their limits, and a simple test for deciding if a blockchain fits. 7 min · Beginner
- Wallets, keys and protecting digital assetsWhat a blockchain wallet really stores, how recovery phrases and hierarchical deterministic keys work, the difference between hot, cold, custodial and non-custodial wallets, and practical ways to protect keys. 8 min · Beginner