Skip to main content
36 votes
Accepted

Why does hashing public keys not actually provide any quantum resistance?

Although hashing a public key by itself does provide quantum resistance, this is really only when it is considered by itself in a vacuum. Unfortunately, public key hashes do not exist in a vacuum and ...
Ava Chow's user avatar
  • 70.5k
18 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 ...
mikeazo's user avatar
  • 281
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 ...
Pieter Wuille's user avatar
16 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: ...
Jimmy Song's user avatar
  • 7,759
16 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. ...
Pieter Wuille's user avatar
14 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/...
Zain Rizvi's user avatar
14 votes

Why does Bitcoin Core print SHA256 hashes (uint256) bytes in reverse order?

From sipa on IRC (2023-01-06): jamesob: Probably dumb question, but why does uint256::ToString() (-> HexStr()) print out the blob in reversed byte order? sipa: Because that's what it has always ...
James O'Beirne's 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" ...
Jestin's user avatar
  • 8,812
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 ...
Pieter Wuille's user avatar
10 votes
Accepted

Which is the smallest hash that has ever been hashed?

The 12 lowest block hashes in Bitcoin as of Jan 22 2023: Block 756951 (0000000000000000000000005d6f06154c8685146aa7bc3dc9843876c9cefd0f) Block 742035 (...
Pieter Wuille's user avatar
10 votes

How does solving a block work in relation to the first letter/number after the 0's?

The comparison used is numeric These are numbers not strings of characters. You can see this by looking at the code in the 2009 main.cpp of the Bitcoin reference implementation: uint256 ...
RedGrittyBrick's user avatar
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 ...
Murch's user avatar
  • 75.4k
9 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 ...
Jannes's user avatar
  • 6,344
9 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 ...
Pieter Wuille's user avatar
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 ...
Ava Chow's user avatar
  • 70.5k
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 ...
Pieter Wuille's user avatar
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 ...
Nate Eldredge's 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): ...
David A. Harding's 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 ...
Claris's user avatar
  • 15.4k
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....
minnmass's user avatar
  • 181
8 votes

Are miners advertised hash rate single or double hash speeds?

Modern miners on the market have up to 110 TH/s. Is this the true hash rate (singular SHA-256 hashes per second) or the net hashes relating to Bitcoin specifically (since Bitcoin involves double ...
Pieter Wuille's user avatar
8 votes
Accepted

What are hash functions used for in bitcoin?

In consensus rules: There are script opcodes that perform hash operations on the stack: OP_SHA256: SHA256 OP_RIPEMD160: RIPEMD160 OP_SHA1: SHA1 OP_HASH160: SHA256 followed by RIPEMD160 (very ...
Pieter Wuille's user avatar
7 votes
Accepted

Blockchain SHA256 hash and nonce

The block hash has to be below a certain value and the block hash depends (among others) on the nonce and on the Merkle root. The Merkle root depends on the sequence of transactions. Note that it's a ...
UTF-8's user avatar
  • 3,224
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 ...
Ava Chow's user avatar
  • 70.5k
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 ...
Murch's user avatar
  • 75.4k
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 ...
RedGrittyBrick's user avatar
7 votes
Accepted

How can a collision attack reveal the private key?

If the attacker just tries random public keys and guesses the correct one, they obviously won't be able to spend the funds. What they can do is try random private keys and derive the public keys from ...
Vojtěch Strnad's user avatar
6 votes
Accepted

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

The hash is not alphanumeric, it's hexadecimal, that is base-16. You can convert that to a decimal number. In your case: 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 = ...
Jimmy Song's user avatar
  • 7,759
6 votes
Accepted

How long does it take to perform a single SHA256?

Simply head over to https://en.bitcoin.it/wiki/Non-specialized_hardware_comparison#CPUs.2FAPUs and look it up. For AMD, the columns nprocs and Mhash/s are important. Divide the latter by the former, ...
UTF-8's user avatar
  • 3,224
6 votes
Accepted

Mining Block header bit reversing

Let's take a look at this block, because it only has one transaction (the coinbase): 000000000000000000eb2d0ed97a7b2cff7f1408417dca83908004beb6fd9b95 Let's grab the raw hex data: ...
meshcollider's user avatar
  • 11.8k

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