Доказательство работы
Майнинг и сложность
«Доказательство работы» — бесплатный урок Web3 & DApp Development Fundamentals на CoddyKit. Это урок 1 из 4. Ты можешь прочитать весь урок бесплатно ниже — а потом практиковать его прямо в браузере с встроенным редактором кода и ИИ-репетитором 24/7. Это часть пути обучения Web3 & DApp Development Fundamentals, и твой прогресс синхронизируется между веб-версией и приложением CoddyKit. Курс Web3 & DApp Development Fundamentals содержит 4 уроков всего.
Части этого урока еще не переведены и отображаются на английском.
The Consensus Problem
In an open network, anyone can propose the next block. How does the network agree on a single valid block without a leader?
Proof of Work (PoW) was the first practical answer, introduced by Bitcoin.
What Is Proof of Work?
Proof of Work requires miners to solve a hard computational puzzle to earn the right to add a block.
The puzzle is hard to solve but easy for everyone else to verify — an asymmetry that secures the chain.
The Mining Puzzle
Miners repeatedly hash the block header while changing a value called the nonce, searching for a hash below a target threshold.
Because hashing is unpredictable, the only strategy is trial and error.
target = 0x0000ffff...
loop:
hash = sha256(header + nonce)
if hash < target: SOLVED
else: nonce = nonce + 1The Nonce
The nonce is the field miners change on each attempt. Each new nonce produces a completely different hash thanks to the avalanche effect.
Finding a valid nonce can take quintillions of guesses across the whole network.
Difficulty
Difficulty controls how hard the puzzle is by setting how small the target hash must be. A smaller target means more leading zeros are required.
Networks adjust difficulty automatically to keep block times steady (about 10 minutes for Bitcoin).
Easy target: 0x00ffffff... (few zeros)
Hard target: 0x000000ff... (many zeros)
More zeros required = more workDifficulty Adjustment
If miners join and blocks come too fast, difficulty rises. If miners leave and blocks slow down, difficulty falls.
This self-tuning keeps the average block interval predictable regardless of total mining power.
Hash Rate
Hash rate measures how many hashes the network computes per second. Higher hash rate means more security, since attacking requires out-hashing everyone else.
Modern Bitcoin hash rate is measured in exahashes (10^18) per second.
Block Rewards and Incentives
Miners are rewarded with newly minted coins plus transaction fees. This block reward incentivizes them to spend real electricity securing the network.
Honest mining is more profitable than attacking, which aligns incentives with security.
The 51% Attack
If a single party controlled more than half the hash rate, they could potentially rewrite recent blocks — a 51% attack.
On large networks this is prohibitively expensive, which is precisely what makes PoW secure.
Energy Cost Trade-off
PoW's security comes from real-world energy expenditure, which critics call wasteful.
This concern motivated alternatives like Proof of Stake, which we cover next. PoW trades energy for battle-tested security.
Putting It Together
Proof of Work secures a blockchain by making block creation costly (mining) but verification cheap.
Difficulty keeps timing stable, rewards keep miners honest, and the sheer cost of hashing deters attacks.
Quick Check
Test your Proof of Work knowledge.
Recap: Proof of Work
You learned that:
- PoW makes miners solve a hard hashing puzzle
- The nonce is varied to find a hash below the target
- Difficulty auto-adjusts to keep block time stable
- Rewards align miner incentives with security
- A 51% attack is the main theoretical threat
Next: Proof of Stake.
Часто задаваемые вопросы
Урок «Доказательство работы» бесплатный?
Да — полный текст урока «Доказательство работы» бесплатно доступен здесь в веб-версии. Чтобы практиковать его интерактивно (встроенный редактор кода и ИИ-репетитор 24/7) и разблокировать остальной курс Web3 & DApp Development Fundamentals, подпишись на CoddyKit PRO. Курс Web3 & DApp Development Fundamentals содержит 4 уроков всего.
Чему я научусь в уроке «Доказательство работы»?
Майнинг и сложность Ты практикуешь Web3 & DApp Development Fundamentals с помощью реального кода, который запускаешь прямо в браузере, и ИИ-репетитор 24/7 отвечает на твои вопросы во время урока.
Нужен ли мне опыт, чтобы начать Web3 & DApp Development Fundamentals?
Предыдущий опыт не требуется. Web3 & DApp Development Fundamentals на CoddyKit структурирован для всех уровней — от новичков до продвинутых, поэтому ты можешь начать отсюда или с самого начала и учиться в своем темпе. Это урок 1 из 4.
Сколько времени занимает урок «Доказательство работы»?
Большинство уроков CoddyKit занимают около 5–10 минут. Каждый из них компактный и интерактивный, поэтому ты постоянно делаешь прогресс и продолжаешь с того же места в веб-версии и приложении.
Можно ли писать и запускать код в этом уроке Web3 & DApp Development Fundamentals?
Да. Каждый урок Web3 & DApp Development Fundamentals включает встроенный редактор кода, поэтому ты пишешь и запускаешь реальный код прямо в браузере и получаешь моментальную обратную связь от AI — локальная установка не требуется.
Все уроки этого курса
- Доказательство работы
- Доказательство доли владения
- Другие механизмы
- Финальность и форки