Загрузка...

How does Bitcoin actually mine a block?

How does Bitcoin actually mine a block? It's a guessing game at planetary scale.

A miner takes the block header, appends a small number called a nonce, then runs SHA-256 on the bundle twice. Out pops a fixed-length hash. The goal: that hash must come out below the current network target, which really means it has to start with a lot of leading zeros.

The catch is that SHA-256 is one-way. You can't reverse-engineer a valid input, so you can't compute the right nonce directly. You can only guess and check — hash, fail, bump the nonce, hash again. The whole Bitcoin network is doing this about ten trillion times per second. Eventually one miner gets lucky, broadcasts the winning block, and claims the reward.

This is proof-of-work. Attacking the chain means out-hashing the entire planet — effectively impossible. And the network retargets difficulty every two weeks, so faster hardware just shrinks the target. Block time stays around ten minutes forever.

Music: Markvard - Time [NCS Release] (NoCopyrightSounds)
https://ncs.io

#bitcoin #crypto #blockchain #proofofwork #mining #sha256 #shorts #programming

Видео How does Bitcoin actually mine a block? канала ProCode
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять