- SHA-256 Algorithm – Encryption – BitcoinWiki
- SHA-256d Algorithmus - Verschlüsselung - Bitcoin
- SHA-256d Algorithm – Encryption – BitcoinWiki
- SHA-256 - Bitcoin Wiki
- TXID - Bitcoin Wiki

Myriad (XMY) is a Multi-PoW consensus protocol secured by 5 mining algorithms. Each one suits different hardware.

Your miner is repeatedly hashing (see below for detail about a hash) a block of data, looking for a resulting output that is lower than a predetermined target. Each time this calculation is performed, one of the fields in the input data is changed, and this results in a different output. The output is not able to be determined until the work is completed – otherwise why would we bother doing the work in the first place?

Each hash takes a block header (see more below, but basically this is a 80-byte block of data). It runs this through the hashing function, and what comes out is a 32-byte output. For each, we usually represent that output in hexadecimal format, so it looks something like:

5da4bcb997a90bec188542365365d8b913af3f1eb7deaf55038cfcd04f0b11a0(that’s 64 hexadecimal characters – each character represents 4-bits. 64 x 4 bits = 256bit = 32 bytes)

The maximum value for our hash is:

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAnd the lowest is:

0000000000000000000000000000000000000000000000000000000000000000The goal in Proof-of-Work systems is to look for a hash that is lower than a specific target, i.e. starts with a specific number of leading zeros. This target is what determines the difficulty.

As the output of the hash is indeterminate, we look to statistics and probability to estimate how much work (i.e. attempts at hashing) we need to complete to find a hash that is lower than a specific target. So, we can therefore assume that to find a hash that starts with a leading zero will take, on average, 16 hashes. To find one that will start with two leading zeros (00), we’re looking at 256 hashes. Four leading zeros (0000) will take 65,536 hashes. Eight leading zeros (00000000) takes 4,294,967,296 hashes. So on and so on, until we realize that it will take 2 ^ 256 (a number too big for me to show here) attempts at hitting our minimum hash value.

Remember – this number of hashes is just an estimate. Think of it like rolling a dice. A 16-sided dice. And then rolling it 64 times in a row. And hoping to strike a specific number of leading zeros. Sometimes it will take far less than the estimate, sometimes it will take far more. Over a long enough time period though (with our dice it may take many billions of years), the averages hold true.

Difficulty is a measure used in cryptocurrencies to simply show how much work is needed to find a specific block. A block of difficulty 1 must have a hash smaller than:

00000000FFFF0000000000000000000000000000000000000000000000000000A block of difficulty 1/256 (0.00390625) must have a hash lower than:

000000FFFF000000000000000000000000000000000000000000000000000000And a block of difficulty 256 must have a hash lower than:

0000000000FFFF00000000000000000000000000000000000000000000000000So the higher the difficulty, the lower the hash must be; therefore more work must be completed to find the block.

Take a recent Vertcoin block – block # 852545, difficulty 41878.60056944499. This required a hash lower than:

000000000001909c000000000000000000000000000000000000000000000000The achieve finding this, a single miner would need to have completed, on average 179,867,219,848,013 hashes (calculated by taking the number of hashes needed for a difficulty 1 block - 4,294,967,296 or 2 ^ 32 or 16 ^ 8 – and multiplied by the difficulty). Of course, our single miner may have found this sooner – or later – than predicted.

Cryptocurrencies alter the required difficulty on a regular basis (some like Vertcoin do it after every block, others like Bitcoin or Litecoin do it every 2016 blocks), to ensure the correct number of blocks are found per day. As the hash rate of miners increases, so does the difficulty to ensure this average time between blocks remains the same. Likewise, as hash rate decreases, the difficulty decreases.

With difficulties as high as the above example, solo-mining (mining by yourself, not in a pool) becomes a very difficult task. Assume our miner can produce 100 MH/s. Plugging in this into the numbers above, we can see it’s going to take him (on average) 1,798,673 seconds of hashing to find a hash lower than the target – that’s just short of 21 days. But, if his luck is down, it could easily take twice that long. Or, if he’s lucky, half that time.

So, assuming he hit’s the average, for his 21 days mining he has earned 25 VTC.

Lets take another look at the same miner, but this time he’s going to join a pool, where he is working with a stack of other miners looking for that elusive hash. Assume the pool he has joined does 50 GH/s – in that case he has 0.1 / 50 or 0.2% of the pool’s hash rate. So for any blocks the pool finds he should earn 0.2% of 25 VTC = 0.05 VTC. At 50 GH/s, the pool should expect to spend 3,597 seconds between finding blocks (2 ^ 32 * difficulty / hashrate). So about every hour, our miner can expect to earn 0.05 VTC. This works out to be about 1.2 VTC per day, and when we extrapolate over the estimated 21 days of solo mining above, we’re back to 25 VTC.

The beauty of pooled-mining over solo-mining is that the time between blocks, whilst they can vary, should be closer to the predicted / estimated times over a shorter time period. The same applies when comparing pools – pools with a smaller hash rate will experience a greater variance in time between blocks than a pool with a greater hash rate. But in the end, looking back over a longer period of time, earnings will be the same.

A Hash is a cryptographic function that can take an arbitrary sized block of data and maps it to a fixed sized output. It is a one-way function – only knowing the input data can one calculate the output; the reverse action is impossible. Also, small changes to the input data usually result in significant changes to the output value.

For example, take the following string:

“the quick brown fox jumps over the lazy dog”If we perform a SHA256 hash of this, it results in:

05c6e08f1d9fdafa03147fcb8f82f124c76d2f70e3d989dc8aadb5e7d7450becIf we change a single character in the input string (in this case we will replace the ‘o’ in ‘over’ to a zero), the resulting hash becomes:

de492f861d6bb8438f65b2beb2e98ae96a8519f19c24042b171d02ff4dfecc82

A block is made up of a header, and at least one transaction. The first transaction in the block is called the Coinbase transaction – it is the transactions that creates new coins, and it specifies the addresses that those coins go to. The Coinbase transaction is always the first transaction in a block, and there can only be one. All other transactions included in a block are transactions that send coins from one wallet address to another.

The block header is an 80-byte block of data that is made up of the following information in this order:

- Version – a 32-bit/4-byte integer
- Previous Block’s SHA256d Hash – 32 bytes
- Merkle Hash of the Transactions – 32 bytes
- Timestamp - a 32-bit/4-byte integer the represents the time of the block in seconds past 1st January 1970 00:00 UTC
- nBits - a 32-bit/4-byte integer that represents the maximum value of the hash of the block
- Nonce - a 32-bit/4-byte integer

The Previous Blocks’ Hash is simple a doubled SHA256 hash of the last valid blocks header.

The Merkle Hash is a hash generated by chaining all of the transactions together in a hash tree – thus ensuring that once a transaction is included in a block, it cannot be changed. It becomes a permanent record in the blockchain.

Timestamp loosely represents the time the block was generated – it does not have to be exact, anywhere within an hour each way of the real time will be accepted.

nBits – this is the maximum hash that this block must have in order to be considered valid. Bitcoin encodes the maximum hash into a 4-byte value as this is more efficient and provides sufficient accuracy.

Nonce – a simple 4-byte integer value that is incremented by a miner in order to find a resulting hash that is lower than that specified by nBits.

o/

I'm learning about block hashing algorithm. I've found a very good beginner explanation here : https://en.bitcoin.it/wiki/Block_hashing_algorithm

But I struggle to understand why it still takes 10 minutes to find a block ! As I understand it, at the beginning of the race to find a new block, the only unknown is the nonce which is iterated to find a suitable sha256d hash.

So, a miner must iterate 2^{32} possibilities, which with an antminer S9 doing 14*10^{12} iterations per second is near instant ...

What am I missing here ? If someone can explain that to me, I would be grateful !

submitted by Balistick to BitcoinMining [link] [comments]
I'm learning about block hashing algorithm. I've found a very good beginner explanation here : https://en.bitcoin.it/wiki/Block_hashing_algorithm

But I struggle to understand why it still takes 10 minutes to find a block ! As I understand it, at the beginning of the race to find a new block, the only unknown is the nonce which is iterated to find a suitable sha256d hash.

So, a miner must iterate 2

What am I missing here ? If someone can explain that to me, I would be grateful !

In these shocking forking times, nothing more relaxing that to immerse

yourself in a pure technical reading about cryptocurrency design, letting

aside Bitcoin politics for a moment. This message is about cryptocurrencies

design in general, so you're free to skip my message if you think it will

never apply to Bitcoin.

[ full article copied from my blog:

https://bitslog.wordpress.com/2015/08/16/how-decor-can-eradicate-selfish-mining-incentive-by-design/

]

A year ago I proposed the DECOR protocol

<https://bitslog.wordpress.com/2014/05/02/deco>, a new rule for

cryptocurrencies to reduce significantly the amount of orphan blocks and

then allow block rate to be as high as one block every 5 seconds, and at

the same time it promised to address the problem of selfish mining

<http://hackingdistributed.com/2013/11/04/bitcoin-is-broken/>. After one

year, I’ve received very little feedback about it. Yet the selfish mining

<http://hackingdistributed.com/2013/11/04/bitcoin-is-broken/> problem has

been argued over and over against certain changes in Bitcoin, as if selfish

mining were something inevitable to all POW-based cryptocurrencies. But it

is not.

In a nutshell, DECOR is a protocol that permits miners to share the block

reward if both mine competing blocks. This is done by publishing block

header siblings (sometime called uncles) into child blocks, and modifying

the cryptocurrency protocol to pay some amount to the miners of uncles. If

all miners are honest, this strategy increases slightly the probability of

1-block reversals, but reduces considerably the probability of longer

reversals, as all miners choose the same parent. A few months after my

post, Ethereum <https://www.ethereum.org/>adopted a similar strategy of

paying a certain amount of ether to uncles, but the amount paid was created

out of thin ear, and at that time there could be any amount of uncles, so

basically it distorted the money supply function into a uncapped

inflationary one, if all miners decided to collude. After I reported this

issue, they restricted the number of uncles that can be included, but still

it leaves an incentive for all miners to collude to increase miner revenue.

DECOR does reward sharing, so the supply function cap is maintained. But it

does not solve the Selfish mining problem: miners withholding a block get

paid a full reward but the remaining miners are working (without knowing

it) for a half of the block reward. So my original strategy does not work

for rational (but not necessarily honest) miners. A few posts later I

presented DECOR+ <https://bitslog.wordpress.com/2014/05/07/decor-2/> to try

to address the problem of unbalanced rewards: what happens if there are two

competing blocks, but one has a 12.5 BTC reward, but the other has a 20 BTC

reward due to additional fees? But again, if miners are dishonest, the

proposed scheme does not solve the underlying problem, as miners can

artificially increase their fees to win the conflict resolving rule, at

least in all cryptocurrencies that do not burn transaction fees. How can we

fix it?

We’ll fix DECOR by doing three changes. The first is by paying full rewards

to all competing blocks, either the parent or the uncles. To prevent

increasing the money supply, first we set a maximum number of uncles U than

can be included over a period of N blocks. For example we can set U=100 and

N=1000 (a maximum orphan rate of 10%). Then we create rule to decrease the

money supply per time interval in case it previously was increased. So to

prevent miners colluding to increase the money supply in U/N, we either

decrease the subsidies of the following N blocks by the excess amount in

the previous period or we make N coincident with block difficulty re-target

interval and we consider uncles in the rate computation, so mining

afterward simply gets more difficult. If all miners collude to try to

increase their revenue by U/N, they will see their revenue decrease by the

same amount in the following re-target interval.

Miners could start switching between two cryptocurrencies to mine only

during the low difficulty interval and avoid the high difficulty interval.

But here are no competing valuable non-merged mined cryptocurrency using

SHA256D, so this is no problem for Bitcoin. Also the cryptocurrency left

without mining power would become insecure and its price will fall to near

zero. So increasing the immaturity lock time for coinbases to at least N

blocks destroys any miner earnings if all decide to switch all at once.

The second change is to choose the parent block in case of conflict based

on a deterministic random selection in case of deciding between several

chains with the same accumulated difficulty but different tip: we order the

competing tip blocks by their hash digest values, we hash the hashes and we

use the resulting hash digest as seed to a PRNG to choose an index in the

sorted list of the block to choose as parent.

The third change is to process the transactions of all competing blocks

(the actual block and its siblings) in case of a conflict. The transactions

on the parent block will be processed first as normal. The others will be

processed in the order they are referenced in following child blocks.

Conflicting transactions (double-spends) present in uncle blocks with

respect to the main block are skipped, while obviously internal conflicts

in the uncle blocks make them invalid, as usual. Now, as long as the

subsidy dominates the fees, miners have no incentive to withhold blocks.

Let’s analyze what can happen in the long term, when fees dominate the

block reward. In the future there may be two kinds of transactions: public

transactions and private transactions. Public transactions are the current

standard transactions: they pay a fee in the standard way and are broadcast

over the public network. Private transactions may appear if miners decide

to negotiate inclusion in blocks directly with web wallets or gateways:

private transactions will pay fees as an output to the miner’s public key.

Blocks with high rewards competing with blocks with low rewards due to

public transactions will be rare, since for the benefit of the miner most

transactions included in blocks should be present in all other miners

memory pools to accelerate propagation, so all miners are exposed to the

same reward pool. If it happens (by the mistake of a user) that a public

transaction pays an extremely high fee, the withholding incentive may

reappear. But in a far future, when subsidy disappears and miners receive

the payment mainly because of fees, they may adopt the more competitive

commercial strategy of rely mainly in private transactions (or maybe using Mike

Hearn’s assurance contracts

<https://en.bitcoin.it/wiki/Funding_network_security>). As fees from

private transactions are not shared between competing blocks, they won’t

affect selfish mining. I conclude that DECOR++ is currently incentive

compatible and it is highly probable that remains incentive compatible in

the future.

To summarize, DECOR++ main protocol properties are:

- Choose a parent by a deterministic pseudo-random coin toss based on

competing block headers - Give standard subsidy to all competing blocks by including uncles in

following blocks - Give small monetary incentive to include uncle blocks in blocks

(miners including blocks can get a small share of included blocks rewards). - Give small monetary incentive to choose deterministically one of the

competing blocks as the main block (this can be done by burning some reward

share if other parent is chosen). - Process all transactions in uncle blocks, quietly skipping the ones

that conflict with existing ones. - Pay fees to original miners for all non-conflicting transactions in

uncle blocks - Decrease the money supply in blocks following blocks including uncles

to compensate for the increase in money supply. - Limit the amount of uncles that can be included over an interval of

blocks, and make that interval long enough to capture normal variances in

orphan rates. - Increase the coinbase immaturity period to at least the period of

money supply compensation.

-------------- next part --------------

An HTML attachment was scrubbed...

URL: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20150816/a101786f/attachment.html>

From Bitcoin Wiki. Jump to: navigation, search. SHA-256 is a member of the SHA-2 cryptographic hash functions designed by the NSA. SHA stands for Secure Hash Algorithm. Cryptographic hash functions are mathematical operations run on digital data; by comparing the computed "hash" (the output from execution of the algorithm) to a known and expected hash value, a person can determine the data's ... Transaktion ist ein Datenabschnitt, der durch eine Unterschrift bestätigt wird. Es wird an das Bitcoin - Netzwerk gesendet und bildet Blöcke.Es enthält normalerweise Verweise auf vorhergehende Transaktionen und ordnet eine bestimmte Anzahl von Bitcoins mit einem oder mehreren öffentlichen Schlüsseln zu (Bitcoin-Adressen).Es ist nicht verschlüsselt, da im Bitcoin-System nichts zu ... SHA-256 is a member of the SHA-2 cryptographic hash functions designed by the NSA. SHA stands for Secure Hash Algorithm. Cryptographic hash functions are mathematical operations run on digital data; by comparing the computed "hash" (the output from execution of the algorithm) to a known and expected hash value, a person can determine the data's integrity. SHA-256d ist die Hash-Funktion, die den Kern von Bitcoin bildet. Inhaltsverzeichnis. 1 Über; 2 Beispiel; 3 Siehe auch; 4 Ressourcen; Über . SHA-256d wurde wie folgt in einem der Ferguson / Schneier-Bücher vorgeschlagen: SHA-256d (x) = SHA-256 (SHA-256 (x)) Die Motivation für diese Konstruktion besteht darin, Längenausdehnungsangriffe zu vermeiden. Beispiel . Ein Beispiel ist dieses ... The following is a list of cryptocurrencies (both current and dead) that use the SHA-256 hashing algorithm. 21Coin <!-- https://coinmarketcap

[index] [42047] [18986] [27548] [18093] [41777] [9802] [35826] [11082] [10089] [36657]

Have you purchased a USB Bitcoin miner and need to learn how to set it up? Now, the first item that you want to pick up is called a Raspberry Pi. Now, this is Now, the first item that you want to ... Best Free Bitcoin mining earn up to 0.025 BTC every day Automated miner site link https://zee.gl/K8cV How to create Coinbase acound ? https://youtu.be/KV... We aim to understand how bitcoin nodes validate a bitcoin transaction by concatenation of output and input scripts . Therefor we analyze the format of Bitcoin transaction. This is needed to ... Start trading Bitcoin and cryptocurrency here: http://bit.ly/2Vptr2X Bitcoin mining is the process of updating the ledger of Bitcoin transactions known as th... Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.