What is an uncle in ethereum

Orphan, Stale и Uncle-блоки в майнинге Биткоина и Эфириума. Что такое, чем отличаются и сколько приносят

Случается так, что ваше вознаграждение за найденный криптовалютный блок либо меньше обычного, либо же отсутствует совсем. Интересно разобраться в майнинге и понять, почему так происходит? Отлично, данная статья именно об этом, только сначала обязательно прочитайте эту публикацию.

PS: а если вы просто хотите настроить свою ферму и получать доход без лишних подробностей, идите на майнинг-пул 2Miners. Там всё понятно и просто.

Блокчейн — цепочка блоков

Кто-то скажет “это всем ясно” и будет прав, однако давайте подробнее посмотрим на суть цепочки. В среднем каждые 10 минут в сети Биткоина появляется новый блок, а у Эфириума на это уходит 14 секунд. В каждом блоке есть информация о том, какой блок был перед ним. Благодаря этому и выстраивается цепочка блоков — индекс. Можно сравнить его с нумерованным списком или Excel-таблицей. Пропусков не бывает. За номером 1 всегда идёт номер 2, а за 3 будет 4.

Каждая нода=узел=компьютер в сети криптовалюты связан с другими и постоянно обменивается с ними информацией. Подробнее про работу криптовалютных нод и возможные проблемы читайте здесь. Допустим, последний блок в сети криптовалюты имеет номер 100. Все майнеры мира решают одну и ту же задачу и ищут решение блока 101. Как только его найдут, майнер (или майнинг-пул) отправляет через свою ноду решение в сеть. В течение нескольких секунд, а обычно даже миллисекунд, все узлы сети получают информацию о новом блоке 101. Проверяют, что блок честный, в нём нет никакого обмана, после чего дальше ждут блока 102.

Вопрос следующий: что произойдёт, если 2 майнера нашли решение блока 101 в одно и то же время? Например, в сети 100 узлов. Майнер А нашел решение блока чуть раньше и успел передать информацию о блоке на 60 узлов. Майнер Б сделал работу позже и успел сказать о найденном решении блока только на 40 узлов. Значит ли это, что А — молодец, а Б — нет? Не факт. Рассмотрим эти тонкости подробнее на примере монет BTC и ETH.

Важный момент. Взять и присвоить себе чужое решение блока не получится. Сети криптовалют защищены от такого рода воровства. Решение блока от майнера А не подойдёт майнеру Б, он не сможет выдать его за своё.

Какие бывают виды блоков в блокчейне Биткоина

Если что, 10 минут на блок — это среднее время, по факту может быть как несколько секунд, так даже и несколько часов. Допустим, блоки идут быстро, или же ноды общаются между собой не очень быстро.

Майнеры А и Б нашли решение блока 101 примерно в одно и то же время. 60 процентов нод получили новый блок от майнера А, 40 процентов — от майнера Б. На данный момент оба этих блока абсолютно честные, легальные, валидные, как угодно. Сразу после этого майнеры, которые послушали А, нашли еще 2 блока, а майнеры, которые послушали Б, нашли ещё 3 блока.

Как же решить, чья цепь окажется правильной? Решение простое. У последователей майнера Б цепочка длиннее, поэтому она верная. Последователи майнера А, к сожалению, работали напрасно. За свои блоки они ничего не получат.

Помните, что у нас есть индекс, нумерованный список? Так вот, в итоге в него попадает блок 101, который нашёл майнер Б, а дальше — следующие 3 блока, найденные его последователями под номерами 102, 103 и 104. Блок, который нашел майнер А, в индекс не попал. Он остался без отца, его “отрезали”, поэтому такой блок называют сиротой — Orphan. Хорошая новость: у него осталось 2 ребенка, блоки которые были найдены за ним. Плохая новость: смысла в этих блоках нет, они называются Stale, в переводе на русский “протухшие”. Такие вот дочки-матери.

Читайте также:  Что такое libra криптовалюта

По факту, конечно, вряд ли ноды будут ждать так долго. Уже при наличии следующего блока 102 после спорного блока 101 вся криптовалютная сеть переключится на эту ветку и отбросит другую.

Orphan и Stale-блоки часто путают. С точки зрения майнера Биткоина смысла нет ни в том, ни в другом, за них майнер ничего не получает. Ещё эти блоки называют отклонёнными или Reject/Rejected.

Подытожим, у Биткоина бывают следующие блоки:

  • нормальный (валидный) — блок, который включён в цепочку блоков Биткоина. Нашедший его майнер получает вознаграждение.
  • Orphan (сирота) — блок, у которого в цепочке блоков Биткоина нет предшественника (родителя). За Orphan-блок майнер ничего не получает.
  • Stale (потомок сироты) — блок, который не включён в цепочку блоков Биткоина, потому что предшественником является Orphan-блок. Иными словами, цепочка начинается с блока сироты. За Stale-блок майнер ничего не получает.

Какие бывают виды блоков в блокчейне Эфириума

Среднее время блока в сети Ethereum намного меньше, чем у Bitcoin: 14 секунд против 10 минут. Очевидно, что проблема Orphan и Stale-блоков должна встречаться намного чаще, а значит холостая работа майнеров в теории должна быть велика. К счастью, на практике всё иначе. Разработчики этой криптовалюты внедрили так называемый GHOST-протокол (Greedy Heaviest Observed Subtree).

Смысл GHOST простой — майнеры, которые находят Orphan и Stale-блоки тоже получают вознаграждение, хотя их размер и меньше суммы за нормальные блоки. Такие блоки в сети Ethereum и всех других Dagger-Hashimoto криптовалютах стали называть Uncle. По-русски это звучит как “дядя”.

Uncle-блоки также решают проблему централизации сети. Если бы их не было, ситуация была бы странной. При таком маленьком времени блока крупный пул работал бы намного эффективнее и просто убивал маленьких конкурентов, до которых бы долго доходила информация о новых блоках. В свою очередь, они бы штамповали бесполезные Orphan/Stale-блоки без конца.

У Эфириума бывают следующие блоки:

  • нормальный (валидный) — блок, который включён в цепочку блоков Биткоина. Нашедший его майнер получает вознаграждение.
  • Uncle — блок, который бы в сети Биткона назывался Orphan или Stale. Данный блок не включается в основную ветку. При этом майнер получает за него более скромное вознаграждение в сравнении с обычным блоком.

Вознаграждение за Uncle-блоки в сети Ethereum

Всего у Эфира может быть 7 “вложенностей” анклов, если так можно сказать. В Биткоине это был бы 1 Orphan и 6 Stale блоков за ним. В Эфириуме вознаграждение за Uncle рассчитывается по следующей формуле:

([Номер Uncle блока] + 8 — [Номер нормального блока]) * [Вознаграждение в сети эфира] / 8

Простыми словами, если вознаграждение за обычный блок — 3 ETH, Uncle будет получать на 1/8 меньше.

Самый первый Uncle получит 2,625 ETH, следующий 2,25 ETH, затем 1,87 ETH и так далее до 0,375 ETH. Однако как правило, Uncle-ветка редко идёт далеко. Уже к первому-второму Uncle блоку нода майнера понимает, что ушла не туда, и переключается на майнинг основной цепочки.

Увидеть мельчайшие детали майнинга Эфириума поможет шикарная инфографика в реальном времени под названием Ethviewer. Она показывает основную цепь и цепочки анклов. Завораживает.

Источник

Uncle Block (Cryptocurrency)

What Is an Uncle Block (Cryptocurrency)?

Uncle blocks are created on Ethereum-based blockchains, and they are similar to Bitcoin’s orphan block.

In a process similar to the way Bitcoin creates orphan blocks, uncle blocks are created when more than one child block is created from a parent block. This situation is possible because all the nodes that maintain the ledger are not updated instantaneously when a new block is mined. Instead, you may have two blocks mined close together, but only one gets validated across nodes on the ledger. The one that is not validated is an uncle block.

Key Takeaways

  • Uncle blocks are created in Ethereum blockchains when two blocks are mined and submitted to the ledger at roughly the same time. Only one can enter the ledger as a block, and the other does not.
  • They are similar to Bitcoin orphans, but have an integrated use, unlike their Bitcoin counterparts.
  • Miners are rewarded for uncle blocks in the Ethereum system, whereas orphan blocks in Bitcoin were not rewarded.

Understanding Uncle Block (Cryptocurrency)

A blockchain is formed by a growing chain of blocks that store details of the various transactions occurring on the blockchain network. Miners continue to mine for the new blocks following the standard mining process implemented by the blockchain.

Читайте также:  Главная задача любой компании инвестировать эссе

A newly mined block is appended to the blockchain after verification, and the miner who found this new block is entitled to the block reward. The block height, which indicates the length of the blockchain, increases after the addition of the new block.

However, at times, two different miners may generate a block simultaneously. This happens due to the working mechanism of the blockchain, which may not accept the newly identified blocks into the blockchain instantaneously.

Due to this delay, a situation arises where another miner solves for the same block and tries to add it to the network chain, which results in a temporary and unsettled state of the blockchain network as the various nodes try to build a consensus about which of the newly identified blocks to continue with and which one to reject.

The rejected ones are those which have a relatively lower share of proof of work and constitute the uncle blocks, while the ones with the larger share join the blockchain and work as a normal block.

Ethereum Rationale for Uncle Blocks

In the Bitcoin blockchain, orphan blocks were a sunk cost: miners were not rewarded for producing them. Moreover, since the release of Bitcoin Core v.0.10 in early 2015 that eliminated the ability for nodes to recognize blocks without ancestry, Bitcoin orphan blocks are no longer possible.  

In the Bitcoin blockchain, orphan blocks were in essence bugs in the code—unintended and accidental byproducts of the mining process. Ethereum, on the other hand, incentivizes uncle block miners. This is done for several reasons:

  • To increase the number of transactions on the blockchain, Ethereum allows for the creation of more uncle blocks as a byproduct of shorter block times.
  • Valid uncle blocks are rewarded to neutralize the effect of network lag on the distribution of mining rewards.
  • Incentivizing uncles helps to decrease the centralization of incentives where large mining pools with high computing power end up claiming the majority of the rewards leaving nothing for individual miners.
  • It also increases the security of the network by supplementing the work on the main blockchain by the work done in mining uncle blocks.

Finally, the uncle blocks are purposefully incorporated into Ethereum’s consensus method by a process called «GHOST: Greedy Heaviest Object Sub Tree.» According to Philip Shen, «nodes will get the number of uncles mined for the last seven blocks in each subtree. That number is, in addition to the number of blocks in that subtree, used to calculate the tree’s weight; the heaviest tree is then said to be the ‘correct’ one.»  

Uncles and Other Entities Outside the Patrilineal Tree

The name “uncle” was chosen based on the lines of a family tree. Consider the blockchain as a family tree, with accepted blocks the genuine «parent-child» in the tree.

The term orphan was coined because, under the old Bitcoin system, a block could be submitted to a node that did not have a clear parent. In that case, the node would wait for confirmation from other nodes. This was a bug, not a feature.

For the reasons given above, Ethereum found a use for these extra blocks and incorporated them into its consensus mechanism, so the orphans were promoted to a metaphorical role in the family that showed they are not in a direct line of succession but still useful to the total system.

Источник

Understanding Ethereum’s Uncles

This article will provide insight and information helping you understand Ethereum’s uncles, why they exist, and how their existence benefits the safety of the network. It contains some crypto-heavy language, but I’ve tried to keep it as simple as possible, clearly defining new words as we go along.

Everything is perceived from the perspective of the current block being mined on the blockchain. This is the way most of these terms were created because of the importance of the main chain and the block being worked on right now. Let me know if any words remain unclear in the comment section.

Читайте также:  Калькулятор облачного майнинга биткоин

What are the uncles in Ethereum?

Naturally, the Ethereum blockchain consists of blocks. These blocks are produced by miners, and they also contain the identifying information from the previous block.

In Ethereum’s family tree, this previous block is considered to be the parent of the current block. Just like in a real family, our parents don’t always have one kid, and the same is true for our parent’s parents. Any children (blocks) they may have had would be our uncles.

In terms of cryptocurrency i.e. blockchain platforms, these uncles i.e. blocks created from a shared ancestor (parent) block (after the network has carried on and started the work of the child) are often considered stale blocks. Stale meaning, they were late, they did not get included in the main chain, and the effort invested into creating these otherwise valid blocks (except the fact they were late) often goes unrewarded.

Unlike other blockchains (looking at you, Bitcoin) Ethereum does not disregard the work of miners whose blocks don’t get to be the first ones propagated to the network. We can’t expect (as miners) to win the block-race every time, and Vitalik Buterin came up with a solution to this problem (together with the research of two amazing data scientists) back in 2004, when ETH was just a baby.

In this article, he explains how uncles work in great detail, with various calculations regarding the different possible outcomes. His goal? To improve the security of the network, and lower centralization risks. He performs calculations where one powerful mining pool is found in the midst of 7000 small ones. He spends a lot of time explaining why uncles are important and how the actual risk of a 51 attack is actually only 49%.

The hypothesis is that would-be attackers do not need to mine the stale blocks, they can just pick up from where they left off to generate their parallel chain, effectively gaining an upper hand over the main chain. This is still rather unlikely because it requires a significant amount of hidden mining power to operate and is in itself a questionable decision in terms of profitability.

To address this issue Vitalik comes up with a solution that would give uncles, i.e. stale blocks a reward, and also reward miners to include uncles in their nephew blocks (the current blocks being mined) up to the 7th level. This means that the block height difference (the position of a block on the blockchain) must be less than 5 in order for them to have the opportunity to be included in the blockchain.

Illustration from Vitalik Buterin’s article linked above which clearly shows the generation of uncles as a commonplace in blockchains, and how reintroducing them to the main chain is helping secure the network.

When included as an uncle blocks gain a significant reward which is as close to 1 as possible and represents 15/16 from the total reward claimed by regular blocks. At first, this doesn’t make sense, but considering the fact that it does add to network security it’s quite logical for this to be a real thing.

The reason why this actually provides security because the principle of leveraging the proof of work is fundamentally different when compared to Bitcoin. In Bitcoin, it is the longest chain that is considered the main chain, while in Ethereum it is the heaviest chain. The one chain that has the most amount of work and leads back to Genesis is the main chain.

Conclusion

Uncles are important for Ethereum’s network security and accepting them helps eliminate network latency problems and mitigates some of the centralization risks that are naturally associated with fast block time blockchains like Ethereum.

Accepting and rewarding the acceptance of uncles is providing Ethereum with a means to balance out the game when big players can dominate the system. Decentralization is the goal and without uncles, it’s a total dictatorship.

  • https://blog.ethereum.org/2014/07/11/toward-a-12-second-block-time/
  • https://nulltx.com/what-are-ethereum-uncles/
  • https://eprint.iacr.org/2013/881.pdf
  • https://github.com/ethereum/wiki/wiki/Design-Rationale#uncle-incentivization

Подпишись на наш Telegram-канал и не пропускай важные новости из мира криптовалют и блокчейна*

*Ссылка открывается даже, если телеграм заблокирован в вашем регионе

Источник

Оцените статью