Hot answers tagged

18 votes
Accepted

Adding instead of concatenating hashes in Merkle trees

There are a number of issues here, with different answers. Can Merkle trees use a commutative operation in general to combine hashes? Yes, but only if they aren't intended to commit to the order of ...
user avatar
16 votes

Why are hashes in the bitcoin protocol typically computed twice (double computed)?

The wiki claim that this is to prevent birthday attacks is wrong. If you can successfully execute a birthday attack on a single call to the hash function, you get a successful birthday attack on the ...
user avatar
  • 261
16 votes
Accepted

What does the mining difficulty number really mean?

(If I may repeat myself a bit...) Mining is like having a lot of people throwing weighted coins (such that 1 millionth of the time it comes up heads) and telling you when they hit a heads. If one such ...
user avatar
  • 4,327
15 votes
Accepted

How is a block header hash compared to the target (bits)?

How to calculate the target from bits Let's start with a block-header, always 80-bytes that looks like this: ...
user avatar
  • 7,619
14 votes

How can we be sure that a new block will be found?

The important thing here is, that every mining pool/solo miner is working on a different input: They have different coinbase transactions and are working on different sets of transactions. Further ...
user avatar
  • 62.3k
14 votes
Accepted

What would happen if two blocks had the same hash?

Blocks are identified by their hash. This means that in your story, in Jan 2017, when B gets broadcast, any node that it is advertized to will think "I already have this block", and ignore it. ...
user avatar
13 votes
Accepted

hash versus hash pointer

I believe that the use of the term "pointer" in the this sentence is not referring to the low-level data type, such as int *pointer_to_int; would be in C. I think it's more referring to a "pointer" ...
user avatar
  • 8,724
12 votes

Why are hashes in the bitcoin protocol typically computed twice (double computed)?

The wiki answers this. TLDR: to prevent against birthday attacks. Bitcoin is using two hash iterations (denoted SHA256^2 ie "SHA256 function squared") and the reason for this relates to a partial ...
user avatar
  • 447
12 votes

ECDSA Signature and the "z" value

note: what Nils Schneider calls 'z', i call 'm'. this gist implements all this: https://gist.github.com/nlitsme/dda36eeef541de37d996 the calculation ecdsa signing is done as follows: given a message '...
user avatar
11 votes

Is there a way to set up proof-of-work systems so they would be even more useful?

Assume for a second that we found a proof of work algorithm that had all of the good properties of sha256, but was also useful for SETI and maintaining world peace. Now suppose a group of miners ...
user avatar
  • 421
11 votes

Why are hashes in the bitcoin protocol typically computed twice (double computed)?

Like others have said, the wiki claim of this preventing birthday attacks is wrong. Rather, this was meant to prevent against length extension attacks. From https://crypto.stackexchange.com/a/884/...
user avatar
11 votes

How is mining the exact same hash on every computer avoided?

Blocks commit to the set of transactions they contain, including the coinbase transaction. The coinbase transaction is the transaction which pays the subsidy/fees out to the miner who mined it. Since ...
user avatar
10 votes
Accepted

Visualize Bitcoin Hashing

I got linked this question. I made a tool which includes a component that allows one to simulate mining: http://yogh.io/#mine:last It's not entirely accurate; it doesn't support BIP 34, so the ...
user avatar
  • 116
9 votes
Accepted

Where did the idea of blockchain come from? Git was already using it since 2005

According to Bitcoin and Cryptocurrency Technologies (BaCT), the Princeton Bitcoin textbook, the block chain dates back to a "paper by Haber and Stornetta in 1991. Their proposal was a method for ...
user avatar
  • 62.3k
9 votes
Accepted

How to tell which part of the previous tx I need to make the hash to sign for an old given tx?

Disclaimer: I am going to assume that you are not completely clueless and that you know what an array is, how to count from 0, and how to match brackets, quotes, and colons so that you can read JSON ...
user avatar
  • 60.4k
9 votes
Accepted

Why do two miners get different hashes for the same list of transactions?

The first transaction in a block is called the "generation" or "coinbase" transaction. It has no real inputs, and spends no coins. Instead, it pays out the subsidy and fees to the miner that generated ...
user avatar
8 votes

If SHA256 produces an alphanumeric hash, how can a hash be "less than a certain value"?

Not that other answers are wrong here, but just to approach your confusion from another angle: SHA256 hashing algorithm, which produces alphanumeric hashes. That's not true. The hashing algorithm ...
user avatar
  • 6,169
8 votes
Accepted

What is Bitcoin's "genesis hash"?

They're exactly the same number; one is written in little endian notation and the other is big endian. Notice that the bytes (two-hex-digit pairs) are exactly reversed from one to the other. Block ...
user avatar
8 votes
Accepted

Breaking down a raw transaction:

The bolded byte in the following raw transaction is the number of outputs (two in this transaction): ...
user avatar
8 votes
Accepted

A security need for Bitcoin to fork to quantum resistant algorithm in a few years?

asymmetric ciphers Ones based on specific primitives, like RSA and ECDSA specifically. Symmetric algorithms are supposed to be safe. With approximately half the number of bits of security due to ...
user avatar
  • 15k
8 votes

How does a blockchain relying on PoW verify that a hash is computed using an algorithm and not made up by a human?

A Hash Function maps "data of arbitrary size to fixed-size values". As an incredibly simple hash, consider a function only works on numbers and simply returns the last 3 (decimal) digits (ie....
user avatar
  • 181
7 votes

What does the mining difficulty number really mean?

Miners task is to find a hash below a target T. Obviously if T is smaller, its more difficult to find the hash number. Difficulty D is defined by: D = Tmax/T where Tmax is: 2^224 The probability of ...
user avatar
7 votes
Accepted

Duplicated hash values in mining reward

This is a known bug in the early days of bitcoin. Was fixed by BIP-30 https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki There is a discussion here: https://bitcointalk.org/index.php?...
user avatar
  • 106
7 votes

Is it possible to convert Bitcoin Miner to Litecoin Miner?

No, you can't. And this has nothing to do with the operating system. Your hardware has a bitcoin ASIC chip made only for doing Sha-256 calculations. Litecoin uses the Scrypt algorithm. Sha-256 and ...
user avatar
  • 8,319
7 votes
Accepted

About performing SHA-256 hashing on the public key

The result you are getting (3251...) is the result of sha256 on the string 0450.... The expected output on bitcoin.it is the result of sha256 on the bytes that are currently hex-encoded. To resolve ...
user avatar
7 votes
Accepted

Why was finding a hash beginning with a certain number of zeroes chosen as the proof of work?

It reuses the HashCash construct invented by Adam Back (a scheme for proving work was done to send an email, resulting in it being treated as less spammy by spam filters), though with a newer hash ...
user avatar
7 votes

What can be changed in signed bitcoin transaction?

Here is the list of known sources of malleability from BIP62 (which has been withdrawn, and is no longer up to date, but does give some insight): DER encoded ECDSA signatures Right now, the Bitcoin ...
user avatar
7 votes

Why does the hash-rate change so drastically?

The actual hash rate of the network is not (and likely cannot be) known. Blockchain.info and any other website that tells you the network hashrate is extrapolating it from the frequency that blocks ...
user avatar
  • 60.4k
7 votes
Accepted

Why is difficulty measured in a hash’s leading zeroes?

The "leading zeros" are a simplification. The difficulty is encoded as a target which is essentially a 256 bit number. Since block hashes are produced by SHA-256, they're also a string of 256 bits. If ...
user avatar
  • 62.3k
7 votes

How does a blockchain relying on PoW verify that a hash is computed using an algorithm and not made up by a human?

Because Everyone can quickly use the transaction data to re-calculate the hash and check that it matches and is less than the target value. Computing the hash is not what takes time, it is altering ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible