Who Runs a Blockchain? Ditoman lesson imageWho Runs a Blockchain? Ditoman lesson image
Blockchain • Mining and Staking
بلاکچین • استخراج و اعتبارسنجی

Who Runs a Blockchain?

چه کسی بلاکچین را اداره می‌کند؟

No company owns Bitcoin or Ethereum, yet their ledgers keep growing correctly. This lesson explains how miners and validators keep the books honest, and why that costs something.

هیچ شرکتی مالک بیت‌کوین یا اتریوم نیست، ولی دفترشان درست بزرگ می‌شود. این درس توضیح می‌دهد استخراج‌کننده‌ها و اعتبارسنج‌ها چطور دفتر را صادق نگه می‌دارند و چرا این کار هزینه دارد.

LevelسطحBeginnerمقدماتی
Reading Timeزمان مطالعه7 Minutes۷ دقیقه
Learning Pointsامتیاز یادگیری20 LP۲۰ امتیاز
Quizآزمونک5 Questions۵ پرسش

Lesson Content

محتوای درس

Read the lesson in English or Persian.

درس را به فارسی یا انگلیسی بخوانید.

A bank has an owner, a manager and a phone number. A public blockchain has none of these. Thousands of computers around the world hold the same ledger, and nobody is in charge of it.

So who decides which transactions go in next? And why would anyone cheat or not cheat?

01. The problem to solve

Any ledger needs one rule: everyone must agree on the next page. If two people could add two different next pages, the money could be spent twice.

A bank solves this by being the single referee. A blockchain solves it with a method, called a consensus mechanism, where many strangers agree without trusting each other.

02. Proof of work: mining

Bitcoin uses proof of work. Miners collect pending transactions into a block and then try to find a number that, combined with the block's data and hashed, produces a result below a target. As learnmeabitcoin explains, this means hashing the block header, using double SHA-256, over and over until a result falls below the target.

There is no shortcut except trying. The first miner to succeed shares the block, and the others check it quickly.

The network aims for a new block about every 10 minutes. Every 2,016 blocks, roughly two weeks, the difficulty adjusts so the pace stays steady however many miners join or leave.

03. What miners are paid

The winning miner collects a reward for the block, called the coinbase, plus the fees from its transactions. The reward cannot be spent until it is 100 blocks old, which protects against a block being replaced.

The cost is the point. Miners spend real electricity and equipment, so cheating has to be worth more than the cost of doing it honestly.

Proof of work vs proof of stake
Proof of work (Bitcoin) Proof of stake (Ethereum)
Who proposes blocksMinersValidators
What is at stakeElectricity and equipmentA deposit (32 ETH to run one alone)
Penalty for cheatingWasted workSlashing of the deposit
Energy useHighAbout 99.99% lower after the Merge (estimate)

04. Proof of stake: validators

Ethereum changed to proof of stake. Instead of spending energy, validators put money at risk. To run a validator on its own you deposit 32 ETH, and pools exist for people with less.

If a validator behaves dishonestly, part or all of its deposit can be destroyed. This penalty is called slashing. According to ethereum.org, the initial penalty starts at 1/4096 of the effective balance, capped at 0.5 ETH, and then the validator is removed.

05. How much energy changed

The change came on 15 September 2022, the day of the Merge. The Cambridge Centre for Alternative Finance estimated that Ethereum's electricity use fell by about 99.99%.

06. Nodes: the people who check

Miners and validators propose blocks, but any computer running the software, a node, can check the rules. A block that breaks the rules is rejected even if it was expensive to make.

07. Can the majority cheat?

In proof of work, someone controlling most of the mining power could rewrite recent history. This is called a 51% attack. It needs enormous resources, and the target gets weaker the smaller the network.

Both systems answer the same question: make cheating more costly than honesty.

What to take from this

A blockchain needs a way for strangers to agree on the next page.

Proof of work: miners spend energy hashing until a result falls below the target.

Proof of stake: validators put money at risk and can be slashed.

Nodes check the rules, even without making blocks.

Both aim to make cheating cost more than honesty.

یک بانک مالک، مدیر و شماره‌ی تلفن دارد. بلاکچین عمومی هیچ‌کدام را ندارد. هزاران رایانه در سراسر دنیا یک دفتر را نگه می‌دارند و هیچ‌کس مسئولش نیست.

پس چه کسی تصمیم می‌گیرد کدام تراکنش‌ها بعدی وارد شوند؟ و چرا کسی تقلب کند یا نکند؟

۰۱. مسئله‌ای که باید حل شود

هر دفتری یک قاعده لازم دارد: همه باید روی صفحه‌ی بعدی توافق کنند. اگر دو نفر بتوانند دو صفحه‌ی بعدی متفاوت اضافه کنند، پول می‌تواند دو بار خرج شود.

بانک با داور واحدبودن این را حل می‌کند. بلاکچین با روشی حلش می‌کند به نام سازوکار اجماع، که در آن غریبه‌های زیادی بدون اعتماد به هم توافق می‌کنند.

۰۲. اثبات کار: استخراج

بیت‌کوین از اثبات کار استفاده می‌کند. استخراج‌کننده‌ها تراکنش‌های در انتظار را در یک بلاک جمع می‌کنند و سپس دنبال عددی می‌گردند که همراه داده‌ی بلاک هش شود و نتیجه‌اش زیر یک هدف باشد. به توضیح learnmeabitcoin، این یعنی هش‌کردن سرآیند بلاک با double SHA-256 بارها و بارها تا نتیجه زیر هدف بیفتد.

میان‌بری جز امتحان‌کردن نیست. اولین استخراج‌کننده‌ای که موفق شود بلاک را منتشر می‌کند و بقیه سریع بررسی‌اش می‌کنند.

شبکه هدفش یک بلاک جدید در هر حدود ۱۰ دقیقه است. هر ۲٬۰۱۶ بلاک، تقریباً دو هفته، دشواری تنظیم می‌شود تا هر قدر استخراج‌کننده بیاید یا برود، سرعت ثابت بماند.

۰۳. استخراج‌کننده‌ها چه می‌گیرند

استخراج‌کننده‌ی برنده پاداش بلاک را می‌گیرد، به نام «کوین‌بیس»، به‌علاوه‌ی کارمزد تراکنش‌های آن. این پاداش تا ۱۰۰ بلاک بعد قابل خرج نیست، که جلوی جایگزین‌شدن بلاک را می‌گیرد.

هزینه همان نکته است. استخراج‌کننده‌ها برق و تجهیزات واقعی خرج می‌کنند، پس تقلب باید ارزشش از هزینه‌ی صادقانه‌کار‌کردن بیشتر باشد.

اثبات کار و اثبات سهام
اثبات کار (بیت‌کوین) اثبات سهام (اتریوم)
چه کسی بلاک پیشنهاد می‌دهداستخراج‌کننده‌هااعتبارسنج‌ها
چه چیزی در خطر استبرق و تجهیزاتیک سپرده (۳۲ اتر برای اجرای مستقل)
جریمه‌ی تقلبکار هدررفتهاسلشینگ سپرده
مصرف انرژیزیادحدود ۹۹٫۹۹٪ کمتر پس از ادغام (برآورد)

۰۴. اثبات سهام: اعتبارسنج‌ها

اتریوم به اثبات سهام تغییر کرد. به‌جای خرج انرژی، اعتبارسنج‌ها پول را در معرض خطر می‌گذارند. برای اداره‌ی یک اعتبارسنج مستقل ۳۲ اتر سپرده می‌کنید و برای کسانی که کمتر دارند «استخر» هست.

اگر اعتبارسنجی نادرست رفتار کند، بخشی از سپرده یا همه‌ی آن می‌تواند نابود شود. این جریمه «اسلشینگ» (slashing) نام دارد. طبق ethereum.org جریمه‌ی اولیه از ۱/۴۰۹۶ موجودی مؤثر شروع می‌شود، سقفش ۰٫۵ اتر است، و بعد اعتبارسنج کنار گذاشته می‌شود.

۰۵. مصرف انرژی چقدر عوض شد

این تغییر در ۱۵ سپتامبر ۲۰۲۲، روز «ادغام» (Merge) اتفاق افتاد. مرکز مالی جایگزین دانشگاه کمبریج برآورد کرد مصرف برق اتریوم حدود ۹۹٫۹۹٪ کاهش یافت.

۰۶. نودها: کسانی که بررسی می‌کنند

استخراج‌کننده‌ها و اعتبارسنج‌ها بلاک پیشنهاد می‌دهند، ولی هر رایانه‌ای که نرم‌افزار را اجرا کند، یعنی یک نود، می‌تواند قاعده‌ها را بررسی کند. بلاکی که قاعده را بشکند رد می‌شود، حتی اگر ساختنش گران بوده باشد.

۰۷. آیا اکثریت می‌تواند تقلب کند؟

در اثبات کار، کسی که بیشترِ توان استخراج را در دست داشته باشد می‌تواند تاریخ اخیر را بازنویسی کند. این «حمله‌ی ۵۱٪» نام دارد. منابع عظیمی می‌خواهد و هر چه شبکه کوچک‌تر باشد هدف ضعیف‌تر است.

هر دو نظام به یک پرسش جواب می‌دهند: تقلب را گران‌تر از صداقت کنید.

چه برداشتی کنیم

بلاکچین راهی لازم دارد تا غریبه‌ها روی صفحه‌ی بعدی توافق کنند.

اثبات کار: استخراج‌کننده‌ها انرژی خرج می‌کنند و هش می‌زنند تا نتیجه زیر هدف بیفتد.

اثبات سهام: اعتبارسنج‌ها پول را در معرض خطر می‌گذارند و ممکن است اسلش شوند.

نودها قاعده‌ها را بررسی می‌کنند، حتی بدون ساختن بلاک.

هر دو می‌خواهند تقلب را گران‌تر از صداقت کنند.

Two lessons that connect

دو درس مرتبط

Lesson 28 shows what Ethereum runs on top of this: programs that execute by themselves. Lesson 30 explains the schedule that governs how Bitcoin's miners are paid.

درس ۲۸ نشان می‌دهد اتریوم روی این پایه چه چیزی اجرا می‌کند: برنامه‌هایی که خودشان اجرا می‌شوند. درس ۳۰ برنامه‌ای را توضیح می‌دهد که پاداش استخراج‌کننده‌های بیت‌کوین را تعیین می‌کند.

Key Concepts

مفاهیم کلیدی

  • Consensus mechanism
  • Proof of work
  • Mining and difficulty
  • Block reward
  • Proof of stake
  • Validator and slashing
  • Node
  • 51% attack
  • سازوکار اجماع
  • اثبات کار
  • استخراج و دشواری
  • پاداش بلاک
  • اثبات سهام
  • اعتبارسنج و اسلشینگ
  • نود
  • حمله‌ی ۵۱٪

Learning Objectives

اهداف یادگیری

  • Explain why a blockchain needs a consensus method.
  • Describe proof of work in simple words.
  • Describe proof of stake and slashing.
  • Say what a node does.
  • Explain what a 51% attack is.
  • توضیح بدهید چرا بلاکچین به روش اجماع نیاز دارد.
  • اثبات کار را ساده توصیف کنید.
  • اثبات سهام و اسلشینگ را توصیف کنید.
  • بگویید نود چه می‌کند.
  • توضیح بدهید حمله‌ی ۵۱٪ چیست.

Quiz

آزمونک

Check what stayed with you. The answer is under each question.

ببین چه چیزی در ذهنت مانده. پاسخ زیر هر پرسش آمده است.

Question 1

پرسش ۱

Roughly how often does the Bitcoin network aim to produce a block?

شبکه‌ی بیت‌کوین تقریباً هر چند وقت یک بلاک را هدف می‌گیرد؟

A. About every 10 minutes

الف. تقریباً هر ۱۰ دقیقه

B. Every second

ب. هر ثانیه

C. Once a day

ج. روزی یک بار

Correct answer: A

پاسخ درست: الف

Question 2

پرسش ۲

How often does Bitcoin's difficulty adjust?

دشواری بیت‌کوین هر چند وقت تنظیم می‌شود؟

A. Every 2,016 blocks, about two weeks

الف. هر ۲٬۰۱۶ بلاک، حدود دو هفته

B. Every block

ب. هر بلاک

C. Never

ج. هرگز

Correct answer: A

پاسخ درست: الف

Question 3

پرسش ۳

What is slashing?

اسلشینگ چیست؟

A. Destroying part or all of a dishonest validator's deposit

الف. نابودکردن بخشی یا همه‌ی سپرده‌ی اعتبارسنج نادرست

B. A fee discount

ب. تخفیف کارمزد

C. A new coin

ج. یک کوین جدید

Correct answer: A

پاسخ درست: الف

Question 4

پرسش ۴

How much ETH is needed to run a validator on your own?

برای اجرای مستقل یک اعتبارسنج چند اتر لازم است؟

A. 32 ETH

الف. ۳۲ اتر

B. 1 ETH

ب. ۱ اتر

C. 1,000 ETH

ج. ۱٬۰۰۰ اتر

Correct answer: A

پاسخ درست: الف

Question 5

پرسش ۵

What do both consensus methods aim for?

هر دو روش اجماع چه هدفی دارند؟

A. Making cheating cost more than honesty

الف. گران‌تر کردن تقلب از صداقت

B. Hiding the ledger

ب. پنهان‌کردن دفتر

C. Choosing one company as boss

ج. انتخاب یک شرکت به‌عنوان رئیس

Correct answer: A

پاسخ درست: الف

Sources

منابع

The 99.99% figure is an estimate by the Cambridge Centre for Alternative Finance. The block interval and difficulty period are design targets, not guarantees for any single block. General explanation, not investment advice.

رقم ۹۹٫۹۹٪ برآورد مرکز مالی جایگزین کمبریج است. فاصله‌ی بلاک‌ها و دوره‌ی دشواری اهداف طراحی‌اند، نه تضمین برای هر بلاک. توضیح عمومی است، نه توصیه‌ی سرمایه‌گذاری.

با هم دنبال می‌کنیمFollow along

New lessons are announced first on Ditoman's channels.

درس‌های تازه اول در کانال‌های دیتومان معرفی می‌شوند.